Go
前往频道在 Telegram
// admin @denniselite go func() { channel <- news }() news := <-channel fmt.Sprintf("%s", news)
显示更多未指定国家技术与应用419
2025 年数字统计

19 455
订阅者
无数据24 小时
+47 天
-7130 天
帖子存档
The Go Wiki includes a slice trick on filtering slices without allocating
.
filtered := items[:0]
for _, x := range items {
if condition(x) {
filtered = append(filtered, x)
}
}
This post will attempt to explain how that works: https://abhinavg.net/posts/zero-alloc-slice-filter/照片不可用在 Telegram 中显示
Generic programming proposal has got accepted ✅
https://github.com/golang/go/issues/43651
Hello 👋 Recently I've stumbled upon the blog post about //go:embed directive usage: a new feature introduced in Go 1.16,
>> that allows you to include the contents of arbitrary files and directories in your Go application.
Looks quite interesting, have a look:
https://blog.carlmjohnson.net/post/2021/how-to-use-go-embed/
Go 1.16 Release Candidate 1 is released!
Go 1.16, due to have its final release in February, is now taking its final form and is ready for your production testing, say the Go team.
>>>
It is cut from release-branch.go1.16 at the revision tagged go1.16rc1. Please try your production load tests and unit tests with the new version, your help testing these pre-release versions is invaluable.
Report any problems using the issue tracker: https://golang.org/issue/new
If you have Go installed already, the easiest way to try go1.16rc1 is by using the go command:
$ go get golang.org/dl/go1.16rc1 $ go1.16rc1 downloadYou can download binary and source distributions from the usual place: https://golang.org/dl/#go1.16rc1 To find out what has changed in Go 1.16, read the draft release notes: https://tip.golang.org/doc/go1.16 Source: https://groups.google.com/g/golang-announce/c/U_FUHY4wuSc/m/3_Vw3oqpAgAJ
Discovering and exploring
mmap(memory-mapped files) using Go
mmapis a system call for mapping files into memory which can provide a neat abstraction for working with both. Here’s how to use it in Go along with when you shouldn’t. https://brunocalza.me/discovering-and-exploring-mmap-using-go/
Making SQLite faster in Go 🚀
The most popular way of using sqlite in Go happens to also be the slowest when using it in a concurrent application like a web app. Roll your own connection pool to speed things up.
https://turriate.com/articles/making-sqlite-faster-in-go
Interesting reading about a tool that examines your Go code and recommends optimal struct field arrangements to help improve memory efficiency:
https://medium.com/orijtech-developers/efficient-struct-packing-guided-pass-for-go-92255872ec72
Microservices
Hello, world!\n 😄
This week I came across my notes and bookmarks and made a list of resources where to start learning about microservices, and I’d like to share it here. Hope it’s gonna be useful.
📒Posts & Articles:
- 35 Microservices Interview Questions You Most Likely Can't Answer: https://dev.to/aershov24/35-microservices-interview-questions-you-most-likely-can-t-answer-2eoc
- Martin Fowler’s microservices, classic: https://martinfowler.com/articles/microservices.html
- Nice intro into Microservices topic from NGINX team: https://www.nginx.com/blog/introduction-to-microservices/
📚A book to read: “Building Microservices: Designing Fine-Grained Systems” - https://www.amazon.com/Building-Microservices-Designing-Fine-Grained-Systems-ebook/dp/B00T3N7XB4
🧑🏫Tutorials
🔴If you’d like to start from practice in a hard mode, feel free to go here:
- “Introduction to Microservices in Go” https://ewanvalentine.io/microservices-in-golang-part-0/ This is a big and somewhat complete series/tutorial of building a service from scratch in Go, including docker, CI configuration, deployment, Kubernetes and much more things.
🟢Easy-going practices are:
- An option with MySQL: “Build a REST API as a Go microservice together with MySQL” -https://dev.to/johanlejdung/a-mini-guide-build-a-rest-api-as-a-go-microservice-together-with-mysql-27m2
- MongoDB-based example: “Microservices: An Example With Docker, Go, and MongoDB” - https://dzone.com/articles/microservices-an-example-with-docker-go-and-mongod
照片不可用在 Telegram 中显示
How to build a terminal dashboard in Golang in 300 lines of code using termui.
https://levelup.gitconnected.com/building-a-terminal-dashboard-in-golang-in-300-lines-of-code-3b9f83f363a8
About the main function
I love how simple Go’s entry point main function is. It is where your code will start when someone runs your program.
package main
func main() {
// stuff
}
However, main is difficult to test, and it’s not clear how we access the environmental dependencies our program has, such as stdin, stdout, the command line args, the environment variables themselves, etc.
https://pace.dev/blog/2020/02/12/why-you-shouldnt-use-func-main-in-golang-by-mat-ryer.html照片不可用在 Telegram 中显示
Let's build a Full-Text Search engine in Go
Full-Text Search (FTS) is a technique for searching text in a collection of documents. A document can refer to a web page, a newspaper article, an email message, or any structured text.
Today we are going to build our own FTS engine. By the end of this post, we'll be able to search across millions of documents in less than a millisecond. We'll start with simple search queries like "give me all documents that contain the word cat" and we'll extend the engine to support more sophisticated boolean queries.
https://artem.krylysov.com/blog/2020/07/28/lets-build-a-full-text-search-engine/
That’s fantastic! 😀 An example of using Go to build something that works in the browser by way of WebAssembly
https://dstoiko.github.io/posts/go-pong-wasm/
Wow, after almost a year of silence a new info about generics in Go comes up officially 👏 the update brings to us:
- a new, updated design draft;
- an experimental tool to try generics from the draft by yourself;
- and a few lines about what’s going to happen next.
Here I’d like to post a quote from the post and then allow you to read the rest by the link below.
>>>
Introduction
It’s been almost a year since we last wrote about the possibility of adding generics to Go. It’s time for an update.
Updated design
We’ve been continuing to refine the generics design draft. We’ve written a type checker for it: a program that can parse Go code that uses generics as described in the design draft and report any type errors. We’ve written example code. And we’ve collected feedback from many, many people—thanks for providing it!
Based on what we’ve learned, we’re releasing an updated design draft. The biggest change is that we are dropping the idea of contracts. The difference between contracts and interface types was confusing, so we’re eliminating that difference. Type parameters are now constrained by interface types. Interface types are now permitted to include type lists, though only when used as constraints; in the previous design draft type lists were a feature of contracts. More complex cases will use a parameterized interface type.
We hope that people will find this design draft simpler and easier to understand.
https://blog.golang.org/generics-next-step
Hello, everyone 👋 It’s announcement time 📣
GoWayFest 4.0 - the 4th edition of the conference fully dedicated to Go - will be held online on July 11-12 and will bring together gophers and Go-fans from all over the globe.
This year’s speakers team is full of Go-stars:
◻️ Dave Cheney will share a secret how the names we give to things can affect the maintainability of the software;
◻️ Ellen Körbes will help you to speed up your “from code change to process running” benchmark for Go applications;
◻️ Iskander Sharipov with several topics about implementation an efficient VM in GO;
◻️ Mat Ryer, Andrii Soldatenko and other speakers on the website.
Lineup will be updated - subscribe not to miss the news ➡️ https://goway.io/#speakers
🌐 Check out online perks:
▪️ more great speakers with talks and Q&A in virtual rooms;
▪️ networking with go-programmers from different countries;
▪️ any talk in any track on-demand whenever you want;
▪️ no last row seats;
▪️ much cheaper tickets;
▪️ no borders, no visas, no travel arrangements;
and more cool stuff and opportunities.
Subscribe not to miss the news ➡️ https://goway.io/.
Get your ticket for 70 $ till June 29 - then the price will go up.
Use the promocode GOWAYtoGO and get your ticket with 15% off.
Join us for days full of Go and networking ➡️ https://goway.io/#tickets
照片不可用在 Telegram 中显示
“How We Created a Realtime Patient Monitoring System With Go and Vue in 3 days”
The risk of handling a Covid-19 ward
The deadly virus can infect you with a very small mistake. As healthcare workers, our frontline has to wander around the isolation wards to check vital signs of a patient from time to time. This task involves disposing of the protective gear after a visit. All just to check some reading on a device.
A request from health authorities reached us to develop a remote monitoring system for isolation wards. There are expensive softwares to remotely monitor them. But Sri Lanka might not be that rich to spend such amount of money.
https://kasvith.me/posts/how-we-created-a-realtime-patient-monitoring-system-with-go-and-vue/
Good day for everyone 👋 I kinda missed the news for a bit, but no worries, here we are: a new interesting post comes up recently from Go dev team, check it out:
A new Go API for Protocol Buffers
Joe Tsai, Damien Neil, and Herbie Ong
Introduction: We are pleased to announce the release of a major revision of the Go API for protocol buffers, Google's language-neutral data interchange format.
https://blog.golang.org/protobuf-apiv2
https://youtu.be/0c-1KJwSMCw
What’s happened to Go since Go 1.12 and what’s coming up for Go 1.14? Francesc Campoy and Maartje Eyskens took 25 minutes at last week’s FOSDEM event to bring us all up to speed.
Slides are here if you're not up for the video 🙂
https://speakerdeck.com/campoy/the-state-of-go-2020
👋 A lot of people are using validator.Validate for struct fields validation in Go. But how about to write your own custom validation rules? Check this article out:
https://medium.com/swlh/custom-struct-field-tags-and-validation-in-golang-9a7aeedcdc5b
👋 In case you're still not using Go interfaces or you're curious how they could be applied, check this small post out:
https://medium.com/better-programming/a-real-world-example-of-go-interfaces-98e89b2ddb67
(Only 2 mins read)
An overview and first impressions of Go made by an advanced JS engineer
>> As an advanced JavaScript developer, The more I work with JavaScript the more I understand the advantages of a statically typed language.
JavaScript is fascinating but sometimes you want to try something else and broaden your horizon.
This article will be a brain dump of all I’ve learned so far about Google’s Go language (I will update it as I go, pun intended).
I assume you have installed the Go binaries on your computer.
https://itnext.io/googles-go-essentials-for-node-js-javascript-developers-6d71f08d2531
