File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,9 @@ builds:
1111 - env :
1212 - CGO_ENABLED=0
1313 goos :
14- - linux
14+ - linux
15+ ldflags :
16+ - " -s -w -X main.version={{ .Version }}"
1517dockers :
1618 - image_templates :
1719 - " ghcr.io/outsystems/{{ .ProjectName }}:{{ .Version }}"
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package main
33import (
44 "flag"
55 "fmt"
6- "io/ioutil"
76 "log"
87 "net/http"
98 "os"
@@ -31,7 +30,7 @@ func main() {
3130
3231func generatePidFile () {
3332 pid := []byte (strconv .Itoa (os .Getpid ()))
34- if err := ioutil .WriteFile ("outsystemscc.pid" , pid , 0644 ); err != nil {
33+ if err := os .WriteFile ("outsystemscc.pid" , pid , 0644 ); err != nil {
3534 log .Fatal (err )
3635 }
3736}
@@ -51,7 +50,7 @@ func (flag *headerFlags) String() string {
5150func (flag * headerFlags ) Set (arg string ) error {
5251 index := strings .Index (arg , ":" )
5352 if index < 0 {
54- return fmt .Errorf (`Invalid header (%s). Should be in the format "HeaderName: HeaderContent"` , arg )
53+ return fmt .Errorf (`invalid header (%s). Should be in the format "HeaderName: HeaderContent"` , arg )
5554 }
5655 if flag .Header == nil {
5756 flag .Header = http.Header {}
@@ -139,6 +138,12 @@ func client(args []string) {
139138 os .Exit (0 )
140139 }
141140 flags .Parse (args )
141+
142+ // Set custom User-Agent
143+ if config .Headers .Get ("User-Agent" ) == "" {
144+ config .Headers .Set ("User-Agent" , fmt .Sprintf ("CloudConnector/%s" , version ))
145+ }
146+
142147 //pull out options, put back remaining args
143148 args = flags .Args ()
144149 if len (args ) < 2 {
You can’t perform that action at this time.
0 commit comments