Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gojap.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
)

var vmPool = sync.Pool{
New: func() interface{} {
New: func() any {
return goja.New()
},
}

func getVm() *goja.Runtime {

Check failure on line 15 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

func getVm should be getVM

Check failure on line 15 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

func getVm should be getVM

Check failure on line 15 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, windows-latest)

func getVm should be getVM

Check failure on line 15 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

func getVm should be getVM

Check failure on line 15 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

func getVm should be getVM

Check failure on line 15 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, windows-latest)

func getVm should be getVM
return vmPool.Get().(*goja.Runtime)
}

func putVm(vm *goja.Runtime) {

Check failure on line 19 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

func putVm should be putVM

Check failure on line 19 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

func putVm should be putVM

Check failure on line 19 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, windows-latest)

func putVm should be putVM

Check failure on line 19 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

func putVm should be putVM

Check failure on line 19 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

func putVm should be putVM

Check failure on line 19 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, windows-latest)

func putVm should be putVM
vmPool.Put(vm)
}

Expand Down Expand Up @@ -78,7 +78,7 @@
return vm.RunProgram(p)
}

func (e *Exec) MustRunString(s string, args ...Arg) goja.Value {

Check failure on line 81 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, ubuntu-latest)

exported method Exec.MustRunString should have comment or be unexported

Check failure on line 81 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, macos-latest)

exported method Exec.MustRunString should have comment or be unexported

Check failure on line 81 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, windows-latest)

exported method Exec.MustRunString should have comment or be unexported

Check failure on line 81 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, ubuntu-latest)

exported method Exec.MustRunString should have comment or be unexported

Check failure on line 81 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.25.x, macos-latest)

exported method Exec.MustRunString should have comment or be unexported

Check failure on line 81 in gojap.go

View workflow job for this annotation

GitHub Actions / test (1.24.x, windows-latest)

exported method Exec.MustRunString should have comment or be unexported
v, err := e.RunString(s, args...)
if err != nil {
panic(err)
Expand Down
2 changes: 1 addition & 1 deletion gojap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestRunStringParallel(t *testing.T) {
e := New()

wg := sync.WaitGroup{}
for i := 0; i < 20; i++ {
for i := range 20 {
wg.Add(1)
i := i
go func() {
Expand Down