Skip to content

Latest commit

 

History

History
91 lines (62 loc) · 2.25 KB

README.md

File metadata and controls

91 lines (62 loc) · 2.25 KB

Installation

go get -u github.com/cclin81922/ipttmrts/cmd/ipttmrts
export PATH=$PATH:~/go/bin

Command Line Usage

Usage 1

GoogleGeolocationAPIKey=... ipttmrts

// output the nearest MRT station

Usage 2

ipttmrts -ip=101.15.22.238

// output the nearest MRT station

To output debug message as well, use flag -logtostderr=true -v=2

Package Usage

import "github.com/cclin81922/ipttmrts/pkg/ipttmrts"

func demo(data ipttmrts.IData) {
    ipttmrts.Map(data)
}

For Developer

Run all tests

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts

Run selected tests e.g.,

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts -run=TestFindNearTaipeiMRTStation/誠正國中

Run all benchmarks

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts -bench=. -benchmem

Run selected benchmarks e.g.,

go test github.com/cclin81922/ipttmrts/pkg/ipttmrts -bench=BenchmarkFindNearTaipeiMRTStation/誠正國中 -benchmem

View API doc by terminal

go doc github.com/cclin81922/ipttmrts/pkg/ipttmrts

View API doc by web browser (offline)

godoc -http=:6060
open http://localhost:6060/pkg/github.com/cclin81922/ipttmrts/pkg/ipttmrts

View API doc by web browser (online)

open https://godoc.org/github.com/cclin81922/ipttmrts/pkg/ipttmrts

Related Resources