GO 1.17 brings language and compiler enhancements

Image credit: Bamyx Technologies
  • An expression s of type []T may now be converted to array pointer type *[N]T. If a is the result of such a conversion, then corresponding indices that are in range refer to the same underlying elements: &a[i] == &s[i] for 0 <= i < N. The conversion panics if len(s) is less than N.
  • unsafe.Add: unsafe.Add(ptr, len) adds len to ptr and returns the updated pointer unsafe.Pointer(uintptr(ptr) + uintptr(len)).
  • unsafe.Slice: For expression ptr of type *T, unsafe.Slice(ptr, len) returns a slice of type []T whose underlying array starts at ptr and whose length and capacity are len.

--

--

--

We are a technology business that provides large-scale saas solutions to companies in a variety of industries.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Check if Sentence is Spelled Correctly in Go

Simple Bit Manipulation, pt. I

How to write a REST API in Go with DI

Preventing NullPointerException

Typedef in C — Getting deep

[Solved] How to install Cocoapods on M1 Mac - when “sudo gem install ffi” FAIL

Get cool swags and 70$ cloud credit / month by signing up for Civo Kubernetes program #Kube100

Type Erasure In Swift

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bamyx Technologies

Bamyx Technologies

We are a technology business that provides large-scale saas solutions to companies in a variety of industries.

More from Medium

Next Step in Open Source (Part 2)

How to use Rust in Bare-Metal Environment #1

Authentication for Dummies II

CherryPy vs Flask: Which is better?