Skip to content

Commit

Permalink
fix: update yaegi and fix symgen
Browse files Browse the repository at this point in the history
  • Loading branch information
nrwiersma authored Oct 23, 2020
1 parent 2c25f57 commit 25c77f9
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 91 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ static-assets-clean:
static-assets:
@echo "==> Generating static assets"
@go-bindata -pkg glass -prefix webui -nocompress -o assets.gen.go ./webui/...
#go run ./internal/gensym -o=./module/internal/types/types.gen.go
@go run ./internal/gensym -o=./module/internal/types/types.gen.go
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/hamba/testutils v0.1.1
github.com/joho/godotenv v1.3.0
github.com/stretchr/testify v1.6.1
github.com/traefik/yaegi v0.9.2
github.com/traefik/yaegi v0.9.4
github.com/urfave/cli/v2 v2.2.0
github.com/vincent-petithory/dataurl v0.0.0-20191104211930-d1553a71de50
github.com/zserge/lorca v0.1.9
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/traefik/yaegi v0.9.2 h1:u694KQ98E0gGQoOPvlHIkc6DLxgoA24ZfEgo+TWhqyE=
github.com/traefik/yaegi v0.9.2/go.mod h1:FAYnRlZyuVlEkvnkHq3bvJ1lW5be6XuwgLdkYgYG6Lk=
github.com/traefik/yaegi v0.9.4 h1:ZyxSsvpzZTTTbvE2ODjRkOvq6kYT3dIZDqUfCZJYDtw=
github.com/traefik/yaegi v0.9.4/go.mod h1:FAYnRlZyuVlEkvnkHq3bvJ1lW5be6XuwgLdkYgYG6Lk=
github.com/urfave/cli/v2 v2.2.0 h1:JTTnM6wKzdA0Jqodd966MVj4vWbbquZykeX1sKbe2C4=
github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ=
github.com/vincent-petithory/dataurl v0.0.0-20191104211930-d1553a71de50 h1:uxE3GYdXIOfhMv3unJKETJEhw78gvzuQqRX/rVirc2A=
Expand Down
68 changes: 34 additions & 34 deletions internal/gensym/gensym.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
package main

// import (
// "bytes"
// "flag"
// "io/ioutil"
// "log"
//
// "github.com/traefik/yaegi/internal/extract"
// )
//
// const (
// pkgIdent = "github.com/glasslabs/looking-glass/module/types"
// )
//
// var (
// outputFile = flag.String("o", "gen.go", "The output file")
// )
//
// func main() {
// flag.Parse()
//
// ext := extract.Extractor{Dest: "types"}
//
// var buf bytes.Buffer
// _, err := ext.Extract(pkgIdent, "", &buf)
// if err != nil {
// log.Println(err)
// return
// }
//
// if err := ioutil.WriteFile(*outputFile, buf.Bytes(), 0600); err != nil {
// log.Println(err)
// return
// }
// }
import (
"bytes"
"flag"
"io/ioutil"
"log"

"github.com/traefik/yaegi/extract"
)

const (
pkgIdent = "github.com/glasslabs/looking-glass/module/types"
)

var (
outputFile = flag.String("o", "gen.go", "The output file")
)

func main() {
flag.Parse()

ext := extract.Extractor{Dest: "types"}

var buf bytes.Buffer
_, err := ext.Extract(pkgIdent, "", &buf)
if err != nil {
log.Println(err)
return
}

if err := ioutil.WriteFile(*outputFile, buf.Bytes(), 0600); err != nil {
log.Println(err)
return
}
}
55 changes: 0 additions & 55 deletions module/internal/types/types.yaegi.go

This file was deleted.

0 comments on commit 25c77f9

Please sign in to comment.