FAQ
Hi.

From time time to time I have noted that a compilation error of a test
module reports incorrect line numbers.

As an example, right now, the compiler is reporting an error:
/tmp/go-build603716733/github.com/perillo/store/_test/_obj_test/store.go:49:
undefined: store
where the actual error is instead at line 45:
https://gist.github.com/perillo/7934af67544117ce75cf#file-store-go-L45

Where should I start to look for the cause?

% go env

    [0]
GOARCH="amd64"
GOBIN="/home/manlio/.local/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/manlio/.local/lib/go:/home/manlio/code/src/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

This also happened with go1.5.


Thanks Manlio

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Pierre Curto at Mar 14, 2016 at 5:37 pm
    Hello,


    I have noticed the same when running tests with the -coverprofile option.
    You should probably file an issue (as I should have).


    Le lundi 14 mars 2016 18:34:42 UTC+1, Manlio Perillo a écrit :
    Hi.

    From time time to time I have noted that a compilation error of a test
    module reports incorrect line numbers.

    As an example, right now, the compiler is reporting an error:
    /tmp/go-build603716733/
    github.com/perillo/store/_test/_obj_test/store.go:49: undefined: store
    where the actual error is instead at line 45:
    https://gist.github.com/perillo/7934af67544117ce75cf#file-store-go-L45

    Where should I start to look for the cause?

    % go env

    [0]
    GOARCH="amd64"
    GOBIN="/home/manlio/.local/bin"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/manlio/.local/lib/go:/home/manlio/code/src/go"
    GORACE=""
    GOROOT="/usr/lib/go"
    GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"

    This also happened with go1.5.


    Thanks Manlio
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Manlio Perillo at Mar 14, 2016 at 6:40 pm
    Indeed, I'm using the -coverprofile flag.

    I will file an issue, thanks.

    Manlio

    Il giorno lunedì 14 marzo 2016 18:38:03 UTC+1, pierre...@gmail.com ha
    scritto:
    Hello,


    I have noticed the same when running tests with the -coverprofile option.
    You should probably file an issue (as I should have).


    Le lundi 14 mars 2016 18:34:42 UTC+1, Manlio Perillo a écrit :
    Hi.

    From time time to time I have noted that a compilation error of a test
    module reports incorrect line numbers.

    As an example, right now, the compiler is reporting an error:
    /tmp/go-build603716733/
    github.com/perillo/store/_test/_obj_test/store.go:49: undefined: store
    where the actual error is instead at line 45:
    https://gist.github.com/perillo/7934af67544117ce75cf#file-store-go-L45

    Where should I start to look for the cause?

    % go env

    [0]
    GOARCH="amd64"
    GOBIN="/home/manlio/.local/bin"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/manlio/.local/lib/go:/home/manlio/code/src/go"
    GORACE=""
    GOROOT="/usr/lib/go"
    GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"

    This also happened with go1.5.


    Thanks Manlio
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Rob Pike at Mar 14, 2016 at 8:03 pm
    https://github.com/golang/go/issues/6329 but as you'll see it's not
    feasible to fix at the moment.

    Don't bother measuring coverage on your tests until they compile.

    -rob

    On Tue, Mar 15, 2016 at 5:40 AM, Manlio Perillo wrote:

    Indeed, I'm using the -coverprofile flag.

    I will file an issue, thanks.

    Manlio


    Il giorno lunedì 14 marzo 2016 18:38:03 UTC+1, pierre...@gmail.com ha
    scritto:
    Hello,


    I have noticed the same when running tests with the -coverprofile option.
    You should probably file an issue (as I should have).


    Le lundi 14 mars 2016 18:34:42 UTC+1, Manlio Perillo a écrit :
    Hi.

    From time time to time I have noted that a compilation error of a test
    module reports incorrect line numbers.

    As an example, right now, the compiler is reporting an error:
    /tmp/go-build603716733/
    github.com/perillo/store/_test/_obj_test/store.go:49: undefined: store
    where the actual error is instead at line 45:
    https://gist.github.com/perillo/7934af67544117ce75cf#file-store-go-L45

    Where should I start to look for the cause?

    % go env

    [0]
    GOARCH="amd64"
    GOBIN="/home/manlio/.local/bin"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/manlio/.local/lib/go:/home/manlio/code/src/go"
    GORACE=""
    GOROOT="/usr/lib/go"
    GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"

    This also happened with go1.5.


    Thanks Manlio
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Manlio Perillo at Mar 14, 2016 at 8:27 pm
    Thanks.

    Note however that practitioners of Test Driven Development may be find
    the bug a bit annoying.
    I usually run the tests (using a test.sh script with coverage enable,
    to save typing) every time I change my code.

    Not a real problem, however.
    On Mon, Mar 14, 2016 at 9:03 PM, Rob Pike wrote:
    https://github.com/golang/go/issues/6329 but as you'll see it's not feasible
    to fix at the moment.

    Don't bother measuring coverage on your tests until they compile.

    -rob

    On Tue, Mar 15, 2016 at 5:40 AM, Manlio Perillo wrote:

    Indeed, I'm using the -coverprofile flag.

    I will file an issue, thanks.

    Manlio


    Il giorno lunedì 14 marzo 2016 18:38:03 UTC+1, pierre...@gmail.com ha
    scritto:
    Hello,


    I have noticed the same when running tests with the -coverprofile option.
    You should probably file an issue (as I should have).


    Le lundi 14 mars 2016 18:34:42 UTC+1, Manlio Perillo a écrit :
    Hi.

    From time time to time I have noted that a compilation error of a test
    module reports incorrect line numbers.

    As an example, right now, the compiler is reporting an error:

    /tmp/go-build603716733/github.com/perillo/store/_test/_obj_test/store.go:49:
    undefined: store
    where the actual error is instead at line 45:
    https://gist.github.com/perillo/7934af67544117ce75cf#file-store-go-L45

    Where should I start to look for the cause?

    % go env
    [0]
    GOARCH="amd64"
    GOBIN="/home/manlio/.local/bin"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/manlio/.local/lib/go:/home/manlio/code/src/go"
    GORACE=""
    GOROOT="/usr/lib/go"
    GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
    GO15VENDOREXPERIMENT="1"
    CC="gcc"
    GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
    CXX="g++"
    CGO_ENABLED="1"

    This also happened with go1.5.


    Thanks Manlio
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedMar 14, '16 at 5:34p
activeMar 14, '16 at 8:27p
posts5
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase