diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..897283c7 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,20 @@ +name: ci + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + - name: Display Go version + run: go version + - name: Build Dependencies + run: go mod tidy && go mod vendor + - name: Run Tests + run: go test -v -count=1 ./... diff --git a/bluemix/http/transport.go b/bluemix/http/transport.go index 48917f29..15226d2c 100644 --- a/bluemix/http/transport.go +++ b/bluemix/http/transport.go @@ -55,7 +55,7 @@ func (r *TraceLoggingTransport) dumpRequest(req *http.Request, start time.Time) dumpedRequest, err := httputil.DumpRequest(req, shouldDisplayBody) if err != nil { - trace.Logger.Printf(T("An error occurred while dumping request:\n{{.Error}}\n", map[string]interface{}{"Error": err.Error()})) + trace.Logger.Print(T("An error occurred while dumping request:\n{{.Error}}\n", map[string]interface{}{"Error": err.Error()})) return } @@ -76,7 +76,7 @@ func (r *TraceLoggingTransport) dumpResponse(res *http.Response, start time.Time dumpedResponse, err := httputil.DumpResponse(res, shouldDisplayBody) if err != nil { - trace.Logger.Printf(T("An error occurred while dumping response:\n{{.Error}}\n", map[string]interface{}{"Error": err.Error()})) + trace.Logger.Print(T("An error occurred while dumping response:\n{{.Error}}\n", map[string]interface{}{"Error": err.Error()})) return } diff --git a/bluemix/trace/trace.go b/bluemix/trace/trace.go index 951f7eac..9efc7d10 100644 --- a/bluemix/trace/trace.go +++ b/bluemix/trace/trace.go @@ -87,7 +87,7 @@ func NewFileLogger(path string) PrinterCloser { file, err := os.OpenFile(filepath.Clean(path), os.O_CREATE|os.O_RDWR|os.O_APPEND, 0600) if err != nil { logger := NewStdLogger() - logger.Printf(T("An error occurred when creating log file '{{.Path}}':\n{{.Error}}\n\n", map[string]interface{}{"Path": path, "Error": err.Error()})) + logger.Print(T("An error occurred when creating log file '{{.Path}}':\n{{.Error}}\n\n", map[string]interface{}{"Path": path, "Error": err.Error()})) return logger } return newLoggerImpl(file, "", 0)