Socket
Socket
Sign inDemoInstall

github.com/aculclasure/weather

Package Overview
Dependencies
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/aculclasure/weather

Package weather contains types and functions for communicating with the OpenWeatherMap API.


Version published

Readme

Source

Go OpenWeather API Client

Go package that provides a client for interacting with the current weather API hosted by OpenWeather. It provides some basic measurements of current weather for a given location.

Setup

You will need to create an OpenWeather account and API key. See their getting started guide for help on how to do this. Once you have the API key, it should be set as the environment variable OPENWEATHER_API_KEY.

Usage

Mac/Linux

$ cd cmd/weather

$  go run main.go -h
USAGE: weather [-units={standard|metric|imperial}] <location>

  -units string
        the units to use, one of: standard, metric, imperial (default "imperial")

$ OPENWEATHER_API_KEY=<YOUR-API-KEY> go run main.go --units=metric london

overcast clouds, 9.21 C, humidity 46%

Windows Powershell

PS ${env:OPENWEATHER_API_KEY}=<YOUR-API-KEY>

PS cd cmd\weather

PS go run main.go --units=metric london

overcast clouds, 9.21 C, humidity 46%

FAQs

Last updated on 07 May 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc