diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 4ef4c04..de0a2b7 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -19,7 +19,7 @@ jobs: persist-credentials: false - uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version: "stable" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 93ce45a..117302c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -13,7 +13,7 @@ builds: - linux - windows - darwin - main: ./cmd + main: ./cmd/osmshortlink binary: osmshortlink archives: - format: tar.gz diff --git a/README.md b/README.md index a688b8a..db9e39e 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,24 @@ Prints: [`https://osm.org/go/0Ik3VNr_A-?m`](https://osm.org/go/0Ik3VNr_A-?m) ### Command-line tool -#### Run using Go +#### Installation + +##### Download the pre-built binaries + +Download the pre-built binaries for your platform from [latest release](https://github.com/stefanb/osmshortlink-go/releases/latest). + +##### Install using Go ````bash -$ go run github.com/stefanb/osmshortlink-go/cmd@main 46.05141 14.50604 17 +$ go install github.com/stefanb/osmshortlink-go/cmd/osmshortlink@latest +$ osmshortlink 46.05141 14.50604 17 +https://osm.org/go/0Ik3VNr_A-?m +```` + +#### Run using Go without installing + +````bash +$ go run github.com/stefanb/osmshortlink-go/cmd/osmshortlink@latest 46.05141 14.50604 17 https://osm.org/go/0Ik3VNr_A-?m ```` @@ -56,3 +70,11 @@ For example: $ osmshortlink 46.05141 14.50604 17 https://osm.org/go/0Ik3VNr_A-?m ``` + +## Development + +Run: `go run ./cmd/osmshortlink/main.go 46.05141 14.50604 17` + +Testing: `go test -v -race -cover ./...` + +Fuzz testing: `go test -fuzz=. -fuzztime=1m` diff --git a/cmd/main.go b/cmd/osmshortlink/main.go similarity index 100% rename from cmd/main.go rename to cmd/osmshortlink/main.go