From 2152cfbcb2be527366289e08536f7acce254d3f5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 18 Apr 2020 17:43:49 +0200 Subject: all: fix liner errors pkg/compiler/compiler.go:182: line is 125 characters func (comp *compiler) parseAttrs(descs map[string]*attrDesc, parent ast.Node, attrs []*ast.Type) (res map[*attrDesc]uint64) { sys/targets/common.go:47:21: unnecessary conversion makeMmap(^uint64(target.PageSize)+1, target.PageSize, 0), ^ sys/targets/common.go:61: File is not `gofmt`-ed with `-s` &prog.Call{ sys/windows/init.go:35: File is not `gofmt`-ed with `-s` &prog.Call{ --- pkg/compiler/compiler.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pkg/compiler') diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go index 5c5df9f04..a9146305b 100644 --- a/pkg/compiler/compiler.go +++ b/pkg/compiler/compiler.go @@ -179,37 +179,37 @@ func (comp *compiler) structIsVarlen(name string) bool { return varlen } -func (comp *compiler) parseAttrs(descs map[string]*attrDesc, parent ast.Node, attrs []*ast.Type) (res map[*attrDesc]uint64) { +func (comp *compiler) parseAttrs(descs map[string]*attrDesc, parent ast.Node, attrs []*ast.Type) map[*attrDesc]uint64 { _, parentType, parentName := parent.Info() - res = make(map[*attrDesc]uint64) + res := make(map[*attrDesc]uint64) for _, attr := range attrs { if unexpected, _, ok := checkTypeKind(attr, kindIdent); !ok { comp.error(attr.Pos, "unexpected %v, expect attribute", unexpected) - return + return res } if len(attr.Colon) != 0 { comp.error(attr.Colon[0].Pos, "unexpected ':'") - return + return res } desc := descs[attr.Ident] if desc == nil { comp.error(attr.Pos, "unknown %v %v attribute %v", parentType, parentName, attr.Ident) - return + return res } if _, ok := res[desc]; ok { comp.error(attr.Pos, "duplicate %v %v attribute %v", parentType, parentName, attr.Ident) - return + return res } val := uint64(1) if desc.HasArg { val = comp.parseAttrArg(attr) } else if len(attr.Args) != 0 { comp.error(attr.Pos, "%v attribute has args", attr.Ident) - return + return res } res[desc] = val } - return + return res } func (comp *compiler) parseAttrArg(attr *ast.Type) uint64 { -- cgit mrf-deployment