Suggest is a simple Go application that suggests a function to use based on a search term

Hey guys, let me know if you think this is a good idea to continue working on.

https://github.com/radovskyb/suggest.

I built suggest and the library it uses for inspection over about the last 15 hours so both the library and suggest probably need some serious re-writing. (inspect library is here)

1 Like

Sounds interesting, I’d definitely use it.

I don’t use Go everyday, so I always forget one thing or another and this might help.

It’d be interesting to try to expand to not only functions, though. Like, being able to look for stuff for concurrency and suchs - I know it might be complex, but it’s just an idea.

Anyway, keep it up! :thumbsup:

Thanks Eric. Not sure if you’ve tried it yet.

It’s not the most accurate for some things at the moment since the algorithm I wrote for actually giving functions higher priorities is very basic lol :stuck_out_tongue:.

Although I have actually tested it with a few search terms and been quite impressed myself with some of the output!

For anybody that’s interested, I’ve decided to completely re-write both inspect and suggest and make them both into something proper.

For now, I’m going to leave them both up on Github until they both eventually get replaced :slight_smile:

Something I’ve wished for is a tool that would let me enter two types and would return a method or code snippet to go from one to the other. The use case would be answering questions like “I have an http.Request and want a Writer”, “I have a string and want it as a Reader”, “I want a Writer that puts the data in a bytes.Buffer”, and so on.

Hey @mathew, for example do you mean for the “I have a string and want it as a Reader” example, you would expect output such as strings.NewReader?

If that’s what you mean, I like that so I’ll actually keep that in mind.

It’ll be quite some time before I get my code where I want it to be, since the two things I had posted were tiny small prototypes for an idea and now that I have decided to actually turn them into something for a bit of a proper fun project, it’ll actually take a while to write them, unlike just a single day like the other 2 things I had posted took.

But ideas like that are pretty awesome and should be fairly easily to be mixed in to the concept that I’m going to be working on this time!

It’s not even that far off with the bad code that it’s using now :stuck_out_tongue:
I just tried suggest -for "strings to a reader" and it’s first result was strings: func NewReader(s string) *Reader, but actually that one was more of a fluke probably :stuck_out_tongue:

Yes, that’s exactly it. I often find myself looking at standard library method lists for the type I have and scanning down for something that returns the data type I want.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.