Skip to content
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
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -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 ./...
4 changes: 2 additions & 2 deletions bluemix/http/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()}))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering why this was necessary?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to avoid the vet errors when running the unit tests

return
}

Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion bluemix/trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading