remove errors dependency

This commit is contained in:
Joel Schmid 2021-03-20 16:14:10 +01:00
parent 15db885db8
commit 4b6d8e6c6b
2 changed files with 3 additions and 3 deletions

1
go.mod
View file

@ -7,5 +7,4 @@ require (
github.com/google/uuid v1.2.0
github.com/gorilla/mux v1.8.0
github.com/influxdata/influxdb-client-go/v2 v2.2.2
github.com/pkg/errors v0.9.1
)

View file

@ -1,8 +1,9 @@
package storage
import (
"errors"
"github.com/google/uuid"
"github.com/pkg/errors"
)
type inmemorySensorRegistry struct {
@ -16,7 +17,7 @@ func NewInmemorySensorRegistry() *inmemorySensorRegistry {
func (registry *inmemorySensorRegistry) RegisterSensorByName(name string) (*WeatherSensor, error) {
if registry.ExistSensorName(name) {
return nil, errors.Errorf("Sensorname already exists")
return nil, errors.New("Sensorname already exists")
}
sensor := new(WeatherSensor)
sensor.Name = name