Skip to content

Commit

Permalink
remove go1.16 build-tag
Browse files Browse the repository at this point in the history
Remove the go1.16 build-tag, as go1.16 and before reached EOL.

Some changes were needed in the generator code, as it would otherwise
produce a new "tables.go" file instead of updating the versioned one.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Oct 13, 2022
1 parent 45d33be commit a7b35a8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
3 changes: 0 additions & 3 deletions cases/tables13.0.0.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions cases/tables13.0.0_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions internal/gen/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,15 @@ func (w *CodeWriter) WriteGoFile(filename, pkg string) {
// structures and writes it as a Go file to the given file with the given
// package name and build tags for the current Unicode version,
func (w *CodeWriter) WriteVersionedGoFile(filename, pkg string) {
tags := buildTags()
if tags != "" {
pattern := fileToPattern(filename)
updateBuildTags(pattern)
filename = fmt.Sprintf(pattern, UnicodeVersion())
}
pattern := fileToPattern(filename)
updateBuildTags(pattern)
filename = fmt.Sprintf(pattern, UnicodeVersion())
f, err := os.Create(filename)
if err != nil {
log.Fatalf("Could not create file %s: %v", filename, err)
}
defer f.Close()
if _, err = w.WriteGo(f, pkg, tags); err != nil {
if _, err = w.WriteGo(f, pkg, buildTags()); err != nil {
log.Fatalf("Error writing file %s: %v", filename, err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func CLDRVersion() string {
}

var tags = []struct{ version, buildTags string }{
{"13.0.0", "go1.16"},
{"13.0.0", ""},
}

// buildTags reports the build tags used for the current Unicode version.
Expand Down

0 comments on commit a7b35a8

Please sign in to comment.