go-india/rail — reverse-engineered prompt
Reverse engineered prompt
Build me a small Go library for Indian Railways data that wraps the railwayapi.com API so another Go app can use it easily.
I want a client where I can pass in my RailwayAPI key once, then call simple methods to get things like PNR status, live train running status, train fares, stations, trains, arrivals, and trains between stations. It should use context for requests, return clean Go structs instead of raw JSON, and handle errors in a normal Go way.
Please include examples in the README showing how to create the client and call a few common methods. Add tests using saved sample API responses so the library can be tested without always hitting the real API, and make it possible to refresh those samples when an API key is provided in the environment. Keep it simple and idiomatic for Go.
Want more depth? Deep Reverse