Skip to content

cmd/vet: false positive, only okay after go install  #16992

Closed
@hvnsweeting

Description

@hvnsweeting

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7 darwin/amd64
and
go version go1.7 linux/amd64

What operating system and processor architecture are you using (go env)?

$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hvn/FOSS/gomeo/godeps:/Users/hvn/FOSS/gomeo"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

write a package:

package govetbug

import (
        assert "github.com/stretchr/testify/require"
        "testing"
)

func TestRandomMergeMapBadRatio(t *testing.T) {
        BadRatio := 1
        var err error
        assert.Error(t, err, "Given bad ratio %d not in range (0,100) but function not fail", BadRatio)
}

then run go vet ./...

What did you expect to see?

main.go:11: possible formatting directive in Error call
exit status 1

What did you see instead?

got empty output.

Then if I run

go install .
go vet ./...

it produces expected error output.

Remove /Users/hvn/FOSS/gomeo/godeps/pkg, run go vet ./..., got empty output again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions