Go 1.9 released

Finally, new major version of Go programming language available now
28 August 2017   1033

Great news for Go developers. New major version of Golang available now.

Let's see what's inside.

As we mentioned before, there were planned two major new features for Go 1.9. And they are finally available.

  1. Go now supports type aliases to support gradual code repair while moving a type between packages. The type alias design document and an article on refactoring cover the problem in detail. In short, a type alias declaration has the form:
    type T1 = T2
    This declaration introduces an alias name T1—an alternate spelling—for the type denoted by T2; that is, both T1and T2 denote the same type.
     
  2. A smaller language change is that the language specification now states when implementations are allowed to fuse floating point operations together, such as by using an architecture’s “fused multiply and add” (FMA) instruction to compute x*y + z without rounding the intermediate result x*y. To force the intermediate rounding, write float64(x*y) + z.

 Also, here are some interesting updates:

  • 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 theBSF instruction.
  • The sync package has added a new Map type, safe for concurrent access. It is not a general replacement for Go's map type.
  • 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.

Learn more at release notes

Git LFS 2.5.0 to be Available

It replaces large files with text links, and their contents are stored on GitHub Enterprise servers
31 July 2018   158

The GitHub developers have updated the Git LFS extension. It replaces large files with text links, and their contents are stored on GitHub Enterprise servers. The new version fixes bugs and added new features to the old commands. 

New migration options

The git lfs migrate command received several new functions.

  • Fixing the inability to save in the repository using Git LFS. If the file is larger than 100 MB, it does not move to GitHub and the history requires rewriting with the git lfs migrate import command. If the file is less than 100 MB, the git lfs migrate import --no-rewrite command will move the file using the extension, fixing the changes in the repository.
  • Correcting the error of storing files with the extension LFS. For example, you need to store images * .png with LFS, and the file is added without using it. git lfs migrate import --fixup helps to fix the error. The--fixup flag reads the condition in the .gitattributes file and automatically converts the objects for storage using Git LFS. In the example below, the mona.png file is added without Git LFS:
$ cat .gitattributes
*.png filter=lfs diff=lfs merge=lfs -text

$ git cat-file -p :mona.png | file -s
/dev/stdin: PNG image data, 896 x 896, 8-bit/color RGBA, non-interlaced

You can fix it this way:

$ git lfs migrate import --fixup
migrate: Fetching remote refs: ..., done
migrate: Sorting commits: ..., done
migrate: Rewriting commits: 100% (2/2), done
  master        1002728154804338fe645976ad8b7258b0be0810 -> 076e2bfe114df5575b1130f694c18d1b26c86b86
migrate: Updating refs: ..., done
migrate: checkout: ..., done

$ git cat-file -p :mona.png
version https://git-lfs.github.com/spec/v1
oid sha256:49afbfc61b10df78377f8f7dac774158e1a0197740e160ea3572d9839c61ac04
size 106277

Now mona.png is in the repository using the LFS repository.

To stop working with the expansion and export of large objects, it is enough to type git lfs migrate export. The command accepts the same arguments asgit lfs migrate import, moving files from the extension.

Other changes

Modified scripts and programs that can be used to design as "crutches." Now the testing software package outputs the results in TAP format and is started by the prove command. And the assembly of the project can be done thanks to Makefile, the familiar Git users.

In addition, the fixes and improvements to support for alternative objects, as well as the output of results from subdirectories by the git lfs status command.