8 ms·
Some Go web dev notes
- voigt 2y ago> In general everything about it feels like it makes projects easy to work on for 5 days, abandon for 2 years, and then get back into writing code without a lot of problems. To me this is one of the most underrated qualities of go code. Go is a language that I started learning years ago, but did't change dramatically. So my knowledge is still useful, even almost ten years later.
- tmpz22 2y agoI agree but those first 5 days are going to be a mixed bag as you pick through libraries for logging, database drivers, migrations, as well as project organization, dependency injection patterns for testing, organize your testing structure, and more. If you have a template to derive from or sufficient Go experience you'll be fine, but selecting from a grab bag of small libraries early on in a project can be a distraction that slows down feature development significantly. I love Go but for rapid project development, like working on a personal project with limited time, or at a startup with ambitious goals, Go certainly has its tradeoffs.
- joshlemer 2y agoI stumbled on this Go starter project that has enough batteries included to get you started I think. You might find it useful https://github.com/mikestefanello/pagoda https://github.com/mikestefanello/pagoda
- tmpz22 2y agoRight and mikestefanello/pagoda seems like a comprehensive framework combining the labstack/echo/v4 routing framework and entgo.io/ent "ORM" - among other things like HTMX and Bulma. That is a highly opinionated grouping of tools that gets you to a poor persons version of a full stack framework that many in the Go community would flat out reject.
- leetrout 2y agoI really don't understand the hate for a framework in "the community". I had stayed away from Go for about 3 years and I posted on r/golang asking if anything had popped up like a django in go and got nothing but hate. I chock it up to people enjoy writing the same boiler plate stuff over and over in their paid jobs where they have the time to do it. To your point, I've got my own set of libraries that I think are The Best™ for all my reasons that at least keep me productive. Echo for the routing... sqlc for the db interface... I actually _love_ gomega and ginkgo for BDD but it makes people actually angry so I settle for testify and for logging we have slog now but I usually grab the logging lib from charm bracelet for nice colorized, leveled logging.
- cgg1 2y agoThe best thing I’ve found is beego: https://github.com/beego/beego https://github.com/beego/beego Not affiliated in any way, but to me it’s better than most of the alternatives
- onislandtime 2y agoHey, I checked your Reddit thread [1] and I see a good discussion with useful suggestions. I don't see "anything but hate" at all. There are pros and cons to using frameworks. True, many people seem to prefer to use smaller libraries. I personally don't like magic because sooner or later I lose track of what's going on and need to start guessing. With direct code I can understand faster without having to read docs and layers of source code. It's all about finding the right balance of abstractions. 1 - https://www.reddit.com/r/golang/comments/1anmoqg/what_go_libraries_make_web_products_as/ https://www.reddit.com/r/golang/comments/1anmoqg/what_go_lib...
- leetrout 2y agoFair. Maybe this is good evidence of my naturally pessimistic disposition. I was quite active with the initial replies and didn't feel like it was giving any credit to a framework.
- pepelotas 2y ago
- linhns 2y agoI'd suggest starting with the standard library instead. All other libraries come and go, standard will be there as long as Go is alive.
- DarkCrusader2 2y agoI had this exact same experience with Go. I picked up .Net (and Asp.Net for web stuff) on linux recently and found it to be much more easier to get started batteries included than Go. Don't need external libraries for any of the things you mentioned (ORM, logging, metrics, DI etc.). Razor pages are very interesting as well. I haven't used them enough to have a solid opinion yet but I really liked them for quick server rendered pages.
- mattgreenrocks 2y agoAbout 50% of the time learning a new language I find that the consensus framework/library choice is not quite to my taste. It isn’t that it’s bad, it just often feels like one thing went viral and then ends up boxed in by their success such that people double down/put up with it rather than evolve it further. Point being you’re probably going to spend those first five days evaluating the options. The “community” doesn’t know your taste or your needs. You have no idea what their goals are, or what the average skill level is. All of those things can make a big difference in selecting tech to build atop of.
- tptacek 2y agoI think 80% of this is people coming to Go from other languages (everybody comes to Go from some other language) and trying to bring what they think was best about that language to Go. To an extent unusual in languages I've worked in, it's idiomatic in Go to get by with what's in the standard library. If you're new to Go, that's what you should do: use standard logging, just use net/http and its router, use standard Go tests (without an assertion library), &c. I'm not saying you need to stay there, but if your project environment feels like Rails or Flask or whatever in your first month or two, you may have done something wrong.
- ljm 2y agoGo these days has had a good few stdlib improvements that reduce your reliance on third party libraries even further. The http router now handles path parameters and methods, so you might just pull in a library to run a middleware stack. There is structured logging in the stdlib, which works with the existing log package for an easy transition. The thing I’ve struggled with is structuring a project nicely, what with the way modules work, especially for services that aren’t exactly ‘micro’, and especially when the module and workspace system is still pretty unintuitive.
- Attummm 2y agoI completely agree with the comment, except for the Flask example. Django would be a better example. Both Flask and Golang's http package have simplicity and minimalism as their philosophy. Of course, most mature projects will eventually diverge from that. But both can start out as a single file with just a few lines of code.
- jrockway 2y agoI really think the library search is more of something you inherit from other languages, though database drivers are something you need to go looking for. The standard library has an adequate HTTP router (though I prefer grpc-gateway as it autogenerates docs, types, etc.) and logger (slog, but honestly plain log is fine). For your database driver, just use pgx. For migrations, tern is fine. For the tiniest bit of sugar around scanning database results into structs, use sqlx instead of database/sql. I wouldn't recommend using a testing framework in Go: https://go.dev/wiki/TestComments#assert-libraries https://go.dev/wiki/TestComments#assert-libraries Here's how I do dependency injection: func main() { foo := &Foo{ Parameter: goesHere, } bar := &Bar{ SomethingItNeeds: canJustBeTypedIn, } app := &App{ Foo: foo, Bar: bar, } app.ListenAndServe() } If you need more complexity, you can add more complexity. I like "zap" over "slog" for logging. I am interested in some of the DI frameworks (dig), but it's never been a clear win to me over a little bit of hand-rolled complexity like the above. A lot of people want some sort of mocking framework. I just do this: - func foo(x SomethingConcrete) { - x.Whatever() - } + interface Whateverer { Whatever() } + func foo(x Whateverer) { + x.Whatever() + } Then in the tests: type testWhateverer { n int } var _ Whateverer = (*testWhateverer)(nil) func (w *testWhateverer) Whatever() { w.n++ } func TestFoo(t *testing.T) { x := &testWhateverer{} foo(x) if got, want := x.n, 1; got != want { t.Errorf("expected Whatever to have been called: invocation count:\n got: %v\n want: %v", got, want) } } It's easy. I typed it in an HN comment in like 30 seconds. Whether or not a test that counts how many times you called Whatever is up to you, but if you need it, you need it, and it's easy to do.
- peterldowns 2y agoI've been writing Golang for years now, and I heavily endorse everything written here. Only exception is you should use my migration library [0] instead of tern — you don't need down migrations, and you can stop worrying about migration number conflicts. One other suggestion I'll make is you probably at some point should write a translation layer between your API endpoints and the http.Handler interface, so that your endpoints return `(result *T, error)` and your tests can avoid worrying about serde/typeasserting the results. [0] https://github.com/peterldowns/pgmigrate https://github.com/peterldowns/pgmigrate
- tacticus 2y ago> I agree but those first 5 days are going to be a mixed bag as you pick through libraries for logging, database drivers, migrations, as well as project organization, dependency injection patterns for testing, organize your testing structure, and more. So the same as every other language that lacks these in the standard lib?
- linhns 2y agoC++ comes to mind. Probably the worst language that's used significantly in the industry in terms of tooling and dependency management. The committee is trying to fix this, but almost no one can update to the newer standards.
- sureglymop 2y agoI would also say library quality can be generally low. E.g. there are numerous flag parsing libraries but not a single one comes even close to clap in rust.
- demi56 2y agoYou can’t just compare a library from another language, because they’re different, if all flag parsing library were inspired by Clap it’ll be a living nightmare for language that isn’t rust
- sureglymop 2y agoWhy can't I compare a library from another language? I have spent a significant amount of time with all of the popular flag parsing libraries in Go and none were as flexible yet easy to work with as clap. Anyway, I am not necessarily talking about syntax but moreso about the feature sets and overall quality.
- demi56 2y ago[dead]
- maleldil 2y agospf13/cobra and urfave/cli are fine, I think. As sibling said, you can't expect Go to have something like Rust's clap because the metaprogramming capabilities are so different. On the other hand, I find it sad how terrible stdlib's flag library is. I'd love to have something like Python's argparse, which is not perfect but enough for most of the time. Go's flag doesn't even work well for small programs. It should've been more like spf13/pflag, but as we've often seen with Go, they went "screw decades-old conventions" and did something strictly worse.
- majewsky 2y agoAs far as I understand, they respected decades-old conventions. Just not the ones we needed (Plan9 instead of POSIX/GNU getopt).
- aczerepinski 2y agoIt’s why I moved my personal site from Phoenix to Go and it has proven to he a great choice. I have zero dependencies so they never go out of date.
- ocdtrekkie 2y agoThis used to be true of PHP as well, though them finally picking off the hairy bits of bad assumptions has eroded that a fair bit. For a long time you didn't usually need to concern yourself what version of PHP 4-5 or so what version you were running on.
- almatabata 2y ago> Go is a language that I started learning years ago, but did't change dramatically. A lot of people underrate that quality I feel. C had that quality but pushed it to neurotic levels where it would change so slowly even when it needed to do it faster. Other language in contrast change too fast and try to do too many things at once. You do not often get credit for providing boring, stable programs that work. I hope they continue to do it this way and do not get seduced into overloading the language. We have a lot of fast moving languages already, so having one that moves slowly increases potential choice.
- arp242 2y agoI've picked up some Go projects after no development for years, including some I didn't write myself as a contractor. It's typically been a fairly painless experience. Typically dependencies go from "1.3.1" to "1.7.5" or something, and generally it's a "read changelogs, nothing interesting, updating just works"-type experience. On the frontend side it's typically been much more difficult. There are tons of dependencies, everything depends on everything else, there are typically many new major releases, and things can break in pretty non-obvious ways. It's not so much the language itself, it's the ecosystem as a whole. There is nothing in JavaScript-the-language or npm-the-package-manager that says the npm experience needs to be so dreadful. Yet here we are.
- mewpmewp2 2y agoArguably it's just the frontend. You can use old node in backend as much as you please. Frontend UI expectations evolve so quickly while APIs & backend can just stay the same, if it works it works.
- miki123211 2y ago> You can use old node in backend as much as you please. Not really, or at least not always. I once tried to run some old Node project on Apple Silicon. It relied on some package that wanted to download binaries, but that ancient version didn't support Apple Silicon yet. Upgrading the package to an Apple Silicon supporting version required updating half of the other dependencies, and that broke everything. Eventually, I just gave up.
- arp242 2y agoIt's not just "old node", it's also "old webpack" and "old vuejs" and "old everything". Yes, "it works" and strictly you don't really need to update it, but you're going to add a lot of friction down the line by never updating and at some point the situation will become untenable.
- mewpmewp2 2y agoOld webpack and vuejs yes, because it's the UI which does get quickly old, but APIs or also things you would do with Go don't really have to change much as time goes on. A simple Express server and that's it.
- WuxiFingerHold 2y agoAbsolutely, but not really underrated. The large and useful std lib plays an important role in the long term stability.
- draw_down 2y ago[dead]
- sacado2 2y agoAs a teacher, I have a program I've been using for the last 8 years or so. I distribute the compiled version to students for them to compare their own results with what's expected. The program's written in go. I update it every other year or so. So I'm exactly in the case you describe. I never had any issue. The program still compiles perfectly, cross-compiles to windows, linux and macos, no dependency issue, no breaking change in the language, nothing. For those use-cases, go is a godsend.
- codegeek 2y agoWhat I love about Go is its simplicity and no framework dependency. Go is popular because it has no dominating framework. Nothing wrong with frameworks when it fits the use case but I feel that we have become over dependent on framework and Go brings that freshness about just using standard libraries to create something decent with some decent battle tested 3rd party libraries. I personally love "library over framework" mindset and I found Go to do that best. Also, whether you want to build a web app or cli tool, Go wins there (for me at least). And I work a lot with PHP and .NET as well and love all 3 overall. Not to mention how easy was it for someone like me who never wrote Go before to get up and running with it quickly. Oh did I mention that I personally love the explicit error handling which gets a lot of hate (Never understood why). I can do if err != nil all day. A big Go fan.
- jeffreyrogers 2y agoI like Go for this reason as well. In Python I found the Flask framework to be suitably unobtrusive enough to be nice to use (never liked Django), but deploying python is a hassle. Go is much better in that area. The error handling never bothered me either. I think if Go shipped better support for auth/sessions in the standard library more people would use it. Having to write that code yourself (actually not very hard, but intimidating if you've never done it before) deters people and ironically the ease of creating Go packages makes it unclear which you should use if you're not going to implement it yourself.
- atomicnumber3 2y agoMy main gripe about go is that it's decent for the middle and late stages and really really bad to start with. You'll spend way too much time rewriting stuff you literally get for free by running "rails new" or "bundle add devise"
- vasilzhigilei 2y agoI love using Go for personal projects, but I keep finding myself recreating the same redis-based session storage logic, authentication, admin vs public routes, etc. Really does burn time in the beginning, even though it's fun to write the code.
- srameshc 2y agoGood to see author's mention about routing. I am mentally stuck with mux for a long time and didn't pay attention to the new release features. Happy that I always find things like these on HN.
- JodieBenitez 2y agoNice new feature, would actually make me want to use Go without Gin.
- leetrout 2y agoI am over Gin and have been for years yet everyone keeps using it because it has inertia. The docs are garbage. Big fan of Echo and it has much better docs. https://echo.labstack.com/ https://echo.labstack.com/
- xerox13ster 2y agoI had to move from Gin to echo for my personal site, the routing in Gin was refusing to serve static resources at the root path without some headache.
- JodieBenitez 2y agoThanks for the suggestion, will give it a try. I'm more familiar with Python than Go. I know my way around the Python ecosystem and can make informed decisions about which tool to use. Not so much with Go, so I appreciate your advice.
- rwdf 2y agoI've grown to prefer go-chi over Gin (or Echo), since it's just the standard library with some QoL features on top.
- thiht 2y agoChi is amazing. I love the philosophy of extending the stdlib instead of writing an alternative. I try to keep that in mind when writing my own libs or helpers now, and I'm very satisfied with the results. For example I made a lib to write commands (like cobra or urfave/cli), but based entirely on the `flag` package: https://github.com/Thiht/go-command https://github.com/Thiht/go-command
- physicles 2y agoGOMEMLIMIT has really cut down on the amount of time I’ve had to spend worrying about the GC. I’d recommend it. Plus, if you’re using kubernetes or docker, you can automatically set it to the orchestrator-managed memory limit using something like https://github.com/KimMachineGun/automemlimit https://github.com/KimMachineGun/automemlimit — no need to add any manual config at all.
- yegle 2y agoIt's sad https://pkg.go.dev/embed https://pkg.go.dev/embed was not mentioned in a post about web development in Go :-) Having a true single binary bundling your static resources is so convenient.
- okibry 2y agoWhich time golang read file, build time or run time ?
- estebarb 2y agoBuild time. It literally embeeds the file in the binary.
- catlifeonmars 2y agoBuild time
- nasretdinov 2y agoembed package allows to embed assets directly into the binary, so the files are read once during build time and then you can access them as e.g. a byte slice, a string, or a special FS object that acts like an in-memory file system
- deleted 2y ago[deleted]
- dullcrisp 2y agoIt is mentioned now.
- linhns 2y agoMassively underrated. It's actually used to build the pkg.go.dev website itself. https://github.com/golang/pkgsite https://github.com/golang/pkgsite
- avinassh 2y agoit does mention it: there’s just 1 static binary, all I need to do to deploy it is copy the binary. If there are static files I can just embed them in the binary with embed.
- gwd 2y ago> I learned the hard way that if I don’t do this then I’ll get SQLITE_BUSY errors from two threads trying to write to the db at the same time. OK, here's a potentially controversial opinion from someone coming into the web + DB field from writing operating systems: 1. Database transactions are designed to fail Therefore 2. All database transactions should done in a transaction loop Basically something like this: https://gitlab.com/martyros/sqlutil/-/blob/master/txutil/txutil.go?ref_type=heads#L35 https://gitlab.com/martyros/sqlutil/-/blob/master/txutil/txu... That loop function should really have a Context so it can be cancelled; that's future work. But the idea stands -- it should be considered normal for transactions to fail, so you should always have a retry loop around them.
- returningfory2 2y agoI don't think this controversial. Retrying failed transactions is a common strategy.
- gwd 2y agoYou're the first person I've heard say so. When I was learning DB stuff, there were loads of examples of things that looked at the error from a transaction. Not a single one of them then retried the transaction as a result. The OP's comment is a symptom of this -- they did some writes or some transactions and were getting failures, which means they weren't retrying their transactions. And then when they searched to solve the problem, the advice they received wasn't "oh, you should be retrying your transactions" -- rather, it was some complicated technical thing to avoid the problem by preventing concurrent writes.
- returningfory2 2y agoAh, interesting. Maybe my experience has been unusual then. I agree with you the retrying transactions is relatively simple and powerful.
- bornfreddy 2y agoI'm in the opposite camp. Transactions can fail, however retrying them is not the solution. It hides the symptom (which is not a problem with proper monitoring), but more importantly, it can lead to overwhelming the db server. Sometimes failure happens because of the load, in which case retrying the query is counterproductive. And even in cases where retrying would be the correct approach, it is the responsibility of the app logic, not of the db connection layer, to retry the query. Imho of course. :)
- imiric 2y agoThere are some good tips here. As for sqlc, I really wanted to like it, but it had some major limitations and minor annoyances last time I tried it a few months ago. You might want to go through its list of issues[1] before adopting it. Things like no support for dynamic queries[2], one-to-many relationships[3], embedded CTEs[4], composite types[5], etc. It might work fine if you only have simple needs, but if you ever want to do something slightly sophisticated, you'll have to fallback to the manual approach. It's partly understandable, though. It cannot realistically support every feature of every DBMS, and it's explicitly not an ORM. But I still decided to stick to the manual approach for everything, instead of wondering whether something is or isn't supported by sqlc. One tip/gotcha I recently ran into: if you run Go within containers, you should set GOMAXPROCS appropriately to avoid CPU throttling. Good explanation here[6], and solution here[7]. [1]: https://github.com/sqlc-dev/sqlc/issues/ https://github.com/sqlc-dev/sqlc/issues/ [2]: https://github.com/sqlc-dev/sqlc/issues/3414 https://github.com/sqlc-dev/sqlc/issues/3414 [3]: https://github.com/sqlc-dev/sqlc/issues/3394 https://github.com/sqlc-dev/sqlc/issues/3394 [4]: https://github.com/sqlc-dev/sqlc/issues/3128 https://github.com/sqlc-dev/sqlc/issues/3128 [5]: https://github.com/sqlc-dev/sqlc/issues/2760 https://github.com/sqlc-dev/sqlc/issues/2760 [6]: https://kanishk.io/posts/cpu-throttling-in-containerized-go-apps/ https://kanishk.io/posts/cpu-throttling-in-containerized-go-... [7]: https://github.com/uber-go/automaxprocs https://github.com/uber-go/automaxprocs
- bornfreddy 2y agoI agree that sqlc has limits, but for me it is great because it takes care of 98% of the queries (made up number) and keeps them simple to write. I can still write manual queries for the rest of them so it's still a net win.
- 0x_rs 2y agoIt gets mentioned a lot in the context of database/sql and sqlc, but Jet has been a great alternative so far, most notably because of its non-issue with dynamic queries support. https://github.com/go-jet/jet/ https://github.com/go-jet/jet/
- CBarkleyU 2y ago
- rmac 2y agothe whole gobin / gopath thing was annoying as a beginner: I just want to build this module and use that local module go build ./... Goes where ?
- coffeeindex 2y agoI believe it is recommended to not use gobin/gopath anymore. go test ./… tests all files in the project, so I assume build does something similar.
- NAHWheatCracker 2y agoMy experience with go build ./... is that it compiles everything but it doesn't make the binaries. > When compiling multiple packages or a single non-main package, build compiles the packages but discards the resulting object, serving only as a check that the packages can be built. From https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependencies https://pkg.go.dev/cmd/go#hdr-Compile_packages_and_dependenc... A bit annoying when you want to build a bunch of executables, but it's not something I need often and it's easy to script.
- arccy 2y agogo build -o some/dir/ ./... will actually output the binaries
- NAHWheatCracker 2y agoSick, I couldn't figure it out when I needed it so I just manually created a 20 line script to cd into each directory and go build.
- trustno2 2y agoOther note Sooner or later you will hit html/template, and realize it's actually very weird and has a lot of weird issues. Don't use html/template. I grew to like Templ instead
- arp242 2y agostdlib templates are a bit idiosyncratic and probably not the easiest to start with, but they do work and don't have "weird issues" AFAIK. What issues did you encounter?
- kbolino 2y agoI don't know what issues others have had with it, but for me one notable thing is that html/template strips all comments out. This is by design, but it's not documented anywhere. I've proposed making this configurable, but my proposal has gotten no traction so far.
- arp242 2y agohttps://github.com/golang/go/issues/54380 https://github.com/golang/go/issues/54380 I didn't know about that. I agree it qualifies as a "weird issue".
- emmanueloga_ 2y agoTempl [1] is great! Another go mod that helps a lot when massaging JSON (something most web servers end up doing sooner or later) is GJSON [2]. -- 1: https://github.com/a-h/templ https://github.com/a-h/templ 2: https://github.com/tidwall/gjson https://github.com/tidwall/gjson
- sethammons 2y agoI am just trying Templ. I like what I am seeing for the most part. There are some tooling ergonomics to work out. Lots of "suddenly the editor things everything is an error and nothing will autoimport or format" back to mostly working. Click to definition goes to the autogenerated code instead of the templ file. Couple things like that. But soooooooooo much better to deal with code gen than html/template. That thing is a pita
- kristianp 2y agoDoes she (or anyone else here) use net/http's built in https support? Seems implied by saying the built-in web server is used in production.
- ncruces 2y agoIf you decide to use SQLite with one (single thread) writer pool and an other reader pool, this may help: https://github.com/bxcodec/dbresolver https://github.com/bxcodec/dbresolver Also sometimes if I have two tables where I know I’ll never need to do a JOIN between them, I’ll just put them in separate databases so that I can connect to them independently. If this data belongs together and you're just doing this to improve concurrency, this may be a case where BEGIN CONCURRENT helps: https://sqlite.org/src/doc/begin-concurrent/doc/begin_concurrent.md https://sqlite.org/src/doc/begin-concurrent/doc/begin_concur... If you want to experiment with BEGIN CONCURRENT in Go you could do worse than try my SQLite driver: https://github.com/ncruces/go-sqlite3 https://github.com/ncruces/go-sqlite3 Import this package to get the version with BEGIN CONCURRENT: https://github.com/ncruces/go-sqlite3/tree/main/embed/bcw2 https://github.com/ncruces/go-sqlite3/tree/main/embed/bcw2
- zaptheimpaler 2y agoI've been using go for a month now in a new job and hate it. It feels like they learned nothing from the past 20 years of language development. Just one huge problem is that they REPEATED Java's million/billion dollar mistake with nulls. The usual way to get HTTP Headers using Go cannot distinguish between an empty header value and no header at all because the method returns "nil" for both these cases. They could've adopted option types but instead we are back to this 90s bullshit of conflating error types with valid values. If you're programming defensively, every single object reference anywhere has to be checked for nil or risk panicking now.. like why, after we literally named this a billion dollar mistake in Java, why would anyone fucking do this again? We have helper methods in our codebase just do to this: fn checkThingIsA(ctx) { thing := ctx.get(thing) if thing == nil || thing != Thing.A { return false } return true } In any sane language this is one line: ctx.get(thing).map(|x| x == Thing.A).unwrap_or(false) In Go, we have to make helper methods for the simplest things because the simplest 1-liner becomes 4 lines with the nil/error check after. We have 100 helpers that do some variation of that because everything is so verbose that could would become unreadable without it. I hate that they made and popularized this backwards dumpster fire of a language when we should know much better by now.
- sethammons 2y agoSounds like you are storing interfaces in the context. I wouldn't do that. I do hit the occasional nil reference error, but it is usually very rare. If you deal with concrete types, not interfaces, you don't have to worry about that very weird nil but not nil thing. And always use constructors.
- cle 2y ago> The usual way to get HTTP Headers using Go cannot distinguish between an empty header value and no header at all HTTP headers in Go are maps, which have a built-in mechanism for checking key existence, which distinguishes b/t empty and missing. No nils involved. if vals, ok := headers["Content-Length"]; !ok { // no content-length header was passed }
- zaptheimpaler 2y ago
- geoka9 2y agoI recently put together a "stack" of libraries to use for a new webapp project in Go; here's what I ended up using: - go-chi for routing - pgx for Postgres driver - pressly/goose for migrations (I like how it can embed migrations into the binary as long as they are in SQL/not Go) - go-jet (for type-safe SQL; sort of - it lets you write 100% Go that looks like 98% SQL) - templ - htmx (not Go-specific, but feels like a match made in heaven for templ) - authboss for auth I'm very happy with all of these choices, except maybe authboss - it's a powerful auth framework, but it took a bit of figuring out since the documentation is not very comprehensive; but it worked out in the end.
- deleted 2y ago[deleted]
- wg0 2y agoFor application development - Go is underrated. And heavily. I say this coming from Python which is really great but I like the go's damn simplicity more which is reflected everywhere. What makes me happy is that lots of critical infrastructure tooling is also in Go from datbases to web servers and cluster orchestrators.
- zerr 2y agoAre the any "fronty" back-end (or straight client/desktop) jobs using Go? i.e. I'd like to use Go on the job but all I see is AWS/Kubernetes/mix-of-DevOps kind of positions.