Skip to content
Open
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: 2 additions & 0 deletions go/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Go build output
/go
1 change: 1 addition & 0 deletions go/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
go 1
27 changes: 21 additions & 6 deletions go/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# GO
# Go

Skeleton project for Go.

## Prerequisites

The toolchain this project needs is declared in [`.tool-versions`](./.tool-versions):

```
go 1
```

Install those however you prefer, as long as they end up on your `PATH`. The quickest route is
[mise](https://mise.jdx.dev/), which reads the file for you:

```sh
mise install
```

## Usage
- `./script/setup` to install dependencies
- `./script/setup` to fetch dependencies
- `./script/test` to run the tests
- `./script/start` to run the code
- `./script/start` to run the app

## Structure
- Code located in [`pairing.go`](./src/pairing.go) and [`main.go`](main.go)
- Tests located in [`pairing_test.go`](./src/pairing_test.go)
- Code located in [`main.go`](./main.go) and [`src/pairing.go`](./src/pairing.go)
- Tests located in [`src/pairing_test.go`](./src/pairing_test.go)

However, you're free to organise your code as you like.
However, you're free to organise your code as you like.
6 changes: 4 additions & 2 deletions go/script/setup
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

brew install go
cd "$(dirname "${BASH_SOURCE[0]}")/.."

go mod download
4 changes: 3 additions & 1 deletion go/script/start
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -e
set -euo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")/.."

go run main.go
Loading