Search Gear Notes

Search Gear #14 – Pseudo Constructors!

Changed the config twitter caller to a pseudo constructor thus func NewTwitter(file string) (*twitter, error) { tw := new(twitter) var parser toml.Parser if _, err := ioutil.ReadFile(file); err != nil { tw.errors = errors.New(co.Lang(“could not find the configuration file, you’ll need to provide these setting for twitter to work”)) } else { toml := parser.ParseFile(file)…

Search Gear Notes

Search Gear #13 – Variable Scoping!

OK so what next? Need to query ‘my’ twitter timeline every ‘so often’. ‘So often’ is defined by the number of tweets returned from the maximum of 200 as allowed by twitters API. The number of tweets returned defines the period that twitter is queried (not sure if these – every so often – episodes…

Search Gear Notes

Search Gear #11- Testing and Coverage!

Thanks @rob_pike for sorting me out on cover and style. Rule for today run ‘go fmt’ to get that go code nice and formatted to standard style conventions! go-imports tool http://blog.golang.org/laws-of-reflection go test -v go test -cover go test -coverprofile=coverage.out go tool cover -func=cover.out go tool cover -html=coverage.out http://blog.golang.org/cover ~Oh you are joking! Simon-Harpers-iMac:searchgear sharper$…