Skip to content

Commit

Permalink
Update docs and remove list command
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerfcsantos committed Jan 2, 2022
1 parent c14fd8e commit 1cd473b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 39 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,23 @@ To regenerate the test cases, navigate into the **go** directory and run
`go run exercises/<exercise>/.meta/gen.go`. You should see that the
`<exercise>/cases_test.go` file has changed. Commit the change.

## Managing the Go version

For an easy managment of the Go version in the `go.mod` file in all exercises, we can use `gomod-sync`.
This is a tool made in Go that can be seen in the `gomod-sync/` folder.

To update all go.mod files according to the config file (`gomod-sync/config.json`) run:

```console
$ cd gomod-sync && go run main.go update
```

To check all exercise go.mod files specify the correct Go version, run:

```console
$ cd gomod-sync && go run main.go check
```

## Pull requests

Pull requests are welcome.
Expand Down
34 changes: 24 additions & 10 deletions gomod-sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,29 @@ Some exercises must have its `go.mod` specify a Go version that is different fro
This is supported by the `exceptions` key of the configuration file, where an entry must exist for each exercise
that must not have the default version.

## Quick start

To update all go.mod files according to the config file (gomod-sync/config.json) run:

```console
$ cd gomod-sync
$ go run main.go update
```

To check all exercise go.mod files specify the correct Go version, run:

```console
$ cd gomod-sync
$ go run main.go check
```

## Installing

### Compiling locally

```console
cd gomod-sync
go build
$ cd gomod-sync
$ go build
```

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

```console
cd gomod-sync
go run main.go [command] [flags]
$ cd gomod-sync
$ go run main.go <command> [flags]
```

### Running the tests

```console
cd gomod-sync
go test ./...
$ cd gomod-sync
$ go test ./...
```

## Usage

```
gomod-sync command [flags]
gomod-sync commandUpdate gitig [flags]
Available Commands:
check Checks if all go.mod files are in the target version
completion generate the autocompletion script for the specified shell
help Help about any command
list List go.mod files and the Go version they specify
update Updates go.mod files to the target version
help Help about any command
```

Expand Down
29 changes: 0 additions & 29 deletions gomod-sync/cmd/list.go

This file was deleted.

0 comments on commit 1cd473b

Please sign in to comment.