Golang Digest # 2 (1 – 28 February 2021)

3 min


Fresh selection of news and materials

Interesting in this issue

  • Web browser

  • Monitoring postal services

  • Vulnerability Scanner

  • Encrypted file system

Enjoy reading!

Training materials

News, events

  • Modules are included by default in Go 1.16 – now the go command creates packages in modular mode by default

  • Go block profiling – controls the proportion of goroutine blocking events

  • Generic – proposal to add generics accepted

  • Embed – the new embed package provides access to files embedded in the program at compile time with the new // go: embed directive

  • Unicode – the unicode package and related system-wide support has been updated from Unicode 12.0.0 to Unicode 13.0.0, which adds 5930 new characters, including 4 new scripts and 55 new emojis

Suggestions for improving the language

  • https://github.com/golang/go/issues/44221 – encoding / csv: Add the ability to get the line number of the record

    The proposal suggests a new method:

    func (r *Reader) Line() int
  • https://github.com/golang/go/issues/44253 Suggestion to add array type and size to generics

    type Array8[T any] interface {
        type [8]T
    }
    
    type ArraysOfSomeSizes[T any] interface {
        type [2]T, [4]T, [8]T, [16]T
    }

    the proposal suggests the following syntax for expressing this idea:

    type Array[T any] interface {type […]T}
  • https://github.com/golang/go/issues/36460 – cmd / go: Lazy loading of the module

  • https://github.com/golang/go/issues/44551 Suggestion to add support for fuzzing testing

    func FuzzMarshalFoo(f *testing.F) {
        // Seed the initial corpus
     f.Add("cat", big.NewInt(1341))
     f.Add("!mouse", big.NewInt(0))
     // Run the fuzz test
       f.Fuzz(func(t *testing.T, a string, num *big.Int) {
         t.Parallel() // seed corpus tests can run in parallel
       if num.Sign() <= 0 {
         t.Skip() // only test positive numbers
      }
      val, err := MarshalFoo(a, num)
      if err != nil {
          t.Skip()
        }
      if val == nil {
          t.Fatal("MarshalFoo: val == nil, err == nil")
       }
      a2, num2, err := UnmarshalFoo(val)
      if err != nil {
          t.Fatalf("failed to unmarshal valid Foo: %v", err)
      }
      if a2 == nil || num2 == nil {
        t.Error("UnmarshalFoo: a==nil, num==nil, err==nil")
         }
      if a2 != a || !num2.Equal(num) {
         t.Error("UnmarshalFoo does not match the provided input")
       }
      })
    }
  • https://github.com/golang/go/issues/44412 Suggestion to add Time.UnixMilli and Time.UnixMicro

    // UnixMilli returns the local Time corresponding to the given Unix time,
    // msec milliseconds since January 1, 1970 UTC.
    func UnixMilli(msec int64) Time {
           if msec%1e3 < 0 {
                   return unixTime(msec/1e3-1, int32((msec%1e3)1e6)+1e9)
           }
           return unixTime(msec/1e3, int32((msec%1e3)1e6))
    
    }
    
    // UnixMicro returns the local Time corresponding to the given Unix time,
    // usec milliseconds since January 1, 1970 UTC.
    func UnixMicro(usec int64) Time {
           if usec%1e6 < 0 {
                   return unixTime(usec/1e6-1, int32((usec%1e6)1e3)+1e9)
           }
           return unixTime(usec/1e6, int32((usec%1e6)1e3))
    }

Articles

Tools

  • An example of implementing clean architecture in Go projects (Golang)

  • GitOps Continuous Delivery Tool for Kubernetes Argo CD

  • Scanning for various protocols TCP, DNS, HTTP, File based on templates Nuclei – vulnerability scanner

  • A plugin for Terraform that allows you to manage the complete lifecycle of your AWS assets. This provider is supported within the HashiCorp AWS Provider group Terraform

  • High performance json library Replacing “encoding / json”

  • Subdomain discovery tool. Discovers subdomains for websites using passive online sources. It has a simple modular architecture and is optimized for speed Subfinder

  • Cross platform proxy server / client with encryption Brook

  • Customizable prompt mechanism for any shell that can change the prompt string using a function or variable Oh-my-posh

  • Scale-out and distributed GraphQL database with graph backend Dgraph

  • A tool for studying chess openings Chess-explorer-go

  • Small and simple Go compiler Babygo

  • Cli sql query tool: support sql, csv, ltsv, json, tbln Trdsql

  • Tool to work with the MP4 file type Go-mp4

  • Platform for building blockchain applications on Golang Cosmos-SDK

  • Monitoring postal services, receiving emails, checking accounts Check-mail

  • High performance, non-blocking tcp framework Nbio

  • Fast and flexible DNS server CoreDns

  • The web browser can manage cookies, history, create tabs, change user agent Surf

  • Encrypted file system GoCryptfs

  • Console application for tracking and monitoring cryptocurrency statistics in real time Cointop

  • Git command line interface Bit

  • The service collects funny commit messages from Github Commits.lol

  • A file system structure providing a simple, unified, and universal API Afero

  • FrodoKEM implementation, practical key encapsulation with quantum security FrodoKEM

  • Mouse movement simulator Busy

Video

Podcasts

Communities


0 Comments

Leave a Reply