indeedeng / go-groups Goto Github PK
View Code? Open in Web Editor NEWCommand go-groups is a CLI tool to parse go import blocks, sort, and re-group the imports
License: BSD 3-Clause "New" or "Revised" License
Command go-groups is a CLI tool to parse go import blocks, sort, and re-group the imports
License: BSD 3-Clause "New" or "Revised" License
Right now, I need to manually download the binary and move it into position. Can we provide a simple shell script that downloads the binary for the appropriate os/architecture that and places it in the users path?
go version: 1.14.5
go-groups version: 0.0.1
package main
import (
"fmt"
"testing"
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo"
)
func main() {
fmt.Println("Hello world")
RegisterFailHandler(Fail)
RunSpecsWithDefaultAndCustomReporters(&testing.T{},
"Controller Suite",
[]Reporter{})
}
goimports
properly re-ordered the imports, but go-groups
removes the import lines.
We can setup badges for
An import block with:
import (
"crypto/md5" //nolint:gosec
"fmt"
)
Becomes
import (
"fmt"
"crypto/md5" //nolint:gosec
)
After running go-groups on it. This is not a lexicographical sorting of the imports.
E.g.
$ go-groups -w ./..
$ go fmt -w ./..
flag provided but not defined: -w
usage: go fmt [-n] [-x] [packages]
Run 'go help fmt' for details.
$ gofmt -w ./..
We should reference gofmt
instead of go fmt
I've been having some rather sporadic build failures attributed to failures fetching to groups binary from Indeed:
unrecognized import path "oss.indeed.com/go/go-groups": reading https://oss.indeed.com/go/go-groups?go-get=1: 503 Service Unavailable
Here are two examples from today:
Right now, I find myself needing both this tool and goimports. As far as I can tell, the only thing goimports does that go-groups does not is clean up unused imports. It would be nice if go-groups supported this as it would drop the need for goimports almost entirely.
The default branch name for repositories created on GitHub is now main. See GitHub guidance
This started happening again yesterday. Here's a recent failure: https://github.com/depscloud/depscloud/runs/1448351245?check_suite_focus=true
cc. @cnmcavoy
title.
goimports effectively runs gofmt. go-groups should as well.
In CODE_OF_CONDUCT.md
, there is no contact email listed, only
[INSERT EMAIL ADDRESS]
There should probably be a real email address.
go version: 1.14.5
go-groups version: 0.0.1
package main
import (
// example comment
"fmt"
)
func main() {
fmt.Println("Hello world")
}
goimports
leaves comment while go-groups
removes.
Although most generated source files will produce gofmt
-compliant code they will often produce Go source that does not adhere to the go-groups
import style. It would be good if go-groups
supported an option to detect and ignore generated source files based on the documented comment convention:
^// Code generated .* DO NOT EDIT.$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.