github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/not-internal/list/context.go (about) 1 // Copyright 2014 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package list 6 7 import ( 8 "go/build" 9 ) 10 11 type Context struct { 12 GOARCH string `json:",omitempty"` // target architecture 13 GOOS string `json:",omitempty"` // target operating system 14 GOROOT string `json:",omitempty"` // Go root 15 GOPATH string `json:",omitempty"` // Go path 16 CgoEnabled bool `json:",omitempty"` // whether cgo can be used 17 UseAllFiles bool `json:",omitempty"` // use files regardless of +build lines, file names 18 Compiler string `json:",omitempty"` // compiler to assume when computing target paths 19 BuildTags []string `json:",omitempty"` // build constraints to match in +build lines 20 ReleaseTags []string `json:",omitempty"` // releases the current release is compatible with 21 InstallSuffix string `json:",omitempty"` // suffix to use in the name of the install dir 22 } 23 24 func newContext(c *build.Context) *Context { 25 return &Context{ 26 GOARCH: c.GOARCH, 27 GOOS: c.GOOS, 28 GOROOT: c.GOROOT, 29 GOPATH: c.GOPATH, 30 CgoEnabled: c.CgoEnabled, 31 UseAllFiles: c.UseAllFiles, 32 Compiler: c.Compiler, 33 BuildTags: c.BuildTags, 34 ReleaseTags: c.ReleaseTags, 35 InstallSuffix: c.InstallSuffix, 36 } 37 }