Debian Codegraph @

codec/codecgen/goversion_pkgpath_lt_go112.go

raw symbols SCIP
1 // Copyright (c) 2012-2020 Ugorji Nwoke. All rights reserved.
2 // Use of this source code is governed by a MIT license found in the LICENSE file.
3
4 //go:build !go1.12
5 // +build !go1.12
6
7 package main
8
9 import (
10 "go/build"
11 )
12
13 func pkgPath(dir string) (string, error) {
14 pkg, err := build.Default.ImportDir(dir, build.AllowBinary)
15 if err != nil {
16 return "", err
17 }
18 return pkg.ImportPath, nil
19 }