goscript 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +267 -255
- package/cmd/goscript/cmd-test.go +286 -0
- package/cmd/goscript/cmd-test_test.go +76 -0
- package/cmd/goscript/cmd_compile.go +9 -0
- package/cmd/goscript/main.go +1 -0
- package/compiler/build-flags.go +38 -0
- package/compiler/compile-request.go +33 -0
- package/compiler/compiler.go +1 -1
- package/compiler/compliance_test.go +0 -10
- package/compiler/config.go +2 -0
- package/compiler/gotest/owner.go +24 -0
- package/compiler/gotest/package-result.go +69 -0
- package/compiler/gotest/request.go +210 -0
- package/compiler/gotest/result.go +28 -0
- package/compiler/gotest/runner.go +1225 -0
- package/compiler/gotest/runner_test.go +1271 -0
- package/compiler/gotest/test.go +9 -0
- package/compiler/index.test.ts +1 -1
- package/compiler/lowered-program.go +80 -21
- package/compiler/lowering.go +6754 -602
- package/compiler/override-facts.go +357 -0
- package/compiler/override-registry.go +52 -190
- package/compiler/override-registry_test.go +182 -0
- package/compiler/package-graph.go +50 -27
- package/compiler/package-graph_test.go +99 -9
- package/compiler/package-test-function.go +9 -0
- package/compiler/package-test-graph-package.go +40 -0
- package/compiler/package-test-graph-variant.go +129 -0
- package/compiler/package-test-graph.go +112 -0
- package/compiler/package-test-graph_test.go +202 -0
- package/compiler/runtime-contract.go +229 -29
- package/compiler/runtime-contract_test.go +44 -30
- package/compiler/semantic-model-types.go +25 -6
- package/compiler/semantic-model.go +819 -74
- package/compiler/semantic-model_test.go +104 -0
- package/compiler/service.go +10 -4
- package/compiler/skeleton_test.go +2777 -524
- package/compiler/tsworkspace/owner-process-unix_test.go +72 -0
- package/compiler/tsworkspace/owner.go +342 -0
- package/compiler/tsworkspace/owner_test.go +93 -0
- package/compiler/tsworkspace/result.go +17 -0
- package/compiler/tsworkspace/tool-process-other.go +14 -0
- package/compiler/tsworkspace/tool-process-unix.go +19 -0
- package/compiler/typescript-emitter.go +576 -86
- package/compiler/wasm/compile.go +1 -1
- package/compiler/wasm/compile_test.go +61 -11
- package/compiler/wasm_api.go +172 -7
- package/dist/gs/builtin/builtin.d.ts +40 -3
- package/dist/gs/builtin/builtin.js +430 -22
- package/dist/gs/builtin/builtin.js.map +1 -1
- package/dist/gs/builtin/channel.d.ts +32 -10
- package/dist/gs/builtin/channel.js +119 -25
- package/dist/gs/builtin/channel.js.map +1 -1
- package/dist/gs/builtin/defer.d.ts +1 -0
- package/dist/gs/builtin/defer.js +12 -2
- package/dist/gs/builtin/defer.js.map +1 -1
- package/dist/gs/builtin/hostio.d.ts +9 -0
- package/dist/gs/builtin/hostio.js +25 -0
- package/dist/gs/builtin/hostio.js.map +1 -1
- package/dist/gs/builtin/map.js +40 -6
- package/dist/gs/builtin/map.js.map +1 -1
- package/dist/gs/builtin/print.js.map +1 -1
- package/dist/gs/builtin/slice.d.ts +64 -10
- package/dist/gs/builtin/slice.js +619 -244
- package/dist/gs/builtin/slice.js.map +1 -1
- package/dist/gs/builtin/type.d.ts +7 -2
- package/dist/gs/builtin/type.js +128 -29
- package/dist/gs/builtin/type.js.map +1 -1
- package/dist/gs/builtin/varRef.d.ts +7 -0
- package/dist/gs/builtin/varRef.js +23 -0
- package/dist/gs/builtin/varRef.js.map +1 -1
- package/dist/gs/bytes/buffer.gs.js +74 -70
- package/dist/gs/bytes/buffer.gs.js.map +1 -1
- package/dist/gs/bytes/iter.gs.js +13 -13
- package/dist/gs/bytes/iter.gs.js.map +1 -1
- package/dist/gs/bytes/reader.gs.js +20 -18
- package/dist/gs/bytes/reader.gs.js.map +1 -1
- package/dist/gs/compress/zlib/index.d.ts +26 -0
- package/dist/gs/compress/zlib/index.js +168 -0
- package/dist/gs/compress/zlib/index.js.map +1 -0
- package/dist/gs/context/context.d.ts +6 -5
- package/dist/gs/context/context.js +17 -12
- package/dist/gs/context/context.js.map +1 -1
- package/dist/gs/crypto/ecdh/index.d.ts +52 -0
- package/dist/gs/crypto/ecdh/index.js +226 -0
- package/dist/gs/crypto/ecdh/index.js.map +1 -0
- package/dist/gs/crypto/ed25519/index.d.ts +34 -0
- package/dist/gs/crypto/ed25519/index.js +160 -0
- package/dist/gs/crypto/ed25519/index.js.map +1 -0
- package/dist/gs/crypto/internal/constanttime/index.d.ts +4 -0
- package/dist/gs/crypto/internal/constanttime/index.js +18 -0
- package/dist/gs/crypto/internal/constanttime/index.js.map +1 -0
- package/dist/gs/crypto/internal/fips140deps/byteorder/index.d.ts +1 -0
- package/dist/gs/crypto/internal/fips140deps/byteorder/index.js +2 -0
- package/dist/gs/crypto/internal/fips140deps/byteorder/index.js.map +1 -0
- package/dist/gs/crypto/internal/fips140deps/godebug/index.d.ts +1 -0
- package/dist/gs/crypto/internal/fips140deps/godebug/index.js +2 -0
- package/dist/gs/crypto/internal/fips140deps/godebug/index.js.map +1 -0
- package/dist/gs/crypto/rand/index.d.ts +2 -0
- package/dist/gs/crypto/rand/index.js +85 -0
- package/dist/gs/crypto/rand/index.js.map +1 -1
- package/dist/gs/crypto/sha256/index.d.ts +8 -0
- package/dist/gs/crypto/sha256/index.js +118 -0
- package/dist/gs/crypto/sha256/index.js.map +1 -0
- package/dist/gs/crypto/sha512/index.d.ts +14 -0
- package/dist/gs/crypto/sha512/index.js +129 -0
- package/dist/gs/crypto/sha512/index.js.map +1 -0
- package/dist/gs/embed/index.d.ts +7 -0
- package/dist/gs/embed/index.js +16 -0
- package/dist/gs/embed/index.js.map +1 -0
- package/dist/gs/encoding/json/index.d.ts +4 -0
- package/dist/gs/encoding/json/index.js +33 -0
- package/dist/gs/encoding/json/index.js.map +1 -1
- package/dist/gs/errors/errors.d.ts +4 -0
- package/dist/gs/errors/errors.js +108 -4
- package/dist/gs/errors/errors.js.map +1 -1
- package/dist/gs/fmt/fmt.d.ts +4 -4
- package/dist/gs/fmt/fmt.js +42 -11
- package/dist/gs/fmt/fmt.js.map +1 -1
- package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/index.d.ts +37 -2
- package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/index.js +245 -1
- package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/index.js.map +1 -1
- package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.d.ts +189 -0
- package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.js +861 -0
- package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.js.map +1 -0
- package/dist/gs/github.com/aperturerobotics/starpc/srpc/index.d.ts +217 -0
- package/dist/gs/github.com/aperturerobotics/starpc/srpc/index.js +814 -0
- package/dist/gs/github.com/aperturerobotics/starpc/srpc/index.js.map +1 -0
- package/dist/gs/github.com/aperturerobotics/util/conc/index.d.ts +20 -0
- package/dist/gs/github.com/aperturerobotics/util/conc/index.js +134 -0
- package/dist/gs/github.com/aperturerobotics/util/conc/index.js.map +1 -0
- package/dist/gs/github.com/aperturerobotics/wasivm/wazero/kernel/runtime/browser/browser.js.map +1 -1
- package/dist/gs/github.com/hack-pad/safejs/internal/catch/index.d.ts +3 -0
- package/dist/gs/github.com/hack-pad/safejs/internal/catch/index.js +50 -0
- package/dist/gs/github.com/hack-pad/safejs/internal/catch/index.js.map +1 -0
- package/dist/gs/github.com/klauspost/compress/internal/le/index.d.ts +9 -0
- package/dist/gs/github.com/klauspost/compress/internal/le/index.js +72 -0
- package/dist/gs/github.com/klauspost/compress/internal/le/index.js.map +1 -0
- package/dist/gs/github.com/mr-tron/base58/base58/index.d.ts +27 -0
- package/dist/gs/github.com/mr-tron/base58/base58/index.js +172 -0
- package/dist/gs/github.com/mr-tron/base58/base58/index.js.map +1 -0
- package/dist/gs/github.com/zeebo/blake3/internal/consts/index.d.ts +21 -0
- package/dist/gs/github.com/zeebo/blake3/internal/consts/index.js +22 -0
- package/dist/gs/github.com/zeebo/blake3/internal/consts/index.js.map +1 -0
- package/dist/gs/go/internal/scannerhooks/index.d.ts +3 -0
- package/dist/gs/go/internal/scannerhooks/index.js +5 -0
- package/dist/gs/go/internal/scannerhooks/index.js.map +1 -0
- package/dist/gs/go/scanner/index.d.ts +13 -0
- package/dist/gs/go/scanner/index.js +35 -0
- package/dist/gs/go/scanner/index.js.map +1 -1
- package/dist/gs/go/token/index.d.ts +156 -0
- package/dist/gs/go/token/index.js +507 -4
- package/dist/gs/go/token/index.js.map +1 -1
- package/dist/gs/hash/fnv/index.d.ts +57 -0
- package/dist/gs/hash/fnv/index.js +299 -0
- package/dist/gs/hash/fnv/index.js.map +1 -0
- package/dist/gs/hash/index.d.ts +17 -0
- package/dist/gs/hash/index.js +94 -0
- package/dist/gs/hash/index.js.map +1 -0
- package/dist/gs/internal/abi/index.d.ts +4 -0
- package/dist/gs/internal/abi/index.js +10 -0
- package/dist/gs/internal/abi/index.js.map +1 -1
- package/dist/gs/internal/bytealg/index.d.ts +2 -0
- package/dist/gs/internal/bytealg/index.js +14 -0
- package/dist/gs/internal/bytealg/index.js.map +1 -1
- package/dist/gs/internal/byteorder/index.d.ts +8 -2
- package/dist/gs/internal/byteorder/index.js +56 -25
- package/dist/gs/internal/byteorder/index.js.map +1 -1
- package/dist/gs/internal/godebug/index.d.ts +12 -0
- package/dist/gs/internal/godebug/index.js +30 -0
- package/dist/gs/internal/godebug/index.js.map +1 -0
- package/dist/gs/io/fs/index.d.ts +1 -0
- package/dist/gs/io/fs/index.js +1 -0
- package/dist/gs/io/fs/index.js.map +1 -1
- package/dist/gs/io/fs/readlink.d.ts +8 -0
- package/dist/gs/io/fs/readlink.js +60 -0
- package/dist/gs/io/fs/readlink.js.map +1 -0
- package/dist/gs/io/fs/walk.d.ts +3 -3
- package/dist/gs/io/fs/walk.js +7 -7
- package/dist/gs/io/fs/walk.js.map +1 -1
- package/dist/gs/io/io.d.ts +40 -6
- package/dist/gs/io/io.js +151 -26
- package/dist/gs/io/io.js.map +1 -1
- package/dist/gs/iter/iter.d.ts +3 -2
- package/dist/gs/iter/iter.js.map +1 -1
- package/dist/gs/maps/iter.d.ts +5 -5
- package/dist/gs/maps/iter.js +48 -21
- package/dist/gs/maps/iter.js.map +1 -1
- package/dist/gs/maps/maps.d.ts +6 -6
- package/dist/gs/maps/maps.js +1 -1
- package/dist/gs/maps/maps.js.map +1 -1
- package/dist/gs/math/bits/index.d.ts +13 -4
- package/dist/gs/math/bits/index.js +70 -48
- package/dist/gs/math/bits/index.js.map +1 -1
- package/dist/gs/math/const.gs.d.ts +5 -5
- package/dist/gs/math/const.gs.js +4 -4
- package/dist/gs/math/const.gs.js.map +1 -1
- package/dist/gs/mime/index.d.ts +1 -0
- package/dist/gs/mime/index.js +52 -0
- package/dist/gs/mime/index.js.map +1 -0
- package/dist/gs/net/http/httptest/index.d.ts +30 -0
- package/dist/gs/net/http/httptest/index.js +101 -0
- package/dist/gs/net/http/httptest/index.js.map +1 -0
- package/dist/gs/net/http/index.d.ts +131 -0
- package/dist/gs/net/http/index.js +307 -0
- package/dist/gs/net/http/index.js.map +1 -0
- package/dist/gs/net/http/pprof/index.d.ts +8 -0
- package/dist/gs/net/http/pprof/index.js +59 -0
- package/dist/gs/net/http/pprof/index.js.map +1 -0
- package/dist/gs/os/dir_unix.gs.js +2 -2
- package/dist/gs/os/dir_unix.gs.js.map +1 -1
- package/dist/gs/os/error.gs.js +9 -7
- package/dist/gs/os/error.gs.js.map +1 -1
- package/dist/gs/os/types_js.gs.js +95 -15
- package/dist/gs/os/types_js.gs.js.map +1 -1
- package/dist/gs/path/filepath/match.js +165 -3
- package/dist/gs/path/filepath/match.js.map +1 -1
- package/dist/gs/path/filepath/path.d.ts +8 -4
- package/dist/gs/path/filepath/path.js +192 -8
- package/dist/gs/path/filepath/path.js.map +1 -1
- package/dist/gs/path/path.d.ts +4 -1
- package/dist/gs/path/path.js +16 -4
- package/dist/gs/path/path.js.map +1 -1
- package/dist/gs/reflect/index.d.ts +4 -3
- package/dist/gs/reflect/index.js +3 -2
- package/dist/gs/reflect/index.js.map +1 -1
- package/dist/gs/reflect/iter.js +2 -2
- package/dist/gs/reflect/iter.js.map +1 -1
- package/dist/gs/reflect/map.js +29 -0
- package/dist/gs/reflect/map.js.map +1 -1
- package/dist/gs/reflect/type.d.ts +31 -9
- package/dist/gs/reflect/type.js +536 -43
- package/dist/gs/reflect/type.js.map +1 -1
- package/dist/gs/reflect/types.d.ts +1 -0
- package/dist/gs/reflect/types.js +3 -1
- package/dist/gs/reflect/types.js.map +1 -1
- package/dist/gs/reflect/value.d.ts +4 -1
- package/dist/gs/reflect/value.js +39 -1
- package/dist/gs/reflect/value.js.map +1 -1
- package/dist/gs/reflect/visiblefields.js +1 -1
- package/dist/gs/reflect/visiblefields.js.map +1 -1
- package/dist/gs/runtime/debug/index.d.ts +41 -0
- package/dist/gs/runtime/debug/index.js +66 -0
- package/dist/gs/runtime/debug/index.js.map +1 -0
- package/dist/gs/runtime/pprof/index.d.ts +20 -0
- package/dist/gs/runtime/pprof/index.js +85 -0
- package/dist/gs/runtime/pprof/index.js.map +1 -0
- package/dist/gs/runtime/runtime.d.ts +35 -3
- package/dist/gs/runtime/runtime.js +72 -0
- package/dist/gs/runtime/runtime.js.map +1 -1
- package/dist/gs/runtime/trace/index.d.ts +19 -0
- package/dist/gs/runtime/trace/index.js +64 -0
- package/dist/gs/runtime/trace/index.js.map +1 -0
- package/dist/gs/slices/slices.d.ts +42 -8
- package/dist/gs/slices/slices.js +425 -11
- package/dist/gs/slices/slices.js.map +1 -1
- package/dist/gs/sort/slice.gs.d.ts +5 -3
- package/dist/gs/sort/slice.gs.js +60 -22
- package/dist/gs/sort/slice.gs.js.map +1 -1
- package/dist/gs/sort/sort.gs.d.ts +4 -4
- package/dist/gs/sort/sort.gs.js +11 -8
- package/dist/gs/sort/sort.gs.js.map +1 -1
- package/dist/gs/strings/builder.d.ts +1 -1
- package/dist/gs/strings/builder.js +29 -19
- package/dist/gs/strings/builder.js.map +1 -1
- package/dist/gs/strings/iter.js +140 -75
- package/dist/gs/strings/iter.js.map +1 -1
- package/dist/gs/strings/replace.js +2 -2
- package/dist/gs/strings/replace.js.map +1 -1
- package/dist/gs/strings/strings.js +52 -6
- package/dist/gs/strings/strings.js.map +1 -1
- package/dist/gs/sync/atomic/type.gs.d.ts +9 -8
- package/dist/gs/sync/atomic/type.gs.js +0 -2
- package/dist/gs/sync/atomic/type.gs.js.map +1 -1
- package/dist/gs/sync/sync.d.ts +8 -3
- package/dist/gs/sync/sync.js +66 -11
- package/dist/gs/sync/sync.js.map +1 -1
- package/dist/gs/syscall/constants.d.ts +36 -24
- package/dist/gs/syscall/constants.js +12 -0
- package/dist/gs/syscall/constants.js.map +1 -1
- package/dist/gs/syscall/errors.d.ts +117 -111
- package/dist/gs/syscall/errors.js +45 -0
- package/dist/gs/syscall/errors.js.map +1 -1
- package/dist/gs/syscall/fs.d.ts +37 -0
- package/dist/gs/syscall/fs.js +102 -0
- package/dist/gs/syscall/fs.js.map +1 -1
- package/dist/gs/syscall/js/index.d.ts +90 -0
- package/dist/gs/syscall/js/index.js +383 -0
- package/dist/gs/syscall/js/index.js.map +1 -0
- package/dist/gs/syscall/types.d.ts +26 -1
- package/dist/gs/syscall/types.js +45 -1
- package/dist/gs/syscall/types.js.map +1 -1
- package/dist/gs/testing/index.d.ts +1 -0
- package/dist/gs/testing/index.js +2 -0
- package/dist/gs/testing/index.js.map +1 -0
- package/dist/gs/testing/testing.d.ts +78 -0
- package/dist/gs/testing/testing.js +318 -0
- package/dist/gs/testing/testing.js.map +1 -0
- package/dist/gs/time/time.d.ts +41 -4
- package/dist/gs/time/time.js +227 -36
- package/dist/gs/time/time.js.map +1 -1
- package/dist/gs/unicode/unicode.d.ts +23 -1
- package/dist/gs/unicode/unicode.js +79 -10
- package/dist/gs/unicode/unicode.js.map +1 -1
- package/dist/gs/unicode/utf8/utf8.d.ts +4 -4
- package/dist/gs/unicode/utf8/utf8.js +24 -11
- package/dist/gs/unicode/utf8/utf8.js.map +1 -1
- package/dist/gs/unique/index.d.ts +11 -0
- package/dist/gs/unique/index.js +76 -0
- package/dist/gs/unique/index.js.map +1 -0
- package/go.mod +8 -8
- package/go.sum +14 -14
- package/gs/builtin/builtin.ts +585 -27
- package/gs/builtin/channel.ts +183 -29
- package/gs/builtin/defer.ts +13 -2
- package/gs/builtin/hostio.test.ts +1 -0
- package/gs/builtin/hostio.ts +38 -0
- package/gs/builtin/map.ts +46 -6
- package/gs/builtin/print.ts +12 -3
- package/gs/builtin/runtime-contract.test.ts +383 -10
- package/gs/builtin/slice.test.ts +70 -0
- package/gs/builtin/slice.ts +785 -265
- package/gs/builtin/type.ts +160 -41
- package/gs/builtin/varRef.ts +40 -1
- package/gs/bytes/buffer.gs.ts +74 -70
- package/gs/bytes/iter.gs.ts +13 -14
- package/gs/bytes/meta.json +8 -3
- package/gs/bytes/reader.gs.ts +20 -19
- package/gs/compress/zlib/index.test.ts +28 -0
- package/gs/compress/zlib/index.ts +200 -0
- package/gs/compress/zlib/meta.json +3 -0
- package/gs/context/context.test.ts +71 -0
- package/gs/context/context.ts +30 -29
- package/gs/crypto/ecdh/index.test.ts +43 -0
- package/gs/crypto/ecdh/index.ts +274 -0
- package/gs/crypto/ed25519/index.test.ts +41 -0
- package/gs/crypto/ed25519/index.ts +238 -0
- package/gs/crypto/ed25519/meta.json +13 -0
- package/gs/crypto/internal/constanttime/index.test.ts +25 -0
- package/gs/crypto/internal/constanttime/index.ts +22 -0
- package/gs/crypto/internal/fips140deps/byteorder/index.ts +1 -0
- package/gs/crypto/internal/fips140deps/godebug/index.ts +1 -0
- package/gs/crypto/rand/index.test.ts +89 -1
- package/gs/crypto/rand/index.ts +103 -1
- package/gs/crypto/rand/meta.json +4 -1
- package/gs/crypto/sha256/index.test.ts +78 -0
- package/gs/crypto/sha256/index.ts +150 -0
- package/gs/crypto/sha256/meta.json +9 -0
- package/gs/crypto/sha512/index.test.ts +31 -0
- package/gs/crypto/sha512/index.ts +161 -0
- package/gs/crypto/sha512/meta.json +11 -0
- package/gs/embed/index.ts +20 -0
- package/gs/embed/meta.json +5 -0
- package/gs/encoding/json/index.test.ts +39 -3
- package/gs/encoding/json/index.ts +45 -3
- package/gs/errors/errors.test.ts +85 -0
- package/gs/errors/errors.ts +132 -4
- package/gs/fmt/fmt.test.ts +3 -1
- package/gs/fmt/fmt.ts +55 -19
- package/gs/github.com/aperturerobotics/protobuf-go-lite/index.test.ts +128 -1
- package/gs/github.com/aperturerobotics/protobuf-go-lite/index.ts +342 -4
- package/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.test.ts +180 -0
- package/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.ts +1084 -0
- package/gs/github.com/aperturerobotics/starpc/srpc/index.test.ts +31 -0
- package/gs/github.com/aperturerobotics/starpc/srpc/index.ts +1233 -0
- package/gs/github.com/aperturerobotics/starpc/srpc/meta.json +46 -0
- package/gs/github.com/aperturerobotics/util/conc/index.test.ts +30 -0
- package/gs/github.com/aperturerobotics/util/conc/index.ts +172 -0
- package/gs/github.com/aperturerobotics/util/conc/meta.json +9 -0
- package/gs/github.com/aperturerobotics/wasivm/wazero/kernel/runtime/browser/browser.ts +1 -4
- package/gs/github.com/hack-pad/safejs/internal/catch/index.test.ts +35 -0
- package/gs/github.com/hack-pad/safejs/internal/catch/index.ts +65 -0
- package/gs/github.com/hack-pad/safejs/internal/catch/meta.json +9 -0
- package/gs/github.com/klauspost/compress/internal/le/index.test.ts +37 -0
- package/gs/github.com/klauspost/compress/internal/le/index.ts +115 -0
- package/gs/github.com/mr-tron/base58/base58/index.test.ts +70 -0
- package/gs/github.com/mr-tron/base58/base58/index.ts +231 -0
- package/gs/github.com/mr-tron/base58/base58/meta.json +3 -0
- package/gs/github.com/zeebo/blake3/internal/consts/index.test.ts +46 -0
- package/gs/github.com/zeebo/blake3/internal/consts/index.ts +26 -0
- package/gs/go/internal/scannerhooks/index.test.ts +14 -0
- package/gs/go/internal/scannerhooks/index.ts +9 -0
- package/gs/go/scanner/index.test.ts +22 -0
- package/gs/go/scanner/index.ts +47 -0
- package/gs/go/token/index.test.ts +47 -1
- package/gs/go/token/index.ts +583 -4
- package/gs/hash/fnv/index.test.ts +67 -0
- package/gs/hash/fnv/index.ts +351 -0
- package/gs/hash/fnv/meta.json +3 -0
- package/gs/hash/index.test.ts +37 -0
- package/gs/hash/index.ts +118 -0
- package/gs/hash/meta.json +5 -0
- package/gs/internal/abi/index.test.ts +18 -0
- package/gs/internal/abi/index.ts +14 -0
- package/gs/internal/bytealg/index.test.ts +18 -0
- package/gs/internal/bytealg/index.ts +16 -0
- package/gs/internal/byteorder/index.test.ts +39 -0
- package/gs/internal/byteorder/index.ts +100 -27
- package/gs/internal/godebug/index.test.ts +16 -0
- package/gs/internal/godebug/index.ts +35 -0
- package/gs/io/fs/index.ts +1 -0
- package/gs/io/fs/meta.json +5 -0
- package/gs/io/fs/readlink.test.ts +43 -0
- package/gs/io/fs/readlink.ts +69 -0
- package/gs/io/fs/walk.test.ts +61 -0
- package/gs/io/fs/walk.ts +17 -9
- package/gs/io/io.ts +177 -31
- package/gs/io/meta.json +10 -2
- package/gs/iter/iter.ts +8 -2
- package/gs/maps/iter.ts +75 -26
- package/gs/maps/maps.test.ts +23 -0
- package/gs/maps/maps.ts +13 -11
- package/gs/math/bits/index.test.ts +20 -0
- package/gs/math/bits/index.ts +107 -64
- package/gs/math/const.gs.test.ts +11 -5
- package/gs/math/const.gs.ts +5 -6
- package/gs/mime/index.ts +60 -0
- package/gs/net/http/httptest/index.test.ts +53 -0
- package/gs/net/http/httptest/index.ts +120 -0
- package/gs/net/http/index.test.ts +148 -0
- package/gs/net/http/index.ts +432 -0
- package/gs/net/http/meta.json +6 -0
- package/gs/net/http/pprof/index.test.ts +47 -0
- package/gs/net/http/pprof/index.ts +65 -0
- package/gs/os/dir_unix.gs.ts +2 -3
- package/gs/os/error.gs.ts +9 -10
- package/gs/os/error.test.ts +41 -0
- package/gs/os/file_unix_js.test.ts +55 -0
- package/gs/os/tempfile.gs.test.ts +37 -10
- package/gs/os/types_js.gs.ts +96 -17
- package/gs/path/filepath/match.test.ts +31 -12
- package/gs/path/filepath/match.ts +181 -3
- package/gs/path/filepath/meta.json +6 -0
- package/gs/path/filepath/path.test.ts +80 -0
- package/gs/path/filepath/path.ts +244 -11
- package/gs/path/path.ts +20 -5
- package/gs/reflect/field.test.ts +63 -0
- package/gs/reflect/index.ts +5 -1
- package/gs/reflect/iter.ts +2 -2
- package/gs/reflect/map.test.ts +42 -1
- package/gs/reflect/map.ts +39 -0
- package/gs/reflect/type.ts +728 -65
- package/gs/reflect/typefor.test.ts +100 -0
- package/gs/reflect/types.ts +3 -1
- package/gs/reflect/value.ts +50 -1
- package/gs/reflect/visiblefields.ts +1 -1
- package/gs/runtime/debug/index.test.ts +45 -0
- package/gs/runtime/debug/index.ts +96 -0
- package/gs/runtime/pprof/index.test.ts +36 -0
- package/gs/runtime/pprof/index.ts +104 -0
- package/gs/runtime/pprof/meta.json +6 -0
- package/gs/runtime/runtime.test.ts +19 -0
- package/gs/runtime/runtime.ts +98 -3
- package/gs/runtime/trace/index.test.ts +45 -0
- package/gs/runtime/trace/index.ts +97 -0
- package/gs/runtime/trace/meta.json +7 -0
- package/gs/slices/meta.json +2 -1
- package/gs/slices/slices.test.ts +180 -0
- package/gs/slices/slices.ts +502 -15
- package/gs/sort/meta.json +7 -0
- package/gs/sort/slice.gs.ts +85 -26
- package/gs/sort/slice.test.ts +40 -0
- package/gs/sort/sort.gs.ts +16 -13
- package/gs/strings/builder.test.ts +8 -0
- package/gs/strings/builder.ts +33 -20
- package/gs/strings/iter.test.ts +5 -7
- package/gs/strings/iter.ts +146 -71
- package/gs/strings/replace.test.ts +1 -4
- package/gs/strings/replace.ts +6 -6
- package/gs/strings/strings.test.ts +4 -0
- package/gs/strings/strings.ts +54 -6
- package/gs/sync/atomic/type.gs.ts +13 -14
- package/gs/sync/meta.json +3 -1
- package/gs/sync/sync.test.ts +69 -1
- package/gs/sync/sync.ts +72 -13
- package/gs/syscall/constants.ts +39 -24
- package/gs/syscall/errors.ts +165 -112
- package/gs/syscall/fs.ts +195 -0
- package/gs/syscall/js/index.ts +485 -0
- package/gs/syscall/js/meta.json +4 -0
- package/gs/syscall/net.test.ts +111 -0
- package/gs/syscall/types.ts +63 -2
- package/gs/testing/index.ts +1 -0
- package/gs/testing/meta.json +5 -0
- package/gs/testing/testing.test.ts +146 -0
- package/gs/testing/testing.ts +399 -0
- package/gs/time/meta.json +2 -2
- package/gs/time/time.test.ts +110 -0
- package/gs/time/time.ts +309 -57
- package/gs/unicode/unicode.test.ts +36 -0
- package/gs/unicode/unicode.ts +115 -9
- package/gs/unicode/utf8/utf8.test.ts +13 -0
- package/gs/unicode/utf8/utf8.ts +28 -16
- package/gs/unique/index.ts +98 -0
- package/package.json +3 -2
package/gs/syscall/errors.ts
CHANGED
|
@@ -1,657 +1,710 @@
|
|
|
1
1
|
import * as $ from '@goscript/builtin/index.js'
|
|
2
|
-
import { Errno } from './types.js'
|
|
3
|
-
|
|
4
|
-
export
|
|
2
|
+
import { Errno, ErrnoObject } from './types.js'
|
|
3
|
+
|
|
4
|
+
export function Errno_Error(errno: Errno): string {
|
|
5
|
+
if (typeof errno !== 'number') {
|
|
6
|
+
return errno.Error()
|
|
7
|
+
}
|
|
8
|
+
return `errno ${errno}`
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function Errno_Is(errno: Errno, target: $.GoError): boolean {
|
|
12
|
+
if (target === null) {
|
|
13
|
+
return false
|
|
14
|
+
}
|
|
15
|
+
if (typeof errno !== 'number' && errno.Is(target)) {
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
const errnoValue = errnoNumber(errno)
|
|
19
|
+
const targetValue = errnoNumber(target)
|
|
20
|
+
return targetValue !== null && errnoValue === targetValue
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function Errno_Temporary(errno: Errno): boolean {
|
|
24
|
+
const value = errnoNumber(errno)
|
|
25
|
+
return (
|
|
26
|
+
value === errnoNumber(EINTR) ||
|
|
27
|
+
value === errnoNumber(EMFILE) ||
|
|
28
|
+
value === errnoNumber(ENFILE) ||
|
|
29
|
+
Errno_Timeout(errno)
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function Errno_Timeout(errno: Errno): boolean {
|
|
34
|
+
const value = errnoNumber(errno)
|
|
35
|
+
return value === errnoNumber(EAGAIN) || value === errnoNumber(ETIMEDOUT)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function errnoNumber(errno: unknown): number | null {
|
|
39
|
+
if (typeof errno === 'number') {
|
|
40
|
+
return errno
|
|
41
|
+
}
|
|
42
|
+
if (errno !== null && typeof errno === 'object') {
|
|
43
|
+
const value = (errno as { Errno?: () => unknown }).Errno?.()
|
|
44
|
+
if (typeof value === 'number') {
|
|
45
|
+
return value
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return null
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const EPERM: ErrnoObject = {
|
|
5
52
|
Error: () => 'operation not permitted',
|
|
6
53
|
Is: (target: $.GoError) => target === EPERM,
|
|
7
54
|
Errno: () => 1,
|
|
8
55
|
}
|
|
9
56
|
|
|
10
|
-
export const ENOENT:
|
|
57
|
+
export const ENOENT: ErrnoObject = {
|
|
11
58
|
Error: () => 'no such file or directory',
|
|
12
59
|
Is: (target: $.GoError) => target === ENOENT,
|
|
13
60
|
Errno: () => 2,
|
|
14
61
|
}
|
|
15
62
|
|
|
16
|
-
export const ESRCH:
|
|
63
|
+
export const ESRCH: ErrnoObject = {
|
|
17
64
|
Error: () => 'no such process',
|
|
18
65
|
Is: (target: $.GoError) => target === ESRCH,
|
|
19
66
|
Errno: () => 3,
|
|
20
67
|
}
|
|
21
68
|
|
|
22
|
-
export const EINTR:
|
|
69
|
+
export const EINTR: ErrnoObject = {
|
|
23
70
|
Error: () => 'interrupted system call',
|
|
24
71
|
Is: (target: $.GoError) => target === EINTR,
|
|
25
72
|
Errno: () => 4,
|
|
26
73
|
}
|
|
27
74
|
|
|
28
|
-
export const EIO:
|
|
75
|
+
export const EIO: ErrnoObject = {
|
|
29
76
|
Error: () => 'I/O error',
|
|
30
77
|
Is: (target: $.GoError) => target === EIO,
|
|
31
78
|
Errno: () => 5,
|
|
32
79
|
}
|
|
33
80
|
|
|
34
|
-
export const ENXIO:
|
|
81
|
+
export const ENXIO: ErrnoObject = {
|
|
35
82
|
Error: () => 'no such device or address',
|
|
36
83
|
Is: (target: $.GoError) => target === ENXIO,
|
|
37
84
|
Errno: () => 6,
|
|
38
85
|
}
|
|
39
86
|
|
|
40
|
-
export const E2BIG:
|
|
87
|
+
export const E2BIG: ErrnoObject = {
|
|
41
88
|
Error: () => 'argument list too long',
|
|
42
89
|
Is: (target: $.GoError) => target === E2BIG,
|
|
43
90
|
Errno: () => 7,
|
|
44
91
|
}
|
|
45
92
|
|
|
46
|
-
export const ENOEXEC:
|
|
93
|
+
export const ENOEXEC: ErrnoObject = {
|
|
47
94
|
Error: () => 'exec format error',
|
|
48
95
|
Is: (target: $.GoError) => target === ENOEXEC,
|
|
49
96
|
Errno: () => 8,
|
|
50
97
|
}
|
|
51
98
|
|
|
52
|
-
export const EBADF:
|
|
99
|
+
export const EBADF: ErrnoObject = {
|
|
53
100
|
Error: () => 'bad file number',
|
|
54
101
|
Is: (target: $.GoError) => target === EBADF,
|
|
55
102
|
Errno: () => 9,
|
|
56
103
|
}
|
|
57
104
|
|
|
58
|
-
export const ECHILD:
|
|
105
|
+
export const ECHILD: ErrnoObject = {
|
|
59
106
|
Error: () => 'no child processes',
|
|
60
107
|
Is: (target: $.GoError) => target === ECHILD,
|
|
61
108
|
Errno: () => 10,
|
|
62
109
|
}
|
|
63
110
|
|
|
64
|
-
export const EAGAIN:
|
|
111
|
+
export const EAGAIN: ErrnoObject = {
|
|
65
112
|
Error: () => 'try again',
|
|
66
113
|
Is: (target: $.GoError) => target === EAGAIN,
|
|
67
114
|
Errno: () => 11,
|
|
68
115
|
}
|
|
69
116
|
|
|
70
|
-
export const ENOMEM:
|
|
117
|
+
export const ENOMEM: ErrnoObject = {
|
|
71
118
|
Error: () => 'out of memory',
|
|
72
119
|
Is: (target: $.GoError) => target === ENOMEM,
|
|
73
120
|
Errno: () => 12,
|
|
74
121
|
}
|
|
75
122
|
|
|
76
|
-
export const EACCES:
|
|
123
|
+
export const EACCES: ErrnoObject = {
|
|
77
124
|
Error: () => 'permission denied',
|
|
78
125
|
Is: (target: $.GoError) => target === EACCES,
|
|
79
126
|
Errno: () => 13,
|
|
80
127
|
}
|
|
81
128
|
|
|
82
|
-
export const EFAULT:
|
|
129
|
+
export const EFAULT: ErrnoObject = {
|
|
83
130
|
Error: () => 'bad address',
|
|
84
131
|
Is: (target: $.GoError) => target === EFAULT,
|
|
85
132
|
Errno: () => 14,
|
|
86
133
|
}
|
|
87
134
|
|
|
88
|
-
export const EBUSY:
|
|
135
|
+
export const EBUSY: ErrnoObject = {
|
|
89
136
|
Error: () => 'device or resource busy',
|
|
90
137
|
Is: (target: $.GoError) => target === EBUSY,
|
|
91
138
|
Errno: () => 16,
|
|
92
139
|
}
|
|
93
140
|
|
|
94
|
-
export const EEXIST:
|
|
141
|
+
export const EEXIST: ErrnoObject = {
|
|
95
142
|
Error: () => 'file exists',
|
|
96
143
|
Is: (target: $.GoError) => target === EEXIST,
|
|
97
144
|
Errno: () => 17,
|
|
98
145
|
}
|
|
99
146
|
|
|
100
|
-
export const EXDEV:
|
|
147
|
+
export const EXDEV: ErrnoObject = {
|
|
101
148
|
Error: () => 'cross-device link',
|
|
102
149
|
Is: (target: $.GoError) => target === EXDEV,
|
|
103
150
|
Errno: () => 18,
|
|
104
151
|
}
|
|
105
152
|
|
|
106
|
-
export const ENODEV:
|
|
153
|
+
export const ENODEV: ErrnoObject = {
|
|
107
154
|
Error: () => 'no such device',
|
|
108
155
|
Is: (target: $.GoError) => target === ENODEV,
|
|
109
156
|
Errno: () => 19,
|
|
110
157
|
}
|
|
111
158
|
|
|
112
|
-
export const ENOTDIR:
|
|
159
|
+
export const ENOTDIR: ErrnoObject = {
|
|
113
160
|
Error: () => 'not a directory',
|
|
114
161
|
Is: (target: $.GoError) => target === ENOTDIR,
|
|
115
162
|
Errno: () => 20,
|
|
116
163
|
}
|
|
117
164
|
|
|
118
|
-
export const EISDIR:
|
|
165
|
+
export const EISDIR: ErrnoObject = {
|
|
119
166
|
Error: () => 'is a directory',
|
|
120
167
|
Is: (target: $.GoError) => target === EISDIR,
|
|
121
168
|
Errno: () => 21,
|
|
122
169
|
}
|
|
123
170
|
|
|
124
|
-
export const EINVAL:
|
|
171
|
+
export const EINVAL: ErrnoObject = {
|
|
125
172
|
Error: () => 'invalid argument',
|
|
126
173
|
Is: (target: $.GoError) => target === EINVAL,
|
|
127
174
|
Errno: () => 22,
|
|
128
175
|
}
|
|
129
176
|
|
|
130
|
-
export const ENFILE:
|
|
177
|
+
export const ENFILE: ErrnoObject = {
|
|
131
178
|
Error: () => 'file table overflow',
|
|
132
179
|
Is: (target: $.GoError) => target === ENFILE,
|
|
133
180
|
Errno: () => 23,
|
|
134
181
|
}
|
|
135
182
|
|
|
136
|
-
export const EMFILE:
|
|
183
|
+
export const EMFILE: ErrnoObject = {
|
|
137
184
|
Error: () => 'too many open files',
|
|
138
185
|
Is: (target: $.GoError) => target === EMFILE,
|
|
139
186
|
Errno: () => 24,
|
|
140
187
|
}
|
|
141
188
|
|
|
142
|
-
export const ENOTTY:
|
|
189
|
+
export const ENOTTY: ErrnoObject = {
|
|
143
190
|
Error: () => 'not a typewriter',
|
|
144
191
|
Is: (target: $.GoError) => target === ENOTTY,
|
|
145
192
|
Errno: () => 25,
|
|
146
193
|
}
|
|
147
194
|
|
|
148
|
-
export const EFBIG:
|
|
195
|
+
export const EFBIG: ErrnoObject = {
|
|
149
196
|
Error: () => 'file too large',
|
|
150
197
|
Is: (target: $.GoError) => target === EFBIG,
|
|
151
198
|
Errno: () => 27,
|
|
152
199
|
}
|
|
153
200
|
|
|
154
|
-
export const ENOSPC:
|
|
201
|
+
export const ENOSPC: ErrnoObject = {
|
|
155
202
|
Error: () => 'no space left on device',
|
|
156
203
|
Is: (target: $.GoError) => target === ENOSPC,
|
|
157
204
|
Errno: () => 28,
|
|
158
205
|
}
|
|
159
206
|
|
|
160
|
-
export const ESPIPE:
|
|
207
|
+
export const ESPIPE: ErrnoObject = {
|
|
161
208
|
Error: () => 'illegal seek',
|
|
162
209
|
Is: (target: $.GoError) => target === ESPIPE,
|
|
163
210
|
Errno: () => 29,
|
|
164
211
|
}
|
|
165
212
|
|
|
166
|
-
export const EROFS:
|
|
213
|
+
export const EROFS: ErrnoObject = {
|
|
167
214
|
Error: () => 'read-only file system',
|
|
168
215
|
Is: (target: $.GoError) => target === EROFS,
|
|
169
216
|
Errno: () => 30,
|
|
170
217
|
}
|
|
171
218
|
|
|
172
|
-
export const EMLINK:
|
|
219
|
+
export const EMLINK: ErrnoObject = {
|
|
173
220
|
Error: () => 'too many links',
|
|
174
221
|
Is: (target: $.GoError) => target === EMLINK,
|
|
175
222
|
Errno: () => 31,
|
|
176
223
|
}
|
|
177
224
|
|
|
178
|
-
export const EPIPE:
|
|
225
|
+
export const EPIPE: ErrnoObject = {
|
|
179
226
|
Error: () => 'broken pipe',
|
|
180
227
|
Is: (target: $.GoError) => target === EPIPE,
|
|
181
228
|
Errno: () => 32,
|
|
182
229
|
}
|
|
183
230
|
|
|
184
|
-
export const EDOM:
|
|
231
|
+
export const EDOM: ErrnoObject = {
|
|
185
232
|
Error: () => 'math arg out of domain of func',
|
|
186
233
|
Is: (target: $.GoError) => target === EDOM,
|
|
187
234
|
Errno: () => 33,
|
|
188
235
|
}
|
|
189
236
|
|
|
190
|
-
export const ERANGE:
|
|
237
|
+
export const ERANGE: ErrnoObject = {
|
|
191
238
|
Error: () => 'result too large',
|
|
192
239
|
Is: (target: $.GoError) => target === ERANGE,
|
|
193
240
|
Errno: () => 34,
|
|
194
241
|
}
|
|
195
242
|
|
|
196
|
-
export const EDEADLK:
|
|
243
|
+
export const EDEADLK: ErrnoObject = {
|
|
197
244
|
Error: () => 'deadlock condition',
|
|
198
245
|
Is: (target: $.GoError) => target === EDEADLK,
|
|
199
246
|
Errno: () => 35,
|
|
200
247
|
}
|
|
201
248
|
|
|
202
|
-
export const ENAMETOOLONG:
|
|
249
|
+
export const ENAMETOOLONG: ErrnoObject = {
|
|
203
250
|
Error: () => 'file name too long',
|
|
204
251
|
Is: (target: $.GoError) => target === ENAMETOOLONG,
|
|
205
252
|
Errno: () => 36,
|
|
206
253
|
}
|
|
207
254
|
|
|
208
|
-
export const ENOLCK:
|
|
255
|
+
export const ENOLCK: ErrnoObject = {
|
|
209
256
|
Error: () => 'no record locks available',
|
|
210
257
|
Is: (target: $.GoError) => target === ENOLCK,
|
|
211
258
|
Errno: () => 37,
|
|
212
259
|
}
|
|
213
260
|
|
|
214
|
-
export const ENOSYS:
|
|
261
|
+
export const ENOSYS: ErrnoObject = {
|
|
215
262
|
Error: () => 'function not implemented',
|
|
216
263
|
Is: (target: $.GoError) => target === ENOSYS,
|
|
217
264
|
Errno: () => 38,
|
|
218
265
|
}
|
|
219
266
|
|
|
220
|
-
export const
|
|
267
|
+
export const ENOTSUP: ErrnoObject = {
|
|
268
|
+
Error: () => 'operation not supported',
|
|
269
|
+
Is: (target: $.GoError) => target === ENOTSUP,
|
|
270
|
+
Errno: () => 95,
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export const ENOTEMPTY: ErrnoObject = {
|
|
221
274
|
Error: () => 'directory not empty',
|
|
222
275
|
Is: (target: $.GoError) => target === ENOTEMPTY,
|
|
223
276
|
Errno: () => 39,
|
|
224
277
|
}
|
|
225
278
|
|
|
226
|
-
export const ELOOP:
|
|
279
|
+
export const ELOOP: ErrnoObject = {
|
|
227
280
|
Error: () => 'too many symbolic links',
|
|
228
281
|
Is: (target: $.GoError) => target === ELOOP,
|
|
229
282
|
Errno: () => 40,
|
|
230
283
|
}
|
|
231
284
|
|
|
232
|
-
export const ENOMSG:
|
|
285
|
+
export const ENOMSG: ErrnoObject = {
|
|
233
286
|
Error: () => 'no message of desired type',
|
|
234
287
|
Is: (target: $.GoError) => target === ENOMSG,
|
|
235
288
|
Errno: () => 42,
|
|
236
289
|
}
|
|
237
290
|
|
|
238
|
-
export const EIDRM:
|
|
291
|
+
export const EIDRM: ErrnoObject = {
|
|
239
292
|
Error: () => 'identifier removed',
|
|
240
293
|
Is: (target: $.GoError) => target === EIDRM,
|
|
241
294
|
Errno: () => 43,
|
|
242
295
|
}
|
|
243
296
|
|
|
244
|
-
export const ECHRNG:
|
|
297
|
+
export const ECHRNG: ErrnoObject = {
|
|
245
298
|
Error: () => 'channel number out of range',
|
|
246
299
|
Is: (target: $.GoError) => target === ECHRNG,
|
|
247
300
|
Errno: () => 44,
|
|
248
301
|
}
|
|
249
302
|
|
|
250
|
-
export const EL2NSYNC:
|
|
303
|
+
export const EL2NSYNC: ErrnoObject = {
|
|
251
304
|
Error: () => 'level 2 not synchronized',
|
|
252
305
|
Is: (target: $.GoError) => target === EL2NSYNC,
|
|
253
306
|
Errno: () => 45,
|
|
254
307
|
}
|
|
255
308
|
|
|
256
|
-
export const EL3HLT:
|
|
309
|
+
export const EL3HLT: ErrnoObject = {
|
|
257
310
|
Error: () => 'level 3 halted',
|
|
258
311
|
Is: (target: $.GoError) => target === EL3HLT,
|
|
259
312
|
Errno: () => 46,
|
|
260
313
|
}
|
|
261
314
|
|
|
262
|
-
export const EL3RST:
|
|
315
|
+
export const EL3RST: ErrnoObject = {
|
|
263
316
|
Error: () => 'level 3 reset',
|
|
264
317
|
Is: (target: $.GoError) => target === EL3RST,
|
|
265
318
|
Errno: () => 47,
|
|
266
319
|
}
|
|
267
320
|
|
|
268
|
-
export const ELNRNG:
|
|
321
|
+
export const ELNRNG: ErrnoObject = {
|
|
269
322
|
Error: () => 'link number out of range',
|
|
270
323
|
Is: (target: $.GoError) => target === ELNRNG,
|
|
271
324
|
Errno: () => 48,
|
|
272
325
|
}
|
|
273
326
|
|
|
274
|
-
export const EUNATCH:
|
|
327
|
+
export const EUNATCH: ErrnoObject = {
|
|
275
328
|
Error: () => 'protocol driver not attached',
|
|
276
329
|
Is: (target: $.GoError) => target === EUNATCH,
|
|
277
330
|
Errno: () => 49,
|
|
278
331
|
}
|
|
279
332
|
|
|
280
|
-
export const ENOCSI:
|
|
333
|
+
export const ENOCSI: ErrnoObject = {
|
|
281
334
|
Error: () => 'no CSI structure available',
|
|
282
335
|
Is: (target: $.GoError) => target === ENOCSI,
|
|
283
336
|
Errno: () => 50,
|
|
284
337
|
}
|
|
285
338
|
|
|
286
|
-
export const EL2HLT:
|
|
339
|
+
export const EL2HLT: ErrnoObject = {
|
|
287
340
|
Error: () => 'level 2 halted',
|
|
288
341
|
Is: (target: $.GoError) => target === EL2HLT,
|
|
289
342
|
Errno: () => 51,
|
|
290
343
|
}
|
|
291
344
|
|
|
292
|
-
export const EBADE:
|
|
345
|
+
export const EBADE: ErrnoObject = {
|
|
293
346
|
Error: () => 'invalid exchange',
|
|
294
347
|
Is: (target: $.GoError) => target === EBADE,
|
|
295
348
|
Errno: () => 52,
|
|
296
349
|
}
|
|
297
350
|
|
|
298
|
-
export const EBADR:
|
|
351
|
+
export const EBADR: ErrnoObject = {
|
|
299
352
|
Error: () => 'invalid request descriptor',
|
|
300
353
|
Is: (target: $.GoError) => target === EBADR,
|
|
301
354
|
Errno: () => 53,
|
|
302
355
|
}
|
|
303
356
|
|
|
304
|
-
export const EXFULL:
|
|
357
|
+
export const EXFULL: ErrnoObject = {
|
|
305
358
|
Error: () => 'exchange full',
|
|
306
359
|
Is: (target: $.GoError) => target === EXFULL,
|
|
307
360
|
Errno: () => 54,
|
|
308
361
|
}
|
|
309
362
|
|
|
310
|
-
export const ENOANO:
|
|
363
|
+
export const ENOANO: ErrnoObject = {
|
|
311
364
|
Error: () => 'no anode',
|
|
312
365
|
Is: (target: $.GoError) => target === ENOANO,
|
|
313
366
|
Errno: () => 55,
|
|
314
367
|
}
|
|
315
368
|
|
|
316
|
-
export const EBADRQC:
|
|
369
|
+
export const EBADRQC: ErrnoObject = {
|
|
317
370
|
Error: () => 'invalid request code',
|
|
318
371
|
Is: (target: $.GoError) => target === EBADRQC,
|
|
319
372
|
Errno: () => 56,
|
|
320
373
|
}
|
|
321
374
|
|
|
322
|
-
export const EBADSLT:
|
|
375
|
+
export const EBADSLT: ErrnoObject = {
|
|
323
376
|
Error: () => 'invalid slot',
|
|
324
377
|
Is: (target: $.GoError) => target === EBADSLT,
|
|
325
378
|
Errno: () => 57,
|
|
326
379
|
}
|
|
327
380
|
|
|
328
|
-
export const EDEADLOCK:
|
|
381
|
+
export const EDEADLOCK: ErrnoObject = EDEADLK // File locking deadlock error
|
|
329
382
|
|
|
330
|
-
export const EBFONT:
|
|
383
|
+
export const EBFONT: ErrnoObject = {
|
|
331
384
|
Error: () => 'bad font file fmt',
|
|
332
385
|
Is: (target: $.GoError) => target === EBFONT,
|
|
333
386
|
Errno: () => 59,
|
|
334
387
|
}
|
|
335
388
|
|
|
336
|
-
export const ENOSTR:
|
|
389
|
+
export const ENOSTR: ErrnoObject = {
|
|
337
390
|
Error: () => 'device not a stream',
|
|
338
391
|
Is: (target: $.GoError) => target === ENOSTR,
|
|
339
392
|
Errno: () => 60,
|
|
340
393
|
}
|
|
341
394
|
|
|
342
|
-
export const ENODATA:
|
|
395
|
+
export const ENODATA: ErrnoObject = {
|
|
343
396
|
Error: () => 'no data (for no delay io)',
|
|
344
397
|
Is: (target: $.GoError) => target === ENODATA,
|
|
345
398
|
Errno: () => 61,
|
|
346
399
|
}
|
|
347
400
|
|
|
348
|
-
export const ETIME:
|
|
401
|
+
export const ETIME: ErrnoObject = {
|
|
349
402
|
Error: () => 'timer expired',
|
|
350
403
|
Is: (target: $.GoError) => target === ETIME,
|
|
351
404
|
Errno: () => 62,
|
|
352
405
|
}
|
|
353
406
|
|
|
354
|
-
export const ENOSR:
|
|
407
|
+
export const ENOSR: ErrnoObject = {
|
|
355
408
|
Error: () => 'out of streams resources',
|
|
356
409
|
Is: (target: $.GoError) => target === ENOSR,
|
|
357
410
|
Errno: () => 63,
|
|
358
411
|
}
|
|
359
412
|
|
|
360
|
-
export const ENONET:
|
|
413
|
+
export const ENONET: ErrnoObject = {
|
|
361
414
|
Error: () => 'machine is not on the network',
|
|
362
415
|
Is: (target: $.GoError) => target === ENONET,
|
|
363
416
|
Errno: () => 64,
|
|
364
417
|
}
|
|
365
418
|
|
|
366
|
-
export const ENOPKG:
|
|
419
|
+
export const ENOPKG: ErrnoObject = {
|
|
367
420
|
Error: () => 'package not installed',
|
|
368
421
|
Is: (target: $.GoError) => target === ENOPKG,
|
|
369
422
|
Errno: () => 65,
|
|
370
423
|
}
|
|
371
424
|
|
|
372
|
-
export const EREMOTE:
|
|
425
|
+
export const EREMOTE: ErrnoObject = {
|
|
373
426
|
Error: () => 'the object is remote',
|
|
374
427
|
Is: (target: $.GoError) => target === EREMOTE,
|
|
375
428
|
Errno: () => 66,
|
|
376
429
|
}
|
|
377
430
|
|
|
378
|
-
export const ENOLINK:
|
|
431
|
+
export const ENOLINK: ErrnoObject = {
|
|
379
432
|
Error: () => 'the link has been severed',
|
|
380
433
|
Is: (target: $.GoError) => target === ENOLINK,
|
|
381
434
|
Errno: () => 67,
|
|
382
435
|
}
|
|
383
436
|
|
|
384
|
-
export const EADV:
|
|
437
|
+
export const EADV: ErrnoObject = {
|
|
385
438
|
Error: () => 'advertise error',
|
|
386
439
|
Is: (target: $.GoError) => target === EADV,
|
|
387
440
|
Errno: () => 68,
|
|
388
441
|
}
|
|
389
442
|
|
|
390
|
-
export const ESRMNT:
|
|
443
|
+
export const ESRMNT: ErrnoObject = {
|
|
391
444
|
Error: () => 'srmount error',
|
|
392
445
|
Is: (target: $.GoError) => target === ESRMNT,
|
|
393
446
|
Errno: () => 69,
|
|
394
447
|
}
|
|
395
448
|
|
|
396
|
-
export const ECOMM:
|
|
449
|
+
export const ECOMM: ErrnoObject = {
|
|
397
450
|
Error: () => 'communication error on send',
|
|
398
451
|
Is: (target: $.GoError) => target === ECOMM,
|
|
399
452
|
Errno: () => 70,
|
|
400
453
|
}
|
|
401
454
|
|
|
402
|
-
export const EPROTO:
|
|
455
|
+
export const EPROTO: ErrnoObject = {
|
|
403
456
|
Error: () => 'protocol error',
|
|
404
457
|
Is: (target: $.GoError) => target === EPROTO,
|
|
405
458
|
Errno: () => 71,
|
|
406
459
|
}
|
|
407
460
|
|
|
408
|
-
export const EMULTIHOP:
|
|
461
|
+
export const EMULTIHOP: ErrnoObject = {
|
|
409
462
|
Error: () => 'multihop attempted',
|
|
410
463
|
Is: (target: $.GoError) => target === EMULTIHOP,
|
|
411
464
|
Errno: () => 72,
|
|
412
465
|
}
|
|
413
466
|
|
|
414
|
-
export const EDOTDOT:
|
|
467
|
+
export const EDOTDOT: ErrnoObject = {
|
|
415
468
|
Error: () => 'cross mount point (not really error)',
|
|
416
469
|
Is: (target: $.GoError) => target === EDOTDOT,
|
|
417
470
|
Errno: () => 73,
|
|
418
471
|
}
|
|
419
472
|
|
|
420
|
-
export const EBADMSG:
|
|
473
|
+
export const EBADMSG: ErrnoObject = {
|
|
421
474
|
Error: () => 'trying to read unreadable message',
|
|
422
475
|
Is: (target: $.GoError) => target === EBADMSG,
|
|
423
476
|
Errno: () => 74,
|
|
424
477
|
}
|
|
425
478
|
|
|
426
|
-
export const EOVERFLOW:
|
|
479
|
+
export const EOVERFLOW: ErrnoObject = {
|
|
427
480
|
Error: () => 'value too large for defined data type',
|
|
428
481
|
Is: (target: $.GoError) => target === EOVERFLOW,
|
|
429
482
|
Errno: () => 75,
|
|
430
483
|
}
|
|
431
484
|
|
|
432
|
-
export const ENOTUNIQ:
|
|
485
|
+
export const ENOTUNIQ: ErrnoObject = {
|
|
433
486
|
Error: () => 'given log. name not unique',
|
|
434
487
|
Is: (target: $.GoError) => target === ENOTUNIQ,
|
|
435
488
|
Errno: () => 76,
|
|
436
489
|
}
|
|
437
490
|
|
|
438
|
-
export const EBADFD:
|
|
491
|
+
export const EBADFD: ErrnoObject = {
|
|
439
492
|
Error: () => 'f.d. invalid for this operation',
|
|
440
493
|
Is: (target: $.GoError) => target === EBADFD,
|
|
441
494
|
Errno: () => 77,
|
|
442
495
|
}
|
|
443
496
|
|
|
444
|
-
export const EREMCHG:
|
|
497
|
+
export const EREMCHG: ErrnoObject = {
|
|
445
498
|
Error: () => 'remote address changed',
|
|
446
499
|
Is: (target: $.GoError) => target === EREMCHG,
|
|
447
500
|
Errno: () => 78,
|
|
448
501
|
}
|
|
449
502
|
|
|
450
|
-
export const ELIBACC:
|
|
503
|
+
export const ELIBACC: ErrnoObject = {
|
|
451
504
|
Error: () => "can't access a needed shared lib",
|
|
452
505
|
Is: (target: $.GoError) => target === ELIBACC,
|
|
453
506
|
Errno: () => 79,
|
|
454
507
|
}
|
|
455
508
|
|
|
456
|
-
export const ELIBBAD:
|
|
509
|
+
export const ELIBBAD: ErrnoObject = {
|
|
457
510
|
Error: () => 'accessing a corrupted shared lib',
|
|
458
511
|
Is: (target: $.GoError) => target === ELIBBAD,
|
|
459
512
|
Errno: () => 80,
|
|
460
513
|
}
|
|
461
514
|
|
|
462
|
-
export const ELIBSCN:
|
|
515
|
+
export const ELIBSCN: ErrnoObject = {
|
|
463
516
|
Error: () => '.lib section in a.out corrupted',
|
|
464
517
|
Is: (target: $.GoError) => target === ELIBSCN,
|
|
465
518
|
Errno: () => 81,
|
|
466
519
|
}
|
|
467
520
|
|
|
468
|
-
export const ELIBMAX:
|
|
521
|
+
export const ELIBMAX: ErrnoObject = {
|
|
469
522
|
Error: () => 'attempting to link in too many libs',
|
|
470
523
|
Is: (target: $.GoError) => target === ELIBMAX,
|
|
471
524
|
Errno: () => 82,
|
|
472
525
|
}
|
|
473
526
|
|
|
474
|
-
export const ELIBEXEC:
|
|
527
|
+
export const ELIBEXEC: ErrnoObject = {
|
|
475
528
|
Error: () => 'attempting to exec a shared library',
|
|
476
529
|
Is: (target: $.GoError) => target === ELIBEXEC,
|
|
477
530
|
Errno: () => 83,
|
|
478
531
|
}
|
|
479
532
|
|
|
480
|
-
export const EILSEQ:
|
|
533
|
+
export const EILSEQ: ErrnoObject = {
|
|
481
534
|
Error: () => 'illegal byte sequence',
|
|
482
535
|
Is: (target: $.GoError) => target === EILSEQ,
|
|
483
536
|
Errno: () => 84,
|
|
484
537
|
}
|
|
485
538
|
|
|
486
|
-
export const EUSERS:
|
|
539
|
+
export const EUSERS: ErrnoObject = {
|
|
487
540
|
Error: () => 'too many users',
|
|
488
541
|
Is: (target: $.GoError) => target === EUSERS,
|
|
489
542
|
Errno: () => 87,
|
|
490
543
|
}
|
|
491
544
|
|
|
492
|
-
export const ENOTSOCK:
|
|
545
|
+
export const ENOTSOCK: ErrnoObject = {
|
|
493
546
|
Error: () => 'socket operation on non-socket',
|
|
494
547
|
Is: (target: $.GoError) => target === ENOTSOCK,
|
|
495
548
|
Errno: () => 88,
|
|
496
549
|
}
|
|
497
550
|
|
|
498
|
-
export const EDESTADDRREQ:
|
|
551
|
+
export const EDESTADDRREQ: ErrnoObject = {
|
|
499
552
|
Error: () => 'destination address required',
|
|
500
553
|
Is: (target: $.GoError) => target === EDESTADDRREQ,
|
|
501
554
|
Errno: () => 89,
|
|
502
555
|
}
|
|
503
556
|
|
|
504
|
-
export const EMSGSIZE:
|
|
557
|
+
export const EMSGSIZE: ErrnoObject = {
|
|
505
558
|
Error: () => 'message too long',
|
|
506
559
|
Is: (target: $.GoError) => target === EMSGSIZE,
|
|
507
560
|
Errno: () => 90,
|
|
508
561
|
}
|
|
509
562
|
|
|
510
|
-
export const EPROTOTYPE:
|
|
563
|
+
export const EPROTOTYPE: ErrnoObject = {
|
|
511
564
|
Error: () => 'protocol wrong type for socket',
|
|
512
565
|
Is: (target: $.GoError) => target === EPROTOTYPE,
|
|
513
566
|
Errno: () => 91,
|
|
514
567
|
}
|
|
515
568
|
|
|
516
|
-
export const ENOPROTOOPT:
|
|
569
|
+
export const ENOPROTOOPT: ErrnoObject = {
|
|
517
570
|
Error: () => 'protocol not available',
|
|
518
571
|
Is: (target: $.GoError) => target === ENOPROTOOPT,
|
|
519
572
|
Errno: () => 92,
|
|
520
573
|
}
|
|
521
574
|
|
|
522
|
-
export const EPROTONOSUPPORT:
|
|
575
|
+
export const EPROTONOSUPPORT: ErrnoObject = {
|
|
523
576
|
Error: () => 'unknown protocol',
|
|
524
577
|
Is: (target: $.GoError) => target === EPROTONOSUPPORT,
|
|
525
578
|
Errno: () => 93,
|
|
526
579
|
}
|
|
527
580
|
|
|
528
|
-
export const ESOCKTNOSUPPORT:
|
|
581
|
+
export const ESOCKTNOSUPPORT: ErrnoObject = {
|
|
529
582
|
Error: () => 'socket type not supported',
|
|
530
583
|
Is: (target: $.GoError) => target === ESOCKTNOSUPPORT,
|
|
531
584
|
Errno: () => 94,
|
|
532
585
|
}
|
|
533
586
|
|
|
534
|
-
export const EOPNOTSUPP:
|
|
587
|
+
export const EOPNOTSUPP: ErrnoObject = {
|
|
535
588
|
Error: () => 'operation not supported on transport endpoint',
|
|
536
589
|
Is: (target: $.GoError) => target === EOPNOTSUPP,
|
|
537
590
|
Errno: () => 95,
|
|
538
591
|
}
|
|
539
592
|
|
|
540
|
-
export const EPFNOSUPPORT:
|
|
593
|
+
export const EPFNOSUPPORT: ErrnoObject = {
|
|
541
594
|
Error: () => 'protocol family not supported',
|
|
542
595
|
Is: (target: $.GoError) => target === EPFNOSUPPORT,
|
|
543
596
|
Errno: () => 96,
|
|
544
597
|
}
|
|
545
598
|
|
|
546
|
-
export const EAFNOSUPPORT:
|
|
599
|
+
export const EAFNOSUPPORT: ErrnoObject = {
|
|
547
600
|
Error: () => 'address family not supported by protocol family',
|
|
548
601
|
Is: (target: $.GoError) => target === EAFNOSUPPORT,
|
|
549
602
|
Errno: () => 97,
|
|
550
603
|
}
|
|
551
604
|
|
|
552
|
-
export const EADDRINUSE:
|
|
605
|
+
export const EADDRINUSE: ErrnoObject = {
|
|
553
606
|
Error: () => 'address already in use',
|
|
554
607
|
Is: (target: $.GoError) => target === EADDRINUSE,
|
|
555
608
|
Errno: () => 98,
|
|
556
609
|
}
|
|
557
610
|
|
|
558
|
-
export const EADDRNOTAVAIL:
|
|
611
|
+
export const EADDRNOTAVAIL: ErrnoObject = {
|
|
559
612
|
Error: () => 'address not available',
|
|
560
613
|
Is: (target: $.GoError) => target === EADDRNOTAVAIL,
|
|
561
614
|
Errno: () => 99,
|
|
562
615
|
}
|
|
563
616
|
|
|
564
|
-
export const ENETDOWN:
|
|
617
|
+
export const ENETDOWN: ErrnoObject = {
|
|
565
618
|
Error: () => 'network interface is not configured',
|
|
566
619
|
Is: (target: $.GoError) => target === ENETDOWN,
|
|
567
620
|
Errno: () => 100,
|
|
568
621
|
}
|
|
569
622
|
|
|
570
|
-
export const ENETUNREACH:
|
|
623
|
+
export const ENETUNREACH: ErrnoObject = {
|
|
571
624
|
Error: () => 'network is unreachable',
|
|
572
625
|
Is: (target: $.GoError) => target === ENETUNREACH,
|
|
573
626
|
Errno: () => 101,
|
|
574
627
|
}
|
|
575
628
|
|
|
576
|
-
export const ENETRESET:
|
|
629
|
+
export const ENETRESET: ErrnoObject = {
|
|
577
630
|
Error: () => 'network dropped connection because of reset',
|
|
578
631
|
Is: (target: $.GoError) => target === ENETRESET,
|
|
579
632
|
Errno: () => 102,
|
|
580
633
|
}
|
|
581
634
|
|
|
582
|
-
export const ECONNABORTED:
|
|
635
|
+
export const ECONNABORTED: ErrnoObject = {
|
|
583
636
|
Error: () => 'connection aborted',
|
|
584
637
|
Is: (target: $.GoError) => target === ECONNABORTED,
|
|
585
638
|
Errno: () => 103,
|
|
586
639
|
}
|
|
587
640
|
|
|
588
|
-
export const ECONNRESET:
|
|
641
|
+
export const ECONNRESET: ErrnoObject = {
|
|
589
642
|
Error: () => 'connection reset by peer',
|
|
590
643
|
Is: (target: $.GoError) => target === ECONNRESET,
|
|
591
644
|
Errno: () => 104,
|
|
592
645
|
}
|
|
593
646
|
|
|
594
|
-
export const ENOBUFS:
|
|
647
|
+
export const ENOBUFS: ErrnoObject = {
|
|
595
648
|
Error: () => 'no buffer space available',
|
|
596
649
|
Is: (target: $.GoError) => target === ENOBUFS,
|
|
597
650
|
Errno: () => 105,
|
|
598
651
|
}
|
|
599
652
|
|
|
600
|
-
export const EISCONN:
|
|
653
|
+
export const EISCONN: ErrnoObject = {
|
|
601
654
|
Error: () => 'socket is already connected',
|
|
602
655
|
Is: (target: $.GoError) => target === EISCONN,
|
|
603
656
|
Errno: () => 106,
|
|
604
657
|
}
|
|
605
658
|
|
|
606
|
-
export const ENOTCONN:
|
|
659
|
+
export const ENOTCONN: ErrnoObject = {
|
|
607
660
|
Error: () => 'socket is not connected',
|
|
608
661
|
Is: (target: $.GoError) => target === ENOTCONN,
|
|
609
662
|
Errno: () => 107,
|
|
610
663
|
}
|
|
611
664
|
|
|
612
|
-
export const ESHUTDOWN:
|
|
665
|
+
export const ESHUTDOWN: ErrnoObject = {
|
|
613
666
|
Error: () => "can't send after socket shutdown",
|
|
614
667
|
Is: (target: $.GoError) => target === ESHUTDOWN,
|
|
615
668
|
Errno: () => 108,
|
|
616
669
|
}
|
|
617
670
|
|
|
618
|
-
export const ETOOMANYREFS:
|
|
671
|
+
export const ETOOMANYREFS: ErrnoObject = {
|
|
619
672
|
Error: () => 'too many references: cannot splice',
|
|
620
673
|
Is: (target: $.GoError) => target === ETOOMANYREFS,
|
|
621
674
|
Errno: () => 109,
|
|
622
675
|
}
|
|
623
676
|
|
|
624
|
-
export const ETIMEDOUT:
|
|
677
|
+
export const ETIMEDOUT: ErrnoObject = {
|
|
625
678
|
Error: () => 'connection timed out',
|
|
626
679
|
Is: (target: $.GoError) => target === ETIMEDOUT,
|
|
627
680
|
Errno: () => 110,
|
|
628
681
|
}
|
|
629
682
|
|
|
630
|
-
export const ECONNREFUSED:
|
|
683
|
+
export const ECONNREFUSED: ErrnoObject = {
|
|
631
684
|
Error: () => 'connection refused',
|
|
632
685
|
Is: (target: $.GoError) => target === ECONNREFUSED,
|
|
633
686
|
Errno: () => 111,
|
|
634
687
|
}
|
|
635
688
|
|
|
636
|
-
export const EHOSTDOWN:
|
|
689
|
+
export const EHOSTDOWN: ErrnoObject = {
|
|
637
690
|
Error: () => 'host is down',
|
|
638
691
|
Is: (target: $.GoError) => target === EHOSTDOWN,
|
|
639
692
|
Errno: () => 112,
|
|
640
693
|
}
|
|
641
694
|
|
|
642
|
-
export const EHOSTUNREACH:
|
|
695
|
+
export const EHOSTUNREACH: ErrnoObject = {
|
|
643
696
|
Error: () => 'host is unreachable',
|
|
644
697
|
Is: (target: $.GoError) => target === EHOSTUNREACH,
|
|
645
698
|
Errno: () => 113,
|
|
646
699
|
}
|
|
647
700
|
|
|
648
|
-
export const EALREADY:
|
|
701
|
+
export const EALREADY: ErrnoObject = {
|
|
649
702
|
Error: () => 'socket already connected',
|
|
650
703
|
Is: (target: $.GoError) => target === EALREADY,
|
|
651
704
|
Errno: () => 114,
|
|
652
705
|
}
|
|
653
706
|
|
|
654
|
-
export const EDQUOT:
|
|
707
|
+
export const EDQUOT: ErrnoObject = {
|
|
655
708
|
Error: () => 'quota exceeded',
|
|
656
709
|
Is: (target: $.GoError) => target === EDQUOT,
|
|
657
710
|
Errno: () => 122,
|