forked from evcc-io/evcc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
45 lines (36 loc) · 779 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package main
import (
"embed"
"io"
"io/fs"
"log"
"github.com/evcc-io/evcc/cmd"
"github.com/evcc-io/evcc/server/assets"
_ "golang.org/x/crypto/x509roots/fallback" // fallback certificates
)
var (
//go:embed dist
web embed.FS
//go:embed i18n/*.toml
i18n embed.FS
)
// init loads embedded assets unless live assets are already loaded
func init() {
if !assets.Live() {
var err error
assets.Web, err = fs.Sub(web, "dist")
if err != nil {
panic(err)
}
assets.I18n, err = fs.Sub(i18n, "i18n")
if err != nil {
panic(err)
}
}
}
func main() {
// suppress deprecated: golang.org/x/oauth2: Transport.CancelRequest no longer does anything; use contexts
// see https://github.com/golang/oauth2/issues/487
log.SetOutput(io.Discard)
cmd.Execute()
}