Go
19.5K subscribers
14 photos
143 links
// admin @denniselite
go func() { channel <- news }()
news := <-channel
fmt.Sprintf("%s", news)
Download Telegram
Golang 1.13 has been released last week! 🚀
Feel free to check the updates by the link:
https://blog.golang.org/go1.13
In short, there is a list of major changes:
- The go command now downloads and authenticates modules using the Go module mirror and Go checksum database by default
- Improvements to number literals
- Error wrapping
- TLS 1.3 on by default
- Improved modules support

PS In my point of view, Error handling is one of the most important syntax changes, so I’d just want to highlight it here:
The error wrapping support follows the initial proposal described https://go.googlesource.com/proposal/+/master/design/29934-error-values.md, it adds a new Wrapper() interface:
An error that wraps another error should implement Wrapper by defining an Unwrap method.

type Wrapper interface {
// Unwrap returns the next error in the error chain.
// If there is no next error, Unwrap returns nil.
Unwrap() error
}


Also, to support wrapping, fmt.Errorf now has a %w verb for creating wrapped errors, and three new functions in the errors package ( errors.Unwrap, errors.Is and errors.As ) simplify unwrapping and inspecting wrapped errors.

Thanks for your attention 🙂

PPS Given the summer is gone, I’ll try to post more news and interesting things to the channel in the future 🙂
Quite interesting reading about versioning principles in Go and how the team came up with Go modules in the end: https://research.swtch.com/vgo-principles

>>> This blog post is about how we added package versioning to Go, in the form of Go modules, and the reasons we made the choices we did. It is adapted and updated from a talk I gave at GopherCon Singapore in 2018
Serverless tech stack is becoming more and more popular, so, in case you never tried AWS Lambda functions together with Go 💙 I’d suggest you take a look at the article: this quite simple reading allows you to get the idea of the technology.
https://read.acloud.guru/serverless-golang-api-with-aws-lambda-34e442385a6a
Hello, there 👋
Today I’d like to share a really good project I’ve recently found on GitHub: *Awesome Go Storage*. You’re probably familiar with Awesome-Go project (https://github.com/avelino/awesome-go): curated list of awesome Go frameworks, libraries and software. The next repo has the same idea but more specific topic: storages and databases. I’d suggest to put it in your bookmarks 😉

========================
A curated list of awesome Go storage projects and libraries. Inspired by awesome-go repository.
========================
Table of contents:
- Storage Servers implemented in Go.
- Key-Value Store implemented in Go.
- File Systems implemented in Go.
- Databases implemented in Go (schema migration, tools, engines, query builders);
- DB drivers and libraries (SQL; NoSQL libraries for connecting and operating databases + search and Analytic Databases)

https://github.com/gostor/awesome-go-storage
Hi, channel 👋
You probably know, how to deal with WebSockets in Go, don’t you?
But what if we need to handle millions of them? In the following well-written article an approach is described which could help us to handle up to 3 million online connections 😱

https://www.freecodecamp.org/news/million-websockets-and-go-cc58418460bb/
👍31🔥1👏1
Happy New year for everyone 😀🎉 that's an interesting stuff I've found recently: how Grab deals with event sourcing and stream processing pipelines in Go. Worth to read especially the system design parts. Enjoy 🙌 https://engineering.grab.com/plumbing-at-scale
How much do you know about defers in Go?

https://rakyll.org/inlined-defers/

> An optimization in 1.14 and later for simple use cases with defer that removes most of the performance hit for deferred functions, complete with the how and the why.
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
👋 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)
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
“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/
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
👍1
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
👍1
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/
1👍1
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
👍1👎1