Skip to content

Commit

Permalink
Adjusted main package path for friendly install via standard `go inst…
Browse files Browse the repository at this point in the history
…all` (#28)

* Adjust main package name for installing via go

* Adjusted package name in docs

* lint with stable Go release
  • Loading branch information
stefanb authored Oct 31, 2024
1 parent d0749ef commit a76fb22
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
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.

0 comments on commit a76fb22

Please sign in to comment.