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
4 changes: 2 additions & 2 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
matrix:
os:
- ubuntu
go-version: [1.17.6, 1.16.13]
go-version: [1.23.0, 1.24.4]

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
- name: Install Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: 1.17.6
go-version: 1.23.0
check-latest: true

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion go/example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func printAboutMe(sdk *v4.LookerSDK) {
fmt.Printf("Error getting myself %v\n", err)
}
if len(users) != 1 {
fmt.Printf("Found %d users with my email expected 1\n")
fmt.Printf("Found %d users with my email expected 1\n", len(users))

Choose a reason for hiding this comment

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

medium

The fix to include len(users) is correct, thanks for catching that.

To improve this, I suggest writing this warning message to stderr instead of stdout, which is a common practice for diagnostic messages in Go. This separates them from the program's primary output.

Also, please note that if sdk.SearchUsers returns an error, this line will still be executed. It would be more robust to check len(users) only when the API call is successful. While I can't suggest a change for the surrounding logic due to PR constraints, here's a suggestion for the current line:

Suggested change
fmt.Printf("Found %d users with my email expected 1\n", len(users))
fmt.Fprintf(os.Stderr, "Warning: Found %d users with my email, expected 1\n", len(users))

}
}

Expand Down
Loading