Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v0.5.1 #39

Merged
merged 2 commits into from
Oct 15, 2024
Merged
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
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ How to release a new version:

## [Unreleased]

## [0.5.1] - 2024-10-14
### Fixed
- Output preamble in generated file.

## [0.5.0] - 2024-10-14
### Added
- Use `debug.ReadBuildInfo` to get correct version.
Expand Down Expand Up @@ -58,7 +62,8 @@ How to release a new version:
### Added
- Added Changelog.

[Unreleased]: https://github.com/strvcom/strv-backend-go-tea/compare/v0.5.0...HEAD
[Unreleased]: https://github.com/strvcom/strv-backend-go-tea/compare/v0.5.1...HEAD
[0.5.1]: https://github.com/strvcom/strv-backend-go-tea/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/strvcom/strv-backend-go-tea/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/strvcom/strv-backend-go-tea/compare/v0.3.1...v0.4.0
[0.3.1]: https://github.com/strvcom/strv-backend-go-tea/compare/v0.3.0...v0.3.1
Expand Down
12 changes: 7 additions & 5 deletions cmd/tea/gen_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ import (
"github.com/spf13/cobra"
)

var (
const (
outputPreamble = "// Code generated by tea. DO NOT EDIT.\n\n"
)

var (
// genIDCmd represents the id command
genIDCmd = &cobra.Command{
Use: "id",
Expand Down Expand Up @@ -135,10 +138,6 @@ func (i IDs) generate() ([]byte, error) {
var genData []byte
var err error

if _, err = output.WriteString(outputPreamble); err != nil {
return nil, fmt.Errorf("writing output preamble: %w", err)
}

for typ := range i {
//nolint:gocritic,exhaustive
switch typ {
Expand Down Expand Up @@ -361,6 +360,9 @@ func runGenerateIDs(sourceFilePath, outputFilePath string) error {
}
}()

if _, err = outputFile.Write([]byte(outputPreamble)); err != nil {
return cmderrors.NewCommandError(fmt.Errorf("writing output preamble: %w", err), cmderrors.CodeIO)
}
if _, err = outputFile.Write(ids.generateHeader()); err != nil {
return cmderrors.NewCommandError(fmt.Errorf("writing output header: %w", err), cmderrors.CodeIO)
}
Expand Down
Loading