diff options
author | marcybell <marcy@marcelinesystems.dev> | 2023-06-01 22:18:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 21:18:38 +0200 |
commit | 351bf9d0b382adcc3e073c1a293fd815bb623f37 (patch) | |
tree | bb7447e431e16dcdd195601386f7bdc31751bca5 /docs/config/README.md | |
parent | 2e8b51c5e8e712b9577bc924ff6717880863d17d (diff) |
feat(golang): adding `mod_version` variable (#5177)
Diffstat (limited to 'docs/config/README.md')
-rw-r--r-- | docs/config/README.md | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/docs/config/README.md b/docs/config/README.md index b80f0fede..d75c805d3 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -1972,24 +1972,26 @@ By default the module will be shown if any of the following conditions are met: ### Options -| Option | Default | Description | -| ------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `format` | `'via [$symbol($version )]($style)'` | The format for the module. | -| `version_format` | `'v${raw}'` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | -| `symbol` | `'🐹 '` | A format string representing the symbol of Go. | -| `detect_extensions` | `['go']` | Which extensions should trigger this module. | -| `detect_files` | `['go.mod', 'go.sum', 'go.work', 'glide.yaml', 'Gopkg.yml', 'Gopkg.lock', '.go-version']` | Which filenames should trigger this module. | -| `detect_folders` | `['Godeps']` | Which folders should trigger this module. | -| `style` | `'bold cyan'` | The style for the module. | -| `disabled` | `false` | Disables the `golang` module. | +| Option | Default | Description | +| ------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `format` | `'via [$symbol($version )]($style)'` | The format for the module. | +| `version_format` | `'v${raw}'` | The version format. Available vars are `raw`, `major`, `minor`, & `patch` | +| `symbol` | `'🐹 '` | A format string representing the symbol of Go. | +| `detect_extensions` | `['go']` | Which extensions should trigger this module. | +| `detect_files` | `['go.mod', 'go.sum', 'go.work', 'glide.yaml', 'Gopkg.yml', 'Gopkg.lock', '.go-version']` | Which filenames should trigger this module. | +| `detect_folders` | `['Godeps']` | Which folders should trigger this module. | +| `style` | `'bold cyan'` | The style for the module. | +| `not_capable_style` | `'bold red'` | The style for the module when the go directive in the go.mod file does not match the installed Go version. | +| `disabled` | `false` | Disables the `golang` module. | ### Variables -| Variable | Example | Description | -| -------- | --------- | ------------------------------------ | -| version | `v1.12.1` | The version of `go` | -| symbol | | Mirrors the value of option `symbol` | -| style\* | | Mirrors the value of option `style` | +| Variable | Example | Description | +| ----------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| version | `v1.12.1` | The version of `go` | +| mod_version | `1.16` | `go` version requirement as set in the go directive of `go.mod`. Will only show if the version requirement does not match the `go` version. | +| symbol | | Mirrors the value of option `symbol` | +| style\* | | Mirrors the value of option `style` | *: This variable can only be used as a part of a style string @@ -2002,6 +2004,15 @@ By default the module will be shown if any of the following conditions are met: format = 'via [🏎💨 $version](bold cyan) ' ``` +### Using `mod_version` + +```toml +# ~/.config/starship.toml + +[golang] +format = 'via [$symbol($version )($mod_version )]($style)' +``` + ## Guix-shell The `guix_shell` module shows the [guix-shell](https://guix.gnu.org/manual/devel/en/html_node/Invoking-guix-shell.html) environment. |