diff --git a/CHANGELOG.md b/CHANGELOG.md index 11004e9..bbed700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.0] - 2026-03-15 + +### Added +- `--version` / `-v` flag to print the embedded version and exit +- Version is now embedded in the binary at compile time via `//go:embed VERSION` + ## [0.6.0] - 2026-03-10 ### Added @@ -88,6 +94,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Initial release +[0.7.0]: https://github.com/gooddata/gooddata-goodmock/compare/v0.6.0...v0.7.0 [0.6.0]: https://github.com/gooddata/gooddata-goodmock/compare/v0.5.1...v0.6.0 [0.5.1]: https://github.com/gooddata/gooddata-goodmock/compare/v0.5.0...v0.5.1 [0.5.0]: https://github.com/gooddata/gooddata-goodmock/compare/v0.4.0...v0.5.0 diff --git a/VERSION b/VERSION index a918a2a..faef31a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.0 +0.7.0 diff --git a/main.go b/main.go index 214636e..471c8c8 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( + _ "embed" "encoding/json" "fmt" "goodmock/internal/common" @@ -16,7 +17,18 @@ import ( "github.com/valyala/fasthttp" ) +//go:embed VERSION +var version string + func main() { + for _, arg := range os.Args[1:] { + if arg == "-v" || arg == "--version" { + fmt.Print(strings.TrimSpace(version)) + fmt.Println() + os.Exit(0) + } + } + // First arg is the mode (default: replay) mode := "replay" if len(os.Args) > 1 {