Skip to content

Commit

Permalink
chore: upgrade go-sprout (#13841)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed May 15, 2024
1 parent d4c6ab7 commit 940ce81
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 26 deletions.
2 changes: 1 addition & 1 deletion cmd/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
_ "embed"
"text/template"

"github.com/42atomys/sprout"
"github.com/evcc-io/evcc/util/templates"
"github.com/go-sprout/sprout"
)

type device struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"path/filepath"
"text/template"

"github.com/42atomys/sprout"
"github.com/evcc-io/evcc/core"
"github.com/evcc-io/evcc/server"
"github.com/evcc-io/evcc/util/config"
"github.com/go-sprout/sprout"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/eebus.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"os"
"text/template"

"github.com/42atomys/sprout"
"github.com/evcc-io/evcc/charger/eebus"
"github.com/go-sprout/sprout"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.22.0

require (
dario.cat/mergo v1.0.0
github.com/42atomys/sprout v0.2.0
github.com/AlecAivazis/survey/v2 v2.3.7
github.com/BurntSushi/toml v1.3.2
github.com/PuerkitoBio/goquery v1.9.2
Expand Down Expand Up @@ -32,6 +31,7 @@ require (
github.com/glebarez/sqlite v1.11.0
github.com/go-http-utils/etag v0.0.0-20161124023236-513ea8f21eb1
github.com/go-playground/validator/v10 v10.20.0
github.com/go-sprout/sprout v0.3.1-0.20240510210334-9d4a544518d7
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
github.com/godbus/dbus/v5 v5.1.0
github.com/gokrazy/updater v0.0.0-20240113102150-4ac511a17e33
Expand Down Expand Up @@ -134,7 +134,6 @@ require (
github.com/grid-x/serial v0.0.0-20211107191517-583c7356b3aa // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/holoplot/go-avahi v1.0.1 // indirect
github.com/huandu/xstrings v1.4.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/influxdata/line-protocol v0.0.0-20210922203350-b1ad95c89adf // indirect
github.com/insomniacslk/xjson v0.0.0-20240314172816-ab1449dc107f // indirect
Expand Down Expand Up @@ -171,7 +170,6 @@ require (
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/shopspring/decimal v1.4.0 // indirect
github.com/sirupsen/logrus v1.9.3
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spali/go-slicereader v0.0.0-20201122145524-8e262e1a5127 // indirect
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/42atomys/sprout v0.2.0 h1:Fe8Wkc4xOI/z1pwaJffG2sElA+TtH2zgQGnvNNPbU8Q=
github.com/42atomys/sprout v0.2.0/go.mod h1:nTr5KxiTLYrnmEiZaJLuD/Ct+xod3KpHBmqhaZjQ1Lk=
github.com/AlecAivazis/survey/v2 v2.3.7 h1:6I/u8FvytdGsgonrYsVn2t8t4QiRnh6QSTqkkhIiSjQ=
github.com/AlecAivazis/survey/v2 v2.3.7/go.mod h1:xUTIdE4KCOIjsBAE1JYsUPoCqYdZ1reCfTwbto0Fduo=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
Expand Down Expand Up @@ -183,6 +181,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBExVwjEviJTixqxL8=
github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-sprout/sprout v0.3.1-0.20240510210334-9d4a544518d7 h1:1g2VKjGbRV/da+uAyd4WMB4XYXTRImXXFNQlt5mxOzU=
github.com/go-sprout/sprout v0.3.1-0.20240510210334-9d4a544518d7/go.mod h1:BG7Zrds7XG7VZvLAkiT3pOK9rLQ6HSJIB4lAXzLdtaA=
github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
Expand Down Expand Up @@ -306,8 +306,6 @@ github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec/go.mod h1:Q48J4R4Dvx
github.com/holoplot/go-avahi v1.0.1 h1:XcqR2keL4qWRnlxHD5CAOdWpLFZJ+EOUK0vEuylfvvk=
github.com/holoplot/go-avahi v1.0.1/go.mod h1:qH5psEKb0DK+BRplMfc+RY4VMOlbf6mqfxgpMy6aP0M=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU=
github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE=
github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
Expand Down Expand Up @@ -582,8 +580,6 @@ github.com/samber/lo v1.39.0 h1:4gTz1wUhNYLhFSKl6O+8peW0v2F4BCY034GRpU9WnuA=
github.com/samber/lo v1.39.0/go.mod h1:+m/ZKRl6ClXCE2Lgf3MsQlWfh4bn1bz6CXEOxnEXnEA=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/simonvetter/modbus v1.6.0 h1:RDHJevtc7LDIVoHAbhDun8fy+QwnGe+ZU+sLm9ZZzjc=
github.com/simonvetter/modbus v1.6.0/go.mod h1:hh90ZaTaPLcK2REj6/fpTbiV0J6S7GWmd8q+GVRObPw=
Expand Down
2 changes: 1 addition & 1 deletion provider/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"text/template"
"time"

"github.com/42atomys/sprout"
"github.com/evcc-io/evcc/provider/pipeline"
"github.com/evcc-io/evcc/util"
"github.com/evcc-io/evcc/util/request"
"github.com/evcc-io/evcc/util/transport"
"github.com/go-sprout/sprout"
"github.com/gregjones/httpcache"
"github.com/jpfielding/go-http-digest/pkg/digest"
)
Expand Down
2 changes: 1 addition & 1 deletion push/hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"strings"
"text/template"

"github.com/42atomys/sprout"
"github.com/evcc-io/evcc/core/vehicle"
"github.com/evcc-io/evcc/util"
"github.com/go-sprout/sprout"
)

// Event is a notification event
Expand Down
2 changes: 1 addition & 1 deletion util/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/42atomys/sprout"
"github.com/go-sprout/sprout"
"golang.org/x/exp/maps"
)

Expand Down
2 changes: 1 addition & 1 deletion util/templates/documentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"
"text/template"

"github.com/42atomys/sprout"
"github.com/go-sprout/sprout"
)

//go:embed documentation.tpl
Expand Down
2 changes: 1 addition & 1 deletion util/templates/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"
"text/template"

"github.com/42atomys/sprout"
"github.com/evcc-io/evcc/util"
"github.com/go-sprout/sprout"
)

// Template describes is a proxy device for use with cli and automated testing
Expand Down
10 changes: 1 addition & 9 deletions util/templates/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"net/url"
"strings"
"text/template"
"time"

"github.com/42atomys/sprout"
"github.com/go-sprout/sprout"
"gopkg.in/yaml.v3"
)

Expand Down Expand Up @@ -58,13 +57,6 @@ func FuncMap(tmpl *template.Template) *template.Template {
return buf.String(), nil
},
"urlEncode": url.QueryEscape,
"toDuration": func(v string) time.Duration {
d, err := time.ParseDuration(v)
if err != nil {
panic(err)
}
return d
},
}

return tmpl.Funcs(sprout.TxtFuncMap()).Funcs(funcMap)
Expand Down

0 comments on commit 940ce81

Please sign in to comment.