Commit 28777de8 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 88cc8431
......@@ -263,14 +263,6 @@ func (v BySerial) Len() int { return len(v) }
// ----------------------------------------
func xlookup(pkg *types.Package, name string) types.Object {
obj := pkg.Scope().Lookup(name)
if obj == nil {
log.Fatalf("cannot find `%s.%s`", pkg.Name(), name)
}
return obj
}
func main() {
var err error
......@@ -1869,6 +1861,16 @@ func generateCodecCode(typespec *ast.TypeSpec, codegen CodeGenerator) string {
return codegen.generatedCode()
}
// xlookup looks up <pkg>.<name> object.
// It is fatal error if the object cannot be found.
func xlookup(pkg *types.Package, name string) types.Object {
obj := pkg.Scope().Lookup(name)
if obj == nil {
log.Fatalf("cannot find `%s.%s`", pkg.Name(), name)
}
return obj
}
// isByte returns whether typ represents byte.
func isByte(typ types.Type) bool {
t, ok := typ.(*types.Basic)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment