diff --git a/.gitignore b/.gitignore index bf60b2a..bd9beef 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,9 @@ testinput.txt # Output of the go coverage tool, specifically when used with LiteIDE *.out + +#Ignore local builds +dist/ + # Dependency directories (remove the comment below to include it) # vendor/ \ No newline at end of file diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..60bd0b1 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,42 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +before: + hooks: + - go mod download +builds: +- env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + goarch: + - 386 + - amd64 + - arm + - arm64 + ignore: + - goos: darwin + goarch: 386 +archives: +- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}' + replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ .Tag }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' + \ No newline at end of file diff --git a/README.md b/README.md index 84f3ac1..5eaf346 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ +[![Release](https://img.shields.io/github/release/mirabis/gapu.svg)](https://github.com/mirabis/gapu/releases) +[![Action Status](https://github.com/Mirabis/gapu/workflows/Release%20with%20goreleaser/badge.svg)](https://github.com/mirabis/gapu/actions) +[![Go Report Card](https://goreportcard.com/badge/github.com/Mirabis/gapu)](https://goreportcard.com/report/github.com/Mirabis/gapu) + # gapu -[![Go Report Card](https://goreportcard.com/report/github.com/Mirabis/gapu)] You feed **GAPU** (Get ArcGIS Portal Users) the base rest URL, it returns all users that can be retrieved from an anonymous principal. @@ -10,6 +13,7 @@ This can be a useful way of finding usernames belonging to a company using ArcGI ```sh go get github.com/mirabis/gapu ``` +or download a prebuilt binary from the [Releases Page](https://github.com/mirabis/gapu/releases). ## Usage The most basic usage is to simply pass the rest portal URL to the -u parameter, for example: diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..b41bea1 --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module github.com/goreleaser/goreleaser-action + +go 1.14 + +require ( + github.com/jessevdk/go-flags v1.4.0 + github.com/valyala/fasthttp v1.14.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..6f2af1b --- /dev/null +++ b/go.sum @@ -0,0 +1,16 @@ +github.com/andybalholm/brotli v1.0.0 h1:7UCwP93aiSfvWpapti8g88vVVGp2qqtGyePsSuDafo4= +github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/klauspost/compress v1.10.4 h1:jFzIFaf586tquEB5EhzQG0HwGNSlgAJpG53G6Ss11wc= +github.com/klauspost/compress v1.10.4/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.14.0 h1:67bfuW9azCMwW/Jlq/C+VeihNpAuJMWkYPBig1gdi3A= +github.com/valyala/fasthttp v1.14.0/go.mod h1:ol1PCaL0dX20wC0htZ7sYCsvCYmrouYra0zHzaclZhE= +github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/main.go b/main.go index 428443f..7f6bfaf 100644 --- a/main.go +++ b/main.go @@ -10,7 +10,7 @@ import ( "sync" "time" - flags "github.com/jessevdk/go-flags" + "github.com/jessevdk/go-flags" fasthttp "github.com/valyala/fasthttp" ) @@ -58,9 +58,8 @@ func parseResults(body []byte) (*arcgisResult, error) { } func main() { - _, err := flags.ParseArgs(&opts, os.Args) + _, err := flags.Parse(&opts) if err != nil { - fmt.Fprintln(os.Stderr, err) os.Exit(1) } var result *arcgisResult