Size: a a a

2018 January 07
4gophers
Let’s Make an NTP Client in Go
https://t.co/ZTEwLXXnLX

While doing some research on network programming, I came across this blog post titled Let’s Make a NTP Client in C by David Lettier (Lettier). So, that got me inspired to do something similar in Go.
#golang #NTP
источник
2018 January 08
4gophers
So you want to write a package manager
https://t.co/kJKdQ2F4Us

You woke up this morning, rolled out of bed, and thought, “Y’know what? I don’t have enough misery and suffering in my life. I know what to do — I’ll write a language package manager!”
#golang
источник
4gophers
Measuring progress and estimating time remaining of io.Copy and other long running io.Reader/io.Writer
https://t.co/KuGKgb0xVk

Whenever we use helpers like io.Copy and ioutil.ReadAll like when we are reading from an http.Response body or uploading a file, we find that these methods block until the process is complete, even if it takes minutes or hours — and we have no way of tracking its progress or figuring out an estimate of how much time is remaining until completion.
#golang #io
источник
4gophers
Go's hidden pragmas
https://t.co/cS5q8FTiD2

This is an article about compiler directives; or as they are commonly known, pragmas. It’s derived from a talk of a similar name that I gave last year at GopherChina in Shanghai.
#golang #pragmas
источник
2018 January 10
4gophers
источник
4gophers
justforfunc #26: why are there nil channels in Go?
https://www.youtube.com/watch?v=t9bEg2A4jsw

I received a question on twitter asking if there was a good reason for nil channels other than completeness.
#golang #justforfunc
источник
4gophers
How I start in go by Peter Bourgon #golang
https://t.co/2tZUaoQTtV

Go is a lovely little programming language designed by smart people you can trust and continuously improved by a large and growing open-source community.
#golang
источник
2018 January 11
4gophers
[Из песочницы] Лёгкий «Frontend» на Golang для ручного тестирования Ethereum смарт контракта без JavaScript и Web3
https://habrahabr.ru/post/346432/

У меня возникла идея разработать надеюсь простое решение, для ручного тестирования смарт контрактов Ethereum. Стало интересно сделать, что-то похожее на функционал вкладки Run в Remix.
#golang #ethereum
источник
4gophers
#193: What's New and Different in Go 1.10
https://golangweekly.com/issues/193

#golang #news
источник
4gophers
Various Ways of Reading Files in Go
https://t.co/XIXmCYblNd

When I started learning Go, it was hard for me to get a handle on the various APIs and techniques that can be used to read files. My attempting at writing a multi-core wordcounter (kgrz/kwc) shows evidence of this initial confusion—multiple ways used in the same file.
#golang #files
источник
4gophers
A year in review of justforfunc
https://t.co/NwDgBa1E9z


Including the 5 most watched videos and a bunch of stats!
#golang #justforfunc
источник
4gophers
источник
2018 January 12
4gophers
Colly: A Fast and Elegant Web Scraping Framework
https://t.co/gdUCUUZtTG

Colly provides a clean interface to write any kind of crawler/scraper/spider
With Colly you can easily extract structured data from websites, which can be used for a wide range of applications, like data mining, data processing or archiving.
#golang #scraper #crawler
источник
4gophers
Тесты на знание Python, PHP, Golang и DevOps: разбор викторины AvitoQuiz на Highload
https://habrahabr.ru/post/346520/

Конференция Highload++ 2017 отгремела, и это было круто — как всегда. Мы пересматриваем доклады, вовсю пользуемся опытом, которым с нами поделились коллеги, и с удовольствием вспоминаем разные активности, которые проводились вне зоны докладов.
#golang #avito
источник
2018 January 14
4gophers
источник
2018 January 15
4gophers
A short guide to adding a keyword to go  
https://t.co/Y4n2fgN053

Sometimes code looks cleaner when variable declarations are listed after code that uses them. Imagine writing Go in this style.
#golang #compiler
источник
4gophers
Go makefile #golang
https://t.co/30AiN6AciN


While browsing some github repositories I stumbled over one that used a makefile as the projects task tool. I really like this solution for the following reasons:
#golang #makefile
источник
4gophers
Be Careful with Table Driven Tests and t.Parallel()  
https://t.co/J2ReZJX6pe

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

#golang #testing
источник
4gophers
Optimized abs() for int64 in Go  
https://t.co/bTpzzhpWy1

The Go programming language has no built in abs function for computing the absolute value of an integer. That is, the non-negative representation of a negative or positive number.
#golang #abs #optimisation
источник
4gophers
Writing DNS Messages From Scratch using Go
https://t.co/yDeHYs67b5

Yesterday I read a pretty interesting article from James Routley with the title Let’s hand write DNS messages. It goes all the way down to preparing a UDP query by hand and then interpreting it by reading the bytes received back.
#golang #dns #udp
источник