Skip to content
This repository was archived by the owner on Nov 21, 2021. It is now read-only.

Latest commit

 

History

History
30 lines (17 loc) · 798 Bytes

README.md

File metadata and controls

30 lines (17 loc) · 798 Bytes

DarkSky API for Go

Requirements

Usage

import "go.larrymyers.com/darksky"

r := darksky.MakeRequest("my_key", "41.8781", "-87.6297").Get()

feelsLike := r.Forecast.Currently.ApparentTemperature

// All time fields are represented as seconds since epoch, so
// conversion to a time.Time representation is straight forward.
currentTime := time.Unix(r.Forecast.Currently.Time, 0)

fmt.Printf("It feels like %v degrees outside at %v.", feelsLike, currentTime)

Notes

All time based fields are stored as int64 values, which contain the seconds since epoch.

Conversion can be done using time.Unix.

Run Tests With Coverage

go test -coverprofile=cover.out && go tool cover -html=cover.out