DEV Community

Discussion on: How can I learn to like Golang? (and use it a lot)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Thanks. I might try Golang again. There seems to be a lot of packages in Golang as well, actually, just like Python.

There is still an issue with GoDoc, as I mentioned above. And it mostly correlate with Swagger Codegen, as well as comment highlighting. But it is not that some languages like Python doesn't have this problem as well.

Nowadays, I rely a lot on Fastify's Request + Response validation --> and it seems that someone have ported in to Golang for me -- github.com/danielgtaylor/huma/

Again, yeah, Golang has so many packages that it might be worth it.

TBH, if I want strictness, I still have to compare Golang to Kotlin.

Collapse
 
rhymes profile image
rhymes • Edited

There is still an issue with GoDoc, as I mentioned above. And it mostly correlate with Swagger Codegen, as well as comment highlighting. But it is not that some languages like Python doesn't have this problem as well.

If there's one suggestion I can leave you with is not to try to bend Go to be similar to other languages :D Just "go with the flow" (no pun intended)

You won't find Go code with /* syntax anyway. You can find more info on Godoc here: blog.golang.org/godoc

Nowadays, I rely a lot on Fastify's Request + Response validation --> and it seems that someone have ported in to Golang for me -- github.com/danielgtaylor/huma/

I'm not familiar with Fastify or Huma but Go is pretty awesome at JSON validation having those inline tags:

type Data struct {
  Something string `json:something`
}
Enter fullscreen mode Exit fullscreen mode

which tell the JSON serializer to map the field automatically :D

I think Go is worth a try, at least! Start with gobyexample.com/ :-)