Commit c9eb28d9 authored by Kirill Smelkov's avatar Kirill Smelkov

~staticcheck

parent df4b66e6
// Copyright (C) 2017 Nexedi SA and Contributors. // Copyright (C) 2017-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -237,7 +237,7 @@ func parseGoStart(args string) (goStart, error) { ...@@ -237,7 +237,7 @@ func parseGoStart(args string) (goStart, error) {
} }
// double-check g is the same // double-check g is the same
g2, err := strconv.Atoi(argv[3]) g2, _ := strconv.Atoi(argv[3])
if g2 != gstart.g { if g2 != gstart.g {
log.Print("found GoStart with different g") log.Print("found GoStart with different g")
return goStart{}, gStartArgvErr return goStart{}, gStartArgvErr
......
// Copyright (C) 2018-2019 Nexedi SA and Contributors. // Copyright (C) 2018-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -816,6 +816,9 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error { ...@@ -816,6 +816,9 @@ func tracegen1(P *Program, tpkg *Package, pkgdir string, kind string) error {
}{ }{
timport, timport,
traceExportHash(impPkg, "" /*regular package*/)}) traceExportHash(impPkg, "" /*regular package*/)})
if err != nil {
return err // XXX err ctx
}
text.emit("") text.emit("")
......
// Copyright (C) 2017 Nexedi SA and Contributors. // Copyright (C) 2017-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -35,16 +35,6 @@ import ( ...@@ -35,16 +35,6 @@ import (
"lab.nexedi.com/kirr/go123/exc" "lab.nexedi.com/kirr/go123/exc"
) )
func xglob(t *testing.T, pattern string) []string {
t.Helper()
matchv, err := filepath.Glob(pattern)
if err != nil {
t.Fatal(err)
}
return matchv
}
type TreePrepareMode int type TreePrepareMode int
const ( const (
TreePrepareGolden TreePrepareMode = iota // prepare golden tree - how `gotrace gen` result should look like TreePrepareGolden TreePrepareMode = iota // prepare golden tree - how `gotrace gen` result should look like
......
// Copyright (C) 2018-2020 Nexedi SA and Contributors. // Copyright (C) 2018-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -80,7 +80,7 @@ func TestLonetGoPy(t *testing.T) { ...@@ -80,7 +80,7 @@ func TestLonetGoPy(t *testing.T) {
_, err = c1.Write([]byte("hello py")); X(err) _, err = c1.Write([]byte("hello py")); X(err)
buf := make([]byte, 1024) buf := make([]byte, 1024)
n, err := c1.Read(buf) n, err := c1.Read(buf); X(err)
buf = buf[:n] buf = buf[:n]
if want := "hello go"; string(buf) != want { if want := "hello go"; string(buf) != want {
exc.Raisef("go<-py: got %q; want %q", buf, want) exc.Raisef("go<-py: got %q; want %q", buf, want)
...@@ -93,7 +93,7 @@ func TestLonetGoPy(t *testing.T) { ...@@ -93,7 +93,7 @@ func TestLonetGoPy(t *testing.T) {
assert.Eq(c2.RemoteAddr(), xaddr("β:2")) assert.Eq(c2.RemoteAddr(), xaddr("β:2"))
buf = make([]byte, 1024) buf = make([]byte, 1024)
n, err = c2.Read(buf) n, err = c2.Read(buf); X(err)
buf = buf[:n] buf = buf[:n]
if want := "hello2 go"; string(buf) != want { if want := "hello2 go"; string(buf) != want {
exc.Raisef("go<-py 2: got %q; want %q", buf, want) exc.Raisef("go<-py 2: got %q; want %q", buf, want)
......
// Copyright (C) 2017-2020 Nexedi SA and Contributors. // Copyright (C) 2017-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com> // Kirill Smelkov <kirr@nexedi.com>
// //
// This program is free software: you can Use, Study, Modify and Redistribute // This program is free software: you can Use, Study, Modify and Redistribute
...@@ -148,7 +148,7 @@ func (n *Network) Host(name string) *virtnet.Host { ...@@ -148,7 +148,7 @@ func (n *Network) Host(name string) *virtnet.Host {
// down, but won't remove it from vnet .hostMap. // down, but won't remove it from vnet .hostMap.
host = n.vnet.Host(name) host = n.vnet.Host(name)
if host == nil { if host == nil {
panic(fmt.Sprintf("pipenet: NewHost said host already is there, but it was not found")) panic("pipenet: NewHost said host already is there, but it was not found")
} }
return host return host
......
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