File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package internal
22
33import (
44 "context"
5+ "encoding/base64"
56 "fmt"
67 "io"
78 "os"
@@ -177,8 +178,8 @@ func (b Builder) goBuild(ctx context.Context, binaryName string) error {
177178 cmd := exec .CommandContext (ctx , "go" , "build" ,
178179 "-ldflags" ,
179180 fmt .Sprintf (
180- "-s -w -X 'main.version=%s-custom-gcl ' -X 'main.date=%s'" ,
181- sanitizeVersion (b .cfg .Version ), time .Now ().UTC ().String (),
181+ "-s -w -X 'main.version=%s' -X 'main.date=%s'" ,
182+ createVersion (b .cfg .Version ), time .Now ().UTC ().String (),
182183 ),
183184 "-o" , binaryName ,
184185 "./cmd/golangci-lint" ,
@@ -241,6 +242,10 @@ func (b Builder) getBinaryName() string {
241242 return name
242243}
243244
245+ func createVersion (orig string ) string {
246+ return sanitizeVersion (orig ) + "-custom-gcl-" + base64 .RawURLEncoding .EncodeToString ([]byte (time .Now ().UTC ().String ()))
247+ }
248+
244249func sanitizeVersion (v string ) string {
245250 fn := func (c rune ) bool {
246251 return ! unicode .IsLetter (c ) && ! unicode .IsNumber (c ) && c != '.' && c != '/'
You can’t perform that action at this time.
0 commit comments