Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjusted main package path for friendly install via standard go install #28

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ builds:
- linux
- windows
- darwin
main: ./cmd
main: ./cmd/osmshortlink
binary: osmshortlink
archives:
- format: tar.gz
Expand Down
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
````

Expand All @@ -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`
File renamed without changes.