Skip to content

let gofmt and goimports support the --tags flag (from go build) #9314

@metakeule

Description

@metakeule

The proposed workaround for #9310 is

$ cat release.go 
// +build !dev 
package foo // import "example.org/foo" 

to have a canonical import path, but not for development (when --tags=dev is passed to go build or go install).

however neither gofmt nor goimports allow tags to be passed, so they are not usable in this scenario. so please add support for tags to these commands.

also if the canonical path does not match the repository path, both commands hang, while they should through the same error as go build.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions