github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/compile/internal/gc/bimport.go (about)

     1  // Copyright 2015 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 gc
     6  
     7  import (
     8  	"github.com/gagliardetto/golang-go/cmd/internal/src"
     9  )
    10  
    11  // numImport tracks how often a package with a given name is imported.
    12  // It is used to provide a better error message (by using the package
    13  // path to disambiguate) if a package that appears multiple times with
    14  // the same name appears in an error message.
    15  var numImport = make(map[string]int)
    16  
    17  func npos(pos src.XPos, n *Node) *Node {
    18  	n.Pos = pos
    19  	return n
    20  }
    21  
    22  func builtinCall(op Op) *Node {
    23  	return nod(OCALL, mkname(builtinpkg.Lookup(goopnames[op])), nil)
    24  }