]> Cypherpunks.ru repositories - gostls13.git/blob - src/cmd/compile/internal/noder/decl.go
8e23fcefa2789501c68e058ade2017d5d632f030
[gostls13.git] / src / cmd / compile / internal / noder / decl.go
1 // Copyright 2021 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 noder
6
7 import (
8         "cmd/compile/internal/syntax"
9         "cmd/compile/internal/types2"
10 )
11
12 // pkgNameOf returns the PkgName associated with the given ImportDecl.
13 func pkgNameOf(info *types2.Info, decl *syntax.ImportDecl) *types2.PkgName {
14         if name := decl.LocalPkgName; name != nil {
15                 return info.Defs[name].(*types2.PkgName)
16         }
17         return info.Implicits[decl].(*types2.PkgName)
18 }