commit 3ca6d912002035c57d9310c93ee9b9cfce30d8e7 from: Oliver Lowe date: Wed Jul 16 12:23:16 2025 UTC hnatom: remove unnecessary strconv commit - fcd43598d63fd3ecef6564bd836746fea5847b8b commit + 3ca6d912002035c57d9310c93ee9b9cfce30d8e7 blob - 8f3e47df5df493afe67aa18b9b88b14ca1dcc4ad blob + 731b319ffe66acd2a8808c4fe4da2e4ffc49e03c --- src/hnatom/hnatom.go +++ src/hnatom/hnatom.go @@ -1,5 +1,6 @@ -// Command hnatom writes to the standard output a RFC 4287 Atom feed +// Command hnatom generates a RFC 4287 Atom feed // of current top stories from the Hacker News front page. +// The feed is written to the standard output. // The flags are: // // -n count @@ -19,7 +20,6 @@ import ( "log" "net/http" "os" - "strconv" "time" "olowe.co/x/atom" @@ -41,7 +41,7 @@ type Item struct { } func Get(id int) (*Item, error) { - u := fmt.Sprintf("%s/item/%s.json", apiRoot, strconv.Itoa(id)) + u := fmt.Sprintf("%s/item/%d.json", apiRoot, id) resp, err := http.Get(u) if err != nil { return nil, err