libgo: update to go1.9
[official-gcc.git] / libgo / go / cmd / go / internal / list / context.go
blob68d691ebe2eeccd0e7f16ca8528204d0296854e9
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.
5 package list
7 import (
8 "go/build"
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
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,