Live data from Hacker News

Ask HN: Are you using Go for web development?

news.ycombinator.com

11–20 of 43 posts

Re: Ask HN: Are you using Go for web development?

#11
IntelliJ Ultimate with the Go Plugin. Sometimes vim-go.

The api is defined with gRPC.io and offered as a gRPC api as well as a Rest api with JSON using grpc-gateway. Database is PostgreSQL using pgx. Caching via Resis or memcached. Building testing via a Makefile with junit and cobertura reports

Re: Ask HN: Are you using Go for web development?

#13
Yes, monolithic Go RESTful JSON API services - we currently depend on go-swagger, SQLBoiler (PostgreSQL) and echo.

Workflow: we use VSCode with devContainers (docker-compose local dev env), our tasks are simply defined in a Makefile. Our high-lvl dev workflow is documented here: https://github.com/allaboutapps/go-starter/wiki/FAQ#how-does...

Difficulties: Nothing special actually. We switched from Node.js to Go in the beginning of 2020 and it's been a pleasure for our new projects (software agency). I thought it was going to be hard to onboard our staff / new hires to Go and our stack, but this really turned out to be a non issue.

Re: Ask HN: Are you using Go for web development?

#14
Yep. I write code in vim, run tests and orchestrate things with Make and I deploy to Google Cloud Run. I used to use k8s.

I write monoliths and render mostly HTML back to the client. I have a few json endpoints around for m2m APIs or to power search boxes here and there.

The main thing I’m hacking on at the moment is https://clubman.app other things are listed at https://notbad.software

A relatively up to date skeleton of my apps is at https://github.com/davidbanham/doubleboiler

Re: Ask HN: Are you using Go for web development?

#15
post #11

IntelliJ Ultimate with the Go Plugin. Sometimes vim-go. The api is defined with gRPC.io and offered as a gRPC api as well as a Rest api with JSON using grpc-gateway. Database is PostgreSQL using pgx. Caching via Resis or memcached. Building testing via a Makefile with junit and cobertura reports

Is it hard to deploy with gRPC, because of the HTTP2 requirement?

Re: Ask HN: Are you using Go for web development?

#16
Consultant using Go in a few client projects. Both use build-in-Docker for stability and less CI surprises. One uses GRPC with Profobuf, another is using an event sourcing toolkit I have authored [0]. Personally I use VSCode with gopls which has been working great for quiet some time now. Ordinary make files for combined documentation and usage of common operations.

[0] https://github.com/looplab/eventhorizon

Re: Ask HN: Are you using Go for web development?

#17
Working on a new project and part of it is web development, we're moving forward with some pain.

We use Fiber (https://gofiber.io) as web framework and Pongo2 (https://github.com/flosch/pongo2) as template engine. The Go/Fiber parts are ok, the pain is template engine.

- Pongo2 syntax is like Django/Jinja2, but not as easy as Jinja2. I use Python+Jinja2 for years in production, it's so easy to use and troubleshoot.

- No builtin i18n support. You can find some blog posts or articles introduce pongo2, but no one mentions i18n support/implementation like no one need it. We implemented our own i18n support, but still need a tool to extract strings from template files for translation.

- The macro syntax doesn't support specifying argument names while calling. e.g. `{{ my_macro("a", "b", "c") }}` is ok, but not `{{ my_macro(name1="a", name2="b", name3="c") }}`. It's hard to organize reusable HTML/CSS code snippets.

- Sometimes the custom macro is correct (syntax part), but it renders nothing in output html, but if i add the same pongo2 code in its own unittests files, it works. Didn't find a way to troubleshoot, no clue at all what the problem is.

Anyway, Go itself and the web framework are very good for web development now, just miss a Jinja2 for Go.

Re: Ask HN: Are you using Go for web development?

#18
Yes, chose Go over Rust for a prototype API backend because Google Cloud docs offers code examples in Go :p Satisfied with Go performance, strongly prefer Goland over VS Code for better debugging. Considering switching to Java or .Net for the remaining logic development, I would (perhaps naively) like to explore functional programming patterns and the potential benefits of a "larger" ecosystem (Spring Data JDBC for example).

Re: Ask HN: Are you using Go for web development?

#20
I used Go to create different web apps. One example would be https://namesmith.io (shameless plug), which I created with the Revel framework.

Revel is often seen as anti-idiomatic because it's a whole framework but it is nice to get a web app going pretty fast (with Go). These days I have a lot more experience and I probably would choose echo or something similar. Not because I think that Revel is bad but because I have a lot more freedom with those.

For editing I mostly use Vim.

Generally I would say if you create web apps maybe choose something different from Go. It certainly can be easier/more comfortable. For APIs it's still great and one of the best choices IMO.

Post reply on HN