feat: add goreport notation

This commit is contained in:
Adrien Waksberg 2019-08-22 22:44:50 +02:00
parent 4bf2f1e02f
commit 0ad5151d98
5 changed files with 186 additions and 181 deletions

View file

@ -7,6 +7,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
## Unreleased ## Unreleased
### Added
- goreport notation
### Fixed ### Fixed
- too many open files close with influxdb connection - too many open files close with influxdb connection

View file

@ -1,6 +1,7 @@
# Weather # Weather
[![Version](https://img.shields.io/badge/latest_version-1.0.0-green.svg)](https://git.yaegashi.fr/nishiki/weather/releases) [![Version](https://img.shields.io/badge/latest_version-1.0.0-green.svg)](https://git.yaegashi.fr/nishiki/weather/releases)
[![GoReport](https://goreportcard.com/badge/git.yaegashi.fr/nishiki/weather)](https://goreportcard.com/report/git.yaegashi.fr/nishiki/weather)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/weather/src/branch/master/LICENSE) [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/weather/src/branch/master/LICENSE)
weather is a small program that fetch weather informations, and store them to influxdb weather is a small program that fetch weather informations, and store them to influxdb

View file

@ -17,8 +17,8 @@
package main package main
import ( import (
"fmt"
"flag" "flag"
"fmt"
"os" "os"
"time" "time"
) )

View file

@ -17,10 +17,10 @@
package main package main
import ( import (
"fmt"
"net/http"
"encoding/json" "encoding/json"
"fmt"
"io/ioutil" "io/ioutil"
"net/http"
"time" "time"
influx "github.com/influxdata/influxdb1-client/v2" influx "github.com/influxdata/influxdb1-client/v2"
@ -108,7 +108,7 @@ func (w *Weather) SendToInfluxDB() error {
}) })
for _, weather := range w.WeatherDatas { for _, weather := range w.WeatherDatas {
tags := map[string]string{ "city": weather.City, "country": weather.Sys.Country } tags := map[string]string{"city": weather.City, "country": weather.Sys.Country}
fields := map[string]interface{}{ fields := map[string]interface{}{
"temperature": weather.Main.Temperature, "temperature": weather.Main.Temperature,
"humidity": weather.Main.Humidity, "humidity": weather.Main.Humidity,