Skip to content

Commit 10afefd

Browse files
fix(examples): correct field names in client_example.go
- Use CategoryId instead of Category for product requests - Use Price directly instead of PriceValue wrapper type Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 468fa64 commit 10afefd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/restful-crud/client_example.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func main() {
3535
Name: "Example Widget",
3636
Description: "A high-quality widget",
3737
Price: 19.99,
38-
Category: "widgets",
38+
CategoryId: "widgets",
3939
Tags: []string{"new", "featured"},
4040
})
4141
if err != nil {
@@ -74,7 +74,7 @@ func main() {
7474
Name: "Updated Widget",
7575
Description: "An even better widget",
7676
Price: 24.99,
77-
Category: "widgets",
77+
CategoryId: "widgets",
7878
Tags: []string{"updated", "premium"},
7979
})
8080
if err != nil {
@@ -86,7 +86,7 @@ func main() {
8686
fmt.Println("\nPatching product price...")
8787
patched, err := client.PatchProduct(ctx, &models.PatchProductRequest{
8888
ProductId: product.Id,
89-
Price: &models.PatchProductRequest_PriceValue{PriceValue: 29.99},
89+
Price: 29.99,
9090
})
9191
if err != nil {
9292
log.Fatalf("Failed to patch product: %v", err)

0 commit comments

Comments
 (0)