cloudwego / cloudwego/eino-ext
wikipedia: example fails go vet on unkeyed SearchRequest literal
- Dominant language
- Go
- Stars
- 811
- Forks
- 368
- Avg merge
- 16h 22m
- Merged PRs (30d)
- 13
Description
## Description
The Wikipedia example constructs the exported `wikipedia.SearchRequest` type with an unkeyed struct literal:
```go
wikipedia.SearchRequest{"bytedance"}
```
On current `main` (`6752ff8da9b1ea85c8e91b27b0a64fef099f22f9`), the repository's documented vet check reports:
```text
components/tool/wikipedia/examples/main.go:49:32: wikipedia.SearchRequest struct literal uses unkeyed fields
```
Because the type belongs to another package, the unkeyed literal also couples the example to field order and will silently target the wrong field if fields are reordered.
## Reproduction
From `components/tool/wikipedia` with Go 1.25.6 on Linux:
```text
go vet ./...
```
## Expected behavior
The example should pass `go vet` and name the request field explicitly.
## Suggested fix
Use `wikipedia.SearchRequest{Query: "bytedance"}`.
Contributor guide
Research direction
Open components/tool/wikipedia/examples/main.go and inspect the SearchRequest construction around line 49. Run go vet ./... from components/tool/wikipedia, update the example so the request field is named explicitly, and confirm that the vet check passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100