Skip to content

cmd/go: build fails if filename is provided #26798

@allenpetersen

Description

@allenpetersen

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

go1.11beta3

Does this issue reproduce with the latest release?

Doesn't repro on go1.10 or go1.11beta2

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

GOARCH="amd64"
GOOS="darwin"

What did you do?

Made single main.go hello world app with one line go.mod file
Ran go build -o bin/mod-test main.go

What did you expect to see?

Successful build

What did you see instead?

Build error:
build main: cannot find module for path main

If I run the build without the filename
go build -o bin/mod-test it works fine

This is a change from previous versions of Go.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions