Skip to content
Permalink
Browse files

add a drop-in replacement for goimports

  • Loading branch information...
mvdan committed Apr 9, 2019
1 parent 9ef2c07 commit edb99e29e7183ebd65d01f5a72beb228a57e76e9
@@ -10,6 +10,10 @@ is, `gofumpt` is happy with a subset of the formats that `gofmt` is happy with.
The tool is a modified fork of `gofmt`, so it can be used as a drop-in
replacement. Running `gofmt` after `gofumpt` should be a no-op.

A drop-in replacement for `goimports` is also available:

cd $(mktemp -d); go mod init tmp; go get mvdan.cc/gofumpt/gofumports

### Features

No empty lines at the beginning or end of a function
@@ -137,9 +141,9 @@ func Foo() {}

### License

Note that much of the code is copied from Go's `cmd/gofmt` command. You can tell
which files originate from the Go repository from their copyright headers. Their
license file is `LICENSE.google`.
Note that much of the code is copied from Go's `gofmt` and `goimports` commands.
You can tell which files originate from the Go repository from their copyright
headers. Their license file is `LICENSE.google`.

`gofumpt`'s original source files are also under the 3-clause BSD license, with
the separate file `LICENSE`.
5 go.mod
@@ -2,4 +2,7 @@ module mvdan.cc/gofumpt

go 1.12

require github.com/rogpeppe/go-internal v1.2.2
require (
github.com/rogpeppe/go-internal v1.2.2
golang.org/x/tools v0.0.0-20190409171012-9e5445377b7a
)
6 go.sum
@@ -5,6 +5,12 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/rogpeppe/go-internal v1.2.2 h1:J7U/N7eRtzjhs26d6GqMh2HBuXP8/Z64Densiiieafo=
github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20190409171012-9e5445377b7a h1:OnPU9zWcVCK3+a9ZDP29UWkSiQ4WGXV1d57yVMALc3g=
golang.org/x/tools v0.0.0-20190409171012-9e5445377b7a/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=

0 comments on commit edb99e2

Please sign in to comment.
You can’t perform that action at this time.