about golang

前端之家收集整理的这篇文章主要介绍了about golang前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

About golang

Build Constraints (约束平台的编译)

Build constraints are a language construct that can be used to control the platforms and architectures on which a file will be compiled. They come in two flavors:

filename-based

Simple but inflexible

using filenames: <name>[_GOOS][_GOARCH].<extension> (e.g. taskbar_windows.go)

build constraint comment at top of file

More complex,much more flexible,and in my opinion much uglier

using file comments: // +build linux,386 darwin,!cgo

This comment must appear before any actual code in the file.

ref:

猜你在找的Go相关文章