Skip to content

Commit

Permalink
Use go:embed for babel, drop github.com/GeertJohan/go.rice
Browse files Browse the repository at this point in the history
  • Loading branch information
na-- committed Apr 16, 2021
1 parent a5fb827 commit cef7172
Show file tree
Hide file tree
Showing 32 changed files with 4 additions and 1,971 deletions.
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
run:
deadline: 5m
skip-files:
- "rice-box.go$"

issues:
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.16
require (
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c
github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a
github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da
github.com/PuerkitoBio/goquery v1.6.1
github.com/Soontao/goHttpDigestClient v0.0.0-20170320082612-6d28bb1415c5
github.com/andybalholm/brotli v1.0.1
Expand Down
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a h1:zpQSzEApXM0qkXcpdjeJ4OpnBWhD/X8zT/iT1wYLiVU=
github.com/DataDog/datadog-go v0.0.0-20180330214955-e67964b4021a/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da h1:UVU3a9pRUyLdnBtn60WjRl0s4SEyJc2ChCY56OAR6wI=
github.com/GeertJohan/go.rice v0.0.0-20170420135705-c02ca9a983da/go.mod h1:DgrzXonpdQbfN3uYaGz1EG4Sbhyum/MMIn6Cphlh2bw=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/goquery v1.3.0/go.mod h1:T9ezsOHcCrDCgA8aF1Cqr3sSYbO/xgdy8/R/XiIMAhA=
Expand Down Expand Up @@ -57,7 +56,6 @@ github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/daaku/go.zipexe v0.0.0-20150329023125-a5fe2436ffcb h1:tUf55Po0vzOendQ7NWytcdK0VuzQmfAgvGBUOQvN0WA=
github.com/daaku/go.zipexe v0.0.0-20150329023125-a5fe2436ffcb/go.mod h1:U0vRfAucUOohvdCxt5MWLF+TePIL0xbCkbKIiV8TQCE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
Expand Down Expand Up @@ -187,7 +185,6 @@ github.com/julienschmidt/httprouter v1.1.1-0.20180222160526-d18983907793/go.mod
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/k6io/xk6-output-kafka v0.1.1 h1:8e7+z+KZ5jmGaubrxuw4NQsRDJxc4is/8h20TqogdIQ=
github.com/k6io/xk6-output-kafka v0.1.1/go.mod h1:FEnBddwavknsQ3/tGFW0CP9ABAVMyimlJdLgyT1BDPE=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 h1:PJPDf8OUfOK1bb/NeTKd4f1QXZItOX389VN3B6qC8ro=
github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8=
github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
Expand Down
11 changes: 4 additions & 7 deletions js/compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@
*
*/

//go:generate rice embed-go

package compiler

import (
_ "embed" // we need this for embedding Babel
"sync"
"time"

rice "github.com/GeertJohan/go.rice"
"github.com/dop251/goja"
"github.com/dop251/goja/parser"
"github.com/mitchellh/mapstructure"
Expand All @@ -35,6 +33,9 @@ import (
"github.com/loadimpact/k6/lib"
)

//go:embed lib/babel.min.js
var babelSrc string //nolint:gochecknoglobals

var (
DefaultOpts = map[string]interface{}{
// "presets": []string{"latest"},
Expand Down Expand Up @@ -154,10 +155,6 @@ func newBabel() (*babel, error) {
var err error

once.Do(func() {
conf := rice.Config{
LocateOrder: []rice.LocateMethod{rice.LocateEmbedded},
}
babelSrc := conf.MustFindBox("lib").MustString("babel.min.js")
vm := goja.New()
if _, err = vm.RunString(babelSrc); err != nil {
return
Expand Down
41 changes: 0 additions & 41 deletions js/compiler/rice-box.go

This file was deleted.

8 changes: 0 additions & 8 deletions vendor/github.com/GeertJohan/go.rice/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions vendor/github.com/GeertJohan/go.rice/AUTHORS

This file was deleted.

22 changes: 0 additions & 22 deletions vendor/github.com/GeertJohan/go.rice/LICENSE

This file was deleted.

151 changes: 0 additions & 151 deletions vendor/github.com/GeertJohan/go.rice/README.md

This file was deleted.

Loading

0 comments on commit cef7172

Please sign in to comment.