Cookies op Tweakers

Tweakers maakt gebruik van cookies, onder andere om de website te analyseren, het gebruiksgemak te vergroten en advertenties te tonen. Door gebruik te maken van deze website, of door op 'Ga verder' te klikken, geef je toestemming voor het gebruik van cookies. Wil je meer informatie over cookies en hoe ze worden gebruikt, bekijk dan ons cookiebeleid.

Meer informatie

Software-update: Go 1.9

Go, ook aangeduid als golang, is een programmeertaal die sinds 2007 ontwikkeld wordt door Google en de opensourcegemeenschap. De taal wordt onder andere door CloudFlare, Google, Netflix en Uber gebruikt. Go-code kan worden gecompileerd voor Android, Linux, OS X, FreeBSD en Windows op i386-, amd64- en ARM-processorarchitecturen. De syntax van Go is vergelijkbaar met die van C en soortgelijke programmeertalen, hoewel er ook enkele opvallende verschillen zijn. Ook biedt Go de mogelijkheid voor gedistribueerd programmeren, waarbij verschillende processen tegelijk uitgevoerd worden. Het team heeft enkele dagen geleden Go 1.9 vrijgegeven met de volgende aankondiging:

Go 1.9 is released

Today the Go team is happy to announce the release of Go 1.9. You can get it from the download page. There are many changes to the language, standard library, runtime, and tooling. This post covers the most significant visible ones. Most of the engineering effort put into this release went to improvements of the runtime and tooling, which makes for a less exciting announcement, but nonetheless a great release.

The most important change to the language is the introduction of type aliases: a feature created to support gradual code repair. A type alias declaration has the form:
type T1 = T2

This declaration introduces an alias name T1 for the type T2, in the same way that byte has always been an alias for uint8. The type alias design document and an article on refactoring cover this addition in more detail.

The new math/bits package provides bit counting and manipulation functions for unsigned integers, implemented by special CPU instructions when possible. For example, on x86-64 systems, bits.TrailingZeros(x) uses the BSF instruction.

The sync package has added a new Map type, safe for concurrent access. You can read more about it from its documentation and learn more about why it was created from this GopherCon 2017 lightning talk (slides). It is not a general replacement for Go's map type; please see the documentation to learn when it should be used.

The testing package also has an addition. The new Helper method, added to both testing.T and testing.B, marks the calling function as a test helper function. When the testing package prints file and line information, it shows the location of the call to a helper function instead of a line in the helper function itself.

For example, consider this test:

package p

import "testing"

func failure(t *testing.T) {
t.Helper() // This call silences this function in error reports.
t.Fatal("failure")
}

func Test(t *testing.T) {
failure(t)
}


Because failure identifies itself as a test helper, the error message printed during Test will indicate line 11, where failure is called, instead of line 7, where failure calls t.Fatal.

The time package now transparently tracks monotonic time in each Time value, making computing durations between two Time values a safe operation in the presence of wall clock adjustments. For example, this code now computes the right elapsed time even across a leap second clock reset:
start := time.Now()
f()
elapsed := time.Since(start)


See the package docs and design document for details.

Finally, as part of the efforts to make the Go compiler faster, Go 1.9 compiles functions in a package concurrently.

Go 1.9 includes many more additions, improvements, and fixes. Find the complete set of changes, and more information about the improvements listed above, in the Go 1.9 release notes.

To celebrate the release, Go User Groups around the world are holding release parties.

By Francesc Campoy
Versienummer 1.9
Releasestatus Final
Besturingssystemen Windows 7, Android, Linux, BSD, macOS, Solaris, UNIX, Windows Server 2008, Windows Server 2012, Windows 8, Windows 10
Website The Go Blog
Download https://golang.org/dl/
Licentietype Voorwaarden (GNU/BSD/etc.)

Door

Meukposter

3 Linkedin Google+

Bron: The Go Blog

Update-historie

Meer historie

Reacties (3)

Wijzig sortering
Zwaar upcoming taaltje; heerlijk ontwikkelen. Compiled cross-platform, geen jvm nodig. Static binaries voor Linux, Darwin en Wnidows. Top!
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}


slechts 2.2mb binary, om 'hallo wereld' te zeggen ....
:) als je hierover klaagt, dan heb je het niet helemaal begrepen.

Op dit item kan niet meer gereageerd worden.


Call of Duty: Black Ops 4 HTC U12+ dual sim LG W7 Google Pixel 3 XL OnePlus 6 Battlefield V Samsung Galaxy S9 Dual Sim Google Pixel 3

Tweakers vormt samen met Tweakers Elect, Hardware.Info, Autotrack, Nationale Vacaturebank en Intermediair de Persgroep Online Services B.V. © 1998 - 2018 Hosting door True

*