diff --git a/go.mod b/go.mod index 0e5a9768..9b5e7072 100644 --- a/go.mod +++ b/go.mod @@ -53,6 +53,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 // indirect github.com/go-playground/validator/v10 v10.22.0 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect + github.com/go-sourcemap/sourcemap v2.1.4+incompatible // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/goccy/go-json v0.10.3 // indirect github.com/golang/protobuf v1.5.3 // indirect diff --git a/go.sum b/go.sum index bd308a78..e03760d6 100644 --- a/go.sum +++ b/go.sum @@ -60,6 +60,8 @@ github.com/go-playground/validator/v10 v10.22.0 h1:k6HsTZ0sTnROkhS//R0O+55JgM8C4 github.com/go-playground/validator/v10 v10.22.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-sourcemap/sourcemap v2.1.4+incompatible h1:a+iTbH5auLKxaNwQFg0B+TCYl6lbukKPc7b5x0n1s6Q= +github.com/go-sourcemap/sourcemap v2.1.4+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= diff --git a/runtime/runtime.go b/runtime/runtime.go index d6013b9f..f092947a 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -12,6 +12,11 @@ import ( // Start v8 runtime func Start(cfg config.Config) error { + debug := false + if cfg.Mode == "development" { + debug = true + } + option := &v8.Option{ MinSize: cfg.Runtime.MinSize, MaxSize: cfg.Runtime.MaxSize, @@ -24,6 +29,7 @@ func Start(cfg config.Config) error { DefaultTimeout: cfg.Runtime.DefaultTimeout, ContextTimeout: cfg.Runtime.ContextTimeout, Import: cfg.Runtime.Import, + Debug: debug, } // Read the tsconfig.json