You're trying to build oapi-codegen package, which has no go files to build.
Try go build <path_to_main.go>
>
> However, this works:
> $ go build ./...
>
> Why can't my module find itself?
>
> I am using Go 1.12.7 on OS X. GO111MODULE=auto, and I am not in my $GOPATH. The
> go.mod contains:
> module
github.com/deepmap/oapi-codegen
>
> require (... <lots of stuff> ...)
>
> The same issue happens with go generate, go test, etc, but that makes sense as it all builds on top of the build command.
>
> Thanks for any tips,
> -- Marcin
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29LsHRrbULJDcT8kP8fnmP%3Dc8G0Oa1PXwLZ3a%2BPzN%2BWa8wg%40mail.gmail.com.