go
Gin
Our great sponsors
go | Gin | |
---|---|---|
1849 | 137 | |
111,942 | 69,259 | |
1.1% | 1.1% | |
10.0 | 9.1 | |
about 21 hours ago | about 13 hours ago | |
Go | Go | |
BSD 3-clause "New" or "Revised" License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
go
-
Go 1.20.5 is released
Seems like this go runtime deadlock fix didn't get included.
-
If you must read the rest of this document to understand the behavior of your program, you are being too clever. Don't be clever.
Nothing new in fact, it's part of the culture. There is no "why", just "don't"s - an example among others https://github.com/golang/go/issues/45179
Not to worry, at least the Go team itself is still having trouble with its own completely uncheckable locking.
-
Is there a good place to find best practices?
I usually see and recommend: https://go.dev/talks/2013/bestpractices.slide#1 https://go.dev/talks/2014/readability.slide#1 https://github.com/golang/go/wiki/CodeReviewComments https://about.sourcegraph.com/blog/go/idiomatic-go https://github.com/teivah/100-go-mistakes
-
Learn x86-64 assembly by writing a GUI from scratch
Example of assembly in Go source code:
https://github.com/golang/go/blob/master/src/crypto/md5/md5b...
-
Why no src directory?
This mother of all things has a dedicated src directory, so it really comes down to each project to choose its own file structure.
-
Exploring Async PHP
There are many solutions available without requiring PHP 8.1 that have been battle tested, but it's interesting to see the direction the PHP language is going in to compete with the likes of Golang and Elixir, both of which support async programming and have done for years.
-
Some annoying moments in Golang
I dislike how the implicit reference-like behavior of slices, maps, channels, and function pointers confuses newcomers to the language. It would be less ergonomic to have to declare them as pointer types, but it would be more clear to readers. The language used to actually do this in its pre-1.0 infancy (example). Everything is passed by value, but the values are pointer themselves to the actual data structures.
Will change in Go 1.21
Gin
- PHP to Golang
-
Could I get a code review?
Use a library for HTTP serving, such as Gin, Chi, or Echo. I personally use Chi, as it's just the right level of abstraction for how I like to work. Despite what others say here, don't try to re-implement everything in a modern serving library using the standard library.
-
From Golang Beginner to Building Basic Web Server in 4 Days!
For building my web server, I chose to use the Gin framework as the foundation of my app. It was incredibly easy to understand and work with, and I was pleasantly surprised by how seamlessly it integrated with writing unit tests for the server. To handle the database, I leveraged the power of go-sqlite and migrate for efficient SQL queries and migrations. These libraries proved to be both powerful and user-friendly, making the development process a breeze.
-
Dumb question about APIs, Mux and Go
Popular with a ton of features: https://gin-gonic.com/
-
Keep the Monolith, but Split the Workloads
CustomRecoveryWithWriter returns a middleware for a given writer that recovers from any panics and calls the provided handle func to handle it.
-
How to build an API using Go
Now that we have set up the Go environment, we can start building our API. The first step is to choose a framework. There are several popular frameworks for building APIs in Go, such as Gorilla mux, Echo, and Gin. For this article, we'll use Gorilla mux.
- what's your recommended router? chi, mux, something else?
-
go-mir - a toolkit to develop RESTful API backend service like develop service of gRPC
Mir is a toolkit to develop RESTful API backend service like develop service of gRPC. It adapt some HTTP framework sush as Gin, Chi, Hertz, Echo, Iris, Fiber, Macaron, Mux, httprouter。
-
6 ways to boost the performance of your Go applications
Correct example is here. But instead I suggest you just use unsafe.String and unsafe.Slice since runtime headers are deprecated anyway. You can find example here.
unsafe.Slice and unsafe.String came with Go 1.20 as I remember I will add that part, what do you think about Gin 1.19 bytesconv implementation? Is there a similar issue maybe?
What are some alternatives?
Fiber - ⚡️ Express inspired web framework written in Go
mux - A powerful HTTP router and URL matcher for building Go web servers with 🦍
Echo - High performance, minimalist Go web framework
chi - lightweight, idiomatic and composable router for building Go HTTP services
Beego - beego is an open-source, high-performance web framework for the Go programming language.
Iris - The fastest HTTP/2 Go Web Framework. New, modern and easy to learn. Fast development with Code you control. Unbeatable cost-performance ratio :rocket:
go-kit - A standard library for microservices.
Revel - A high productivity, full-stack web framework for the Go language.
fasthttp - Fast HTTP package for Go. Tuned for high performance. Zero memory allocations in hot paths. Up to 10x faster than net/http
fasthttprouter - A high performance fasthttp request router that scales well
httprouter - A high performance HTTP request router that scales well
Buffalo - Rapid Web Development w/ Go