Skip to content

Commit f7c1bc9

Browse files
Update docs and remove list command
1 parent 2fe24f5 commit f7c1bc9

File tree

3 files changed

+41
-39
lines changed

3 files changed

+41
-39
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,23 @@ To regenerate the test cases, navigate into the **go** directory and run
225225
`GO111MODULE=off go run exercises/practice/<exercise>/.meta/gen.go`. You should see that the
226226
`<exercise>/cases_test.go` file has changed. Commit the change.
227227

228+
## Managing the Go version
229+
230+
For an easy managment of the Go version in the `go.mod` file in all exercises, we can use `gomod-sync`.
231+
This is a tool made in Go that can be seen in the `gomod-sync/` folder.
232+
233+
To update all go.mod files according to the config file (`gomod-sync/config.json`) run:
234+
235+
```console
236+
$ cd gomod-sync && go run main.go update
237+
```
238+
239+
To check all exercise go.mod files specify the correct Go version, run:
240+
241+
```console
242+
$ cd gomod-sync && go run main.go check
243+
```
244+
228245
## Pull requests
229246

230247
Pull requests are welcome.

gomod-sync/README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,29 @@ Some exercises must have its `go.mod` specify a Go version that is different fro
99
This is supported by the `exceptions` key of the configuration file, where an entry must exist for each exercise
1010
that must not have the default version.
1111

12+
## Quick start
13+
14+
To update all go.mod files according to the config file (gomod-sync/config.json) run:
15+
16+
```console
17+
$ cd gomod-sync
18+
$ go run main.go update
19+
```
20+
21+
To check all exercise go.mod files specify the correct Go version, run:
22+
23+
```console
24+
$ cd gomod-sync
25+
$ go run main.go check
26+
```
27+
1228
## Installing
1329

1430
### Compiling locally
1531

1632
```console
17-
cd gomod-sync
18-
go build
33+
$ cd gomod-sync
34+
$ go build
1935
```
2036

2137
This will create an executable `gomod-sync` (`gomod-sync.exe` in windows) in the current directory
@@ -24,28 +40,26 @@ that you can run to execute the program.
2440
### Running without compiling
2541

2642
```console
27-
cd gomod-sync
28-
go run main.go [command] [flags]
43+
$ cd gomod-sync
44+
$ go run main.go <command> [flags]
2945
```
3046

3147
### Running the tests
3248

3349
```console
34-
cd gomod-sync
35-
go test ./...
50+
$ cd gomod-sync
51+
$ go test ./...
3652
```
3753

3854
## Usage
3955

4056
```
41-
gomod-sync command [flags]
57+
gomod-sync commandUpdate gitig [flags]
4258
4359
Available Commands:
4460
check Checks if all go.mod files are in the target version
45-
completion generate the autocompletion script for the specified shell
46-
help Help about any command
47-
list List go.mod files and the Go version they specify
4861
update Updates go.mod files to the target version
62+
help Help about any command
4963
5064
```
5165

gomod-sync/cmd/list.go

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)