Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Commit 476143a

Browse files
.
1 parent a0635ba commit 476143a

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

sdk/go/examples/http/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func GetRandomQuote() (*Quote, error) {
3232
return nil, err
3333
}
3434
if !response.Ok() {
35-
return nil, fmt.Errorf("Failed to fetch quote. Received: %d %s", response.Status, response.StatusText)
35+
return nil, fmt.Errorf("failed to fetch quote. Received: %d %s", response.Status, response.StatusText)
3636
}
3737

3838
// The API returns an array of quotes, but we only want the first one.
@@ -119,7 +119,7 @@ func CreateGithubIssue(owner, repo, title, body string) (*Issue, error) {
119119
return nil, err
120120
}
121121
if !response.Ok() {
122-
return nil, fmt.Errorf("Failed to create issue. Received: %d %s", response.Status, response.StatusText)
122+
return nil, fmt.Errorf("failed to create issue. Received: %d %s", response.Status, response.StatusText)
123123
}
124124

125125
// The response will contain the issue data, including the URL of the issue on GitHub.

sdk/go/examples/mysql/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func AddPerson(name string, age int) (*Person, error) {
5353

5454
response, err := mysql.Execute(connection, query, name, age)
5555
if err != nil {
56-
return nil, fmt.Errorf("Failed to add person to database: %v", err)
56+
return nil, fmt.Errorf("failed to add person to database: %v", err)
5757
}
5858

5959
p := Person{Id: int(response.LastInsertId), Name: name, Age: age}
@@ -65,11 +65,11 @@ func UpdatePersonHome(id int, longitude, latitude float64) (*Person, error) {
6565

6666
response, err := mysql.Execute(connection, query, longitude, latitude, id)
6767
if err != nil {
68-
return nil, fmt.Errorf("Failed to update person in database: %v", err)
68+
return nil, fmt.Errorf("failed to update person in database: %v", err)
6969
}
7070

7171
if response.RowsAffected != 1 {
72-
return nil, fmt.Errorf("Failed to update person with id %d. The record may not exist.", id)
72+
return nil, fmt.Errorf("failed to update person with id %d - the record may not exist", id)
7373
}
7474

7575
return GetPerson(id)
@@ -80,11 +80,11 @@ func DeletePerson(id int) (string, error) {
8080

8181
response, err := mysql.Execute(connection, query, id)
8282
if err != nil {
83-
return "", fmt.Errorf("Failed to delete person from database: %v", err)
83+
return "", fmt.Errorf("failed to delete person from database: %v", err)
8484
}
8585

8686
if response.RowsAffected != 1 {
87-
return "", fmt.Errorf("Failed to delete person with id %d. The record may not exist.", id)
87+
return "", fmt.Errorf("failed to delete person with id %d - the record may not exist", id)
8888
}
8989

9090
return "success", nil

sdk/go/examples/postgresql/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func AddPerson(name string, age int) (*Person, error) {
5353

5454
response, err := postgresql.QueryScalar[int](connection, query, name, age)
5555
if err != nil {
56-
return nil, fmt.Errorf("Failed to add person to database: %v", err)
56+
return nil, fmt.Errorf("failed to add person to database: %v", err)
5757
}
5858

5959
p := Person{Id: response.Value, Name: name, Age: age}
@@ -65,11 +65,11 @@ func UpdatePersonHome(id int, longitude, latitude float64) (*Person, error) {
6565

6666
response, err := postgresql.Execute(connection, query, longitude, latitude, id)
6767
if err != nil {
68-
return nil, fmt.Errorf("Failed to update person in database: %v", err)
68+
return nil, fmt.Errorf("failed to update person in database: %v", err)
6969
}
7070

7171
if response.RowsAffected != 1 {
72-
return nil, fmt.Errorf("Failed to update person with id %d. The record may not exist.", id)
72+
return nil, fmt.Errorf("failed to update person with id %d - the record may not exist", id)
7373
}
7474

7575
return GetPerson(id)
@@ -80,11 +80,11 @@ func DeletePerson(id int) (string, error) {
8080

8181
response, err := postgresql.Execute(connection, query, id)
8282
if err != nil {
83-
return "", fmt.Errorf("Failed to delete person from database: %v", err)
83+
return "", fmt.Errorf("failed to delete person from database: %v", err)
8484
}
8585

8686
if response.RowsAffected != 1 {
87-
return "", fmt.Errorf("Failed to delete person with id %d. The record may not exist.", id)
87+
return "", fmt.Errorf("failed to delete person with id %d - the record may not exist", id)
8888
}
8989

9090
return "success", nil

sdk/go/examples/textgeneration/toolcalling.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func GenerateTextWithTools(prompt string) (string, error) {
112112
}
113113

114114
default:
115-
return "", fmt.Errorf("Unknown tool call: %s", tc.Function.Name)
115+
return "", fmt.Errorf("unknown tool call: %s", tc.Function.Name)
116116
}
117117

118118
// Add the tool's response to the conversation.
@@ -124,7 +124,7 @@ func GenerateTextWithTools(prompt string) (string, error) {
124124
return strings.TrimSpace(msg.Content), nil
125125
} else {
126126
// If the model didn't ask for tools, and didn't return any content, something went wrong.
127-
return "", errors.New("Invalid response from model.")
127+
return "", errors.New("invalid response from model")
128128
}
129129
}
130130
}
@@ -135,7 +135,7 @@ func GenerateTextWithTools(prompt string) (string, error) {
135135
// This function will return the current time in a given time zone.
136136
func getCurrentTime(tz string) (string, error) {
137137
if !localtime.IsValidTimeZone(tz) {
138-
return "", errors.New("Invalid time zone.")
138+
return "", errors.New("invalid time zone")
139139
}
140140

141141
now, err := localtime.NowInZone(tz)
@@ -159,7 +159,7 @@ func getUserTimeZone() string {
159159
func getCurrentTimeInUserTimeZone() (*struct{ Time, Zone string }, error) {
160160
tz := os.Getenv("TZ")
161161
if tz == "" {
162-
return nil, errors.New("Cannot determine user's time zone.")
162+
return nil, errors.New("cannot determine user's time zone")
163163
}
164164
time, err := getCurrentTime(tz)
165165
if err != nil {

0 commit comments

Comments
 (0)