5 ms·
Another great resource for getting started is https://gobyexample.com/ https://gobyexample.com/. Also check out usage examples on Sourcegraph (disclaimer: I'm
by beliu 10y ago
Another great resource for getting started is https://gobyexample.com/ https://gobyexample.com/.
Also check out usage examples on Sourcegraph (disclaimer: I'm the CTO). We sell our tool to companies to use on their private code, but a side effect is that we've indexed usage examples for just about every popular Go open-source library. For example,
- Go std lib http package: https://sourcegraph.com/github.com/golang/go@bb41b4d599f5758e25091666e123c41b401ac890/-/blob/src/net/http/request.go#L758:6-758:16 https://sourcegraph.com/github.com/golang/go@bb41b4d599f5758...
- Popular gorilla/mux routing library: https://sourcegraph.com/github.com/gorilla/mux@34bf6dc9faa08144e925df4fa1838551b16d6c2a/-/blob/mux.go#L17:6-17:15 https://sourcegraph.com/github.com/gorilla/mux@34bf6dc9faa08...
- Gorp, a popular ORM-ish library: https://sourcegraph.com/github.com/go-gorp/gorp@033bf796a22fc4f028c72754ca00e124e25d2928/-/blob/gorp.go#L98:6-98:17 https://sourcegraph.com/github.com/go-gorp/gorp@033bf796a22f...
Cross-repo jump-to-def + find-references = great for making sense of new code.
- sethammons 10y agoI would replace gorp with https://github.com/vattle/sqlboiler https://github.com/vattle/sqlboiler. Granted, I've not used either, but I like the philosophy behind sqlboiler. I feel it is more in line with Go principles. I also believe gorp will have issues with the new DB context stuff (though I'm not positive on that).