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.
Files changed (495) hide show
  1. package/README.md +267 -255
  2. package/cmd/goscript/cmd-test.go +286 -0
  3. package/cmd/goscript/cmd-test_test.go +76 -0
  4. package/cmd/goscript/cmd_compile.go +9 -0
  5. package/cmd/goscript/main.go +1 -0
  6. package/compiler/build-flags.go +38 -0
  7. package/compiler/compile-request.go +33 -0
  8. package/compiler/compiler.go +1 -1
  9. package/compiler/compliance_test.go +0 -10
  10. package/compiler/config.go +2 -0
  11. package/compiler/gotest/owner.go +24 -0
  12. package/compiler/gotest/package-result.go +69 -0
  13. package/compiler/gotest/request.go +210 -0
  14. package/compiler/gotest/result.go +28 -0
  15. package/compiler/gotest/runner.go +1225 -0
  16. package/compiler/gotest/runner_test.go +1271 -0
  17. package/compiler/gotest/test.go +9 -0
  18. package/compiler/index.test.ts +1 -1
  19. package/compiler/lowered-program.go +80 -21
  20. package/compiler/lowering.go +6754 -602
  21. package/compiler/override-facts.go +357 -0
  22. package/compiler/override-registry.go +52 -190
  23. package/compiler/override-registry_test.go +182 -0
  24. package/compiler/package-graph.go +50 -27
  25. package/compiler/package-graph_test.go +99 -9
  26. package/compiler/package-test-function.go +9 -0
  27. package/compiler/package-test-graph-package.go +40 -0
  28. package/compiler/package-test-graph-variant.go +129 -0
  29. package/compiler/package-test-graph.go +112 -0
  30. package/compiler/package-test-graph_test.go +202 -0
  31. package/compiler/runtime-contract.go +229 -29
  32. package/compiler/runtime-contract_test.go +44 -30
  33. package/compiler/semantic-model-types.go +25 -6
  34. package/compiler/semantic-model.go +819 -74
  35. package/compiler/semantic-model_test.go +104 -0
  36. package/compiler/service.go +10 -4
  37. package/compiler/skeleton_test.go +2777 -524
  38. package/compiler/tsworkspace/owner-process-unix_test.go +72 -0
  39. package/compiler/tsworkspace/owner.go +342 -0
  40. package/compiler/tsworkspace/owner_test.go +93 -0
  41. package/compiler/tsworkspace/result.go +17 -0
  42. package/compiler/tsworkspace/tool-process-other.go +14 -0
  43. package/compiler/tsworkspace/tool-process-unix.go +19 -0
  44. package/compiler/typescript-emitter.go +576 -86
  45. package/compiler/wasm/compile.go +1 -1
  46. package/compiler/wasm/compile_test.go +61 -11
  47. package/compiler/wasm_api.go +172 -7
  48. package/dist/gs/builtin/builtin.d.ts +40 -3
  49. package/dist/gs/builtin/builtin.js +430 -22
  50. package/dist/gs/builtin/builtin.js.map +1 -1
  51. package/dist/gs/builtin/channel.d.ts +32 -10
  52. package/dist/gs/builtin/channel.js +119 -25
  53. package/dist/gs/builtin/channel.js.map +1 -1
  54. package/dist/gs/builtin/defer.d.ts +1 -0
  55. package/dist/gs/builtin/defer.js +12 -2
  56. package/dist/gs/builtin/defer.js.map +1 -1
  57. package/dist/gs/builtin/hostio.d.ts +9 -0
  58. package/dist/gs/builtin/hostio.js +25 -0
  59. package/dist/gs/builtin/hostio.js.map +1 -1
  60. package/dist/gs/builtin/map.js +40 -6
  61. package/dist/gs/builtin/map.js.map +1 -1
  62. package/dist/gs/builtin/print.js.map +1 -1
  63. package/dist/gs/builtin/slice.d.ts +64 -10
  64. package/dist/gs/builtin/slice.js +619 -244
  65. package/dist/gs/builtin/slice.js.map +1 -1
  66. package/dist/gs/builtin/type.d.ts +7 -2
  67. package/dist/gs/builtin/type.js +128 -29
  68. package/dist/gs/builtin/type.js.map +1 -1
  69. package/dist/gs/builtin/varRef.d.ts +7 -0
  70. package/dist/gs/builtin/varRef.js +23 -0
  71. package/dist/gs/builtin/varRef.js.map +1 -1
  72. package/dist/gs/bytes/buffer.gs.js +74 -70
  73. package/dist/gs/bytes/buffer.gs.js.map +1 -1
  74. package/dist/gs/bytes/iter.gs.js +13 -13
  75. package/dist/gs/bytes/iter.gs.js.map +1 -1
  76. package/dist/gs/bytes/reader.gs.js +20 -18
  77. package/dist/gs/bytes/reader.gs.js.map +1 -1
  78. package/dist/gs/compress/zlib/index.d.ts +26 -0
  79. package/dist/gs/compress/zlib/index.js +168 -0
  80. package/dist/gs/compress/zlib/index.js.map +1 -0
  81. package/dist/gs/context/context.d.ts +6 -5
  82. package/dist/gs/context/context.js +17 -12
  83. package/dist/gs/context/context.js.map +1 -1
  84. package/dist/gs/crypto/ecdh/index.d.ts +52 -0
  85. package/dist/gs/crypto/ecdh/index.js +226 -0
  86. package/dist/gs/crypto/ecdh/index.js.map +1 -0
  87. package/dist/gs/crypto/ed25519/index.d.ts +34 -0
  88. package/dist/gs/crypto/ed25519/index.js +160 -0
  89. package/dist/gs/crypto/ed25519/index.js.map +1 -0
  90. package/dist/gs/crypto/internal/constanttime/index.d.ts +4 -0
  91. package/dist/gs/crypto/internal/constanttime/index.js +18 -0
  92. package/dist/gs/crypto/internal/constanttime/index.js.map +1 -0
  93. package/dist/gs/crypto/internal/fips140deps/byteorder/index.d.ts +1 -0
  94. package/dist/gs/crypto/internal/fips140deps/byteorder/index.js +2 -0
  95. package/dist/gs/crypto/internal/fips140deps/byteorder/index.js.map +1 -0
  96. package/dist/gs/crypto/internal/fips140deps/godebug/index.d.ts +1 -0
  97. package/dist/gs/crypto/internal/fips140deps/godebug/index.js +2 -0
  98. package/dist/gs/crypto/internal/fips140deps/godebug/index.js.map +1 -0
  99. package/dist/gs/crypto/rand/index.d.ts +2 -0
  100. package/dist/gs/crypto/rand/index.js +85 -0
  101. package/dist/gs/crypto/rand/index.js.map +1 -1
  102. package/dist/gs/crypto/sha256/index.d.ts +8 -0
  103. package/dist/gs/crypto/sha256/index.js +118 -0
  104. package/dist/gs/crypto/sha256/index.js.map +1 -0
  105. package/dist/gs/crypto/sha512/index.d.ts +14 -0
  106. package/dist/gs/crypto/sha512/index.js +129 -0
  107. package/dist/gs/crypto/sha512/index.js.map +1 -0
  108. package/dist/gs/embed/index.d.ts +7 -0
  109. package/dist/gs/embed/index.js +16 -0
  110. package/dist/gs/embed/index.js.map +1 -0
  111. package/dist/gs/encoding/json/index.d.ts +4 -0
  112. package/dist/gs/encoding/json/index.js +33 -0
  113. package/dist/gs/encoding/json/index.js.map +1 -1
  114. package/dist/gs/errors/errors.d.ts +4 -0
  115. package/dist/gs/errors/errors.js +108 -4
  116. package/dist/gs/errors/errors.js.map +1 -1
  117. package/dist/gs/fmt/fmt.d.ts +4 -4
  118. package/dist/gs/fmt/fmt.js +42 -11
  119. package/dist/gs/fmt/fmt.js.map +1 -1
  120. package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/index.d.ts +37 -2
  121. package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/index.js +245 -1
  122. package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/index.js.map +1 -1
  123. package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.d.ts +189 -0
  124. package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.js +861 -0
  125. package/dist/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.js.map +1 -0
  126. package/dist/gs/github.com/aperturerobotics/starpc/srpc/index.d.ts +217 -0
  127. package/dist/gs/github.com/aperturerobotics/starpc/srpc/index.js +814 -0
  128. package/dist/gs/github.com/aperturerobotics/starpc/srpc/index.js.map +1 -0
  129. package/dist/gs/github.com/aperturerobotics/util/conc/index.d.ts +20 -0
  130. package/dist/gs/github.com/aperturerobotics/util/conc/index.js +134 -0
  131. package/dist/gs/github.com/aperturerobotics/util/conc/index.js.map +1 -0
  132. package/dist/gs/github.com/aperturerobotics/wasivm/wazero/kernel/runtime/browser/browser.js.map +1 -1
  133. package/dist/gs/github.com/hack-pad/safejs/internal/catch/index.d.ts +3 -0
  134. package/dist/gs/github.com/hack-pad/safejs/internal/catch/index.js +50 -0
  135. package/dist/gs/github.com/hack-pad/safejs/internal/catch/index.js.map +1 -0
  136. package/dist/gs/github.com/klauspost/compress/internal/le/index.d.ts +9 -0
  137. package/dist/gs/github.com/klauspost/compress/internal/le/index.js +72 -0
  138. package/dist/gs/github.com/klauspost/compress/internal/le/index.js.map +1 -0
  139. package/dist/gs/github.com/mr-tron/base58/base58/index.d.ts +27 -0
  140. package/dist/gs/github.com/mr-tron/base58/base58/index.js +172 -0
  141. package/dist/gs/github.com/mr-tron/base58/base58/index.js.map +1 -0
  142. package/dist/gs/github.com/zeebo/blake3/internal/consts/index.d.ts +21 -0
  143. package/dist/gs/github.com/zeebo/blake3/internal/consts/index.js +22 -0
  144. package/dist/gs/github.com/zeebo/blake3/internal/consts/index.js.map +1 -0
  145. package/dist/gs/go/internal/scannerhooks/index.d.ts +3 -0
  146. package/dist/gs/go/internal/scannerhooks/index.js +5 -0
  147. package/dist/gs/go/internal/scannerhooks/index.js.map +1 -0
  148. package/dist/gs/go/scanner/index.d.ts +13 -0
  149. package/dist/gs/go/scanner/index.js +35 -0
  150. package/dist/gs/go/scanner/index.js.map +1 -1
  151. package/dist/gs/go/token/index.d.ts +156 -0
  152. package/dist/gs/go/token/index.js +507 -4
  153. package/dist/gs/go/token/index.js.map +1 -1
  154. package/dist/gs/hash/fnv/index.d.ts +57 -0
  155. package/dist/gs/hash/fnv/index.js +299 -0
  156. package/dist/gs/hash/fnv/index.js.map +1 -0
  157. package/dist/gs/hash/index.d.ts +17 -0
  158. package/dist/gs/hash/index.js +94 -0
  159. package/dist/gs/hash/index.js.map +1 -0
  160. package/dist/gs/internal/abi/index.d.ts +4 -0
  161. package/dist/gs/internal/abi/index.js +10 -0
  162. package/dist/gs/internal/abi/index.js.map +1 -1
  163. package/dist/gs/internal/bytealg/index.d.ts +2 -0
  164. package/dist/gs/internal/bytealg/index.js +14 -0
  165. package/dist/gs/internal/bytealg/index.js.map +1 -1
  166. package/dist/gs/internal/byteorder/index.d.ts +8 -2
  167. package/dist/gs/internal/byteorder/index.js +56 -25
  168. package/dist/gs/internal/byteorder/index.js.map +1 -1
  169. package/dist/gs/internal/godebug/index.d.ts +12 -0
  170. package/dist/gs/internal/godebug/index.js +30 -0
  171. package/dist/gs/internal/godebug/index.js.map +1 -0
  172. package/dist/gs/io/fs/index.d.ts +1 -0
  173. package/dist/gs/io/fs/index.js +1 -0
  174. package/dist/gs/io/fs/index.js.map +1 -1
  175. package/dist/gs/io/fs/readlink.d.ts +8 -0
  176. package/dist/gs/io/fs/readlink.js +60 -0
  177. package/dist/gs/io/fs/readlink.js.map +1 -0
  178. package/dist/gs/io/fs/walk.d.ts +3 -3
  179. package/dist/gs/io/fs/walk.js +7 -7
  180. package/dist/gs/io/fs/walk.js.map +1 -1
  181. package/dist/gs/io/io.d.ts +40 -6
  182. package/dist/gs/io/io.js +151 -26
  183. package/dist/gs/io/io.js.map +1 -1
  184. package/dist/gs/iter/iter.d.ts +3 -2
  185. package/dist/gs/iter/iter.js.map +1 -1
  186. package/dist/gs/maps/iter.d.ts +5 -5
  187. package/dist/gs/maps/iter.js +48 -21
  188. package/dist/gs/maps/iter.js.map +1 -1
  189. package/dist/gs/maps/maps.d.ts +6 -6
  190. package/dist/gs/maps/maps.js +1 -1
  191. package/dist/gs/maps/maps.js.map +1 -1
  192. package/dist/gs/math/bits/index.d.ts +13 -4
  193. package/dist/gs/math/bits/index.js +70 -48
  194. package/dist/gs/math/bits/index.js.map +1 -1
  195. package/dist/gs/math/const.gs.d.ts +5 -5
  196. package/dist/gs/math/const.gs.js +4 -4
  197. package/dist/gs/math/const.gs.js.map +1 -1
  198. package/dist/gs/mime/index.d.ts +1 -0
  199. package/dist/gs/mime/index.js +52 -0
  200. package/dist/gs/mime/index.js.map +1 -0
  201. package/dist/gs/net/http/httptest/index.d.ts +30 -0
  202. package/dist/gs/net/http/httptest/index.js +101 -0
  203. package/dist/gs/net/http/httptest/index.js.map +1 -0
  204. package/dist/gs/net/http/index.d.ts +131 -0
  205. package/dist/gs/net/http/index.js +307 -0
  206. package/dist/gs/net/http/index.js.map +1 -0
  207. package/dist/gs/net/http/pprof/index.d.ts +8 -0
  208. package/dist/gs/net/http/pprof/index.js +59 -0
  209. package/dist/gs/net/http/pprof/index.js.map +1 -0
  210. package/dist/gs/os/dir_unix.gs.js +2 -2
  211. package/dist/gs/os/dir_unix.gs.js.map +1 -1
  212. package/dist/gs/os/error.gs.js +9 -7
  213. package/dist/gs/os/error.gs.js.map +1 -1
  214. package/dist/gs/os/types_js.gs.js +95 -15
  215. package/dist/gs/os/types_js.gs.js.map +1 -1
  216. package/dist/gs/path/filepath/match.js +165 -3
  217. package/dist/gs/path/filepath/match.js.map +1 -1
  218. package/dist/gs/path/filepath/path.d.ts +8 -4
  219. package/dist/gs/path/filepath/path.js +192 -8
  220. package/dist/gs/path/filepath/path.js.map +1 -1
  221. package/dist/gs/path/path.d.ts +4 -1
  222. package/dist/gs/path/path.js +16 -4
  223. package/dist/gs/path/path.js.map +1 -1
  224. package/dist/gs/reflect/index.d.ts +4 -3
  225. package/dist/gs/reflect/index.js +3 -2
  226. package/dist/gs/reflect/index.js.map +1 -1
  227. package/dist/gs/reflect/iter.js +2 -2
  228. package/dist/gs/reflect/iter.js.map +1 -1
  229. package/dist/gs/reflect/map.js +29 -0
  230. package/dist/gs/reflect/map.js.map +1 -1
  231. package/dist/gs/reflect/type.d.ts +31 -9
  232. package/dist/gs/reflect/type.js +536 -43
  233. package/dist/gs/reflect/type.js.map +1 -1
  234. package/dist/gs/reflect/types.d.ts +1 -0
  235. package/dist/gs/reflect/types.js +3 -1
  236. package/dist/gs/reflect/types.js.map +1 -1
  237. package/dist/gs/reflect/value.d.ts +4 -1
  238. package/dist/gs/reflect/value.js +39 -1
  239. package/dist/gs/reflect/value.js.map +1 -1
  240. package/dist/gs/reflect/visiblefields.js +1 -1
  241. package/dist/gs/reflect/visiblefields.js.map +1 -1
  242. package/dist/gs/runtime/debug/index.d.ts +41 -0
  243. package/dist/gs/runtime/debug/index.js +66 -0
  244. package/dist/gs/runtime/debug/index.js.map +1 -0
  245. package/dist/gs/runtime/pprof/index.d.ts +20 -0
  246. package/dist/gs/runtime/pprof/index.js +85 -0
  247. package/dist/gs/runtime/pprof/index.js.map +1 -0
  248. package/dist/gs/runtime/runtime.d.ts +35 -3
  249. package/dist/gs/runtime/runtime.js +72 -0
  250. package/dist/gs/runtime/runtime.js.map +1 -1
  251. package/dist/gs/runtime/trace/index.d.ts +19 -0
  252. package/dist/gs/runtime/trace/index.js +64 -0
  253. package/dist/gs/runtime/trace/index.js.map +1 -0
  254. package/dist/gs/slices/slices.d.ts +42 -8
  255. package/dist/gs/slices/slices.js +425 -11
  256. package/dist/gs/slices/slices.js.map +1 -1
  257. package/dist/gs/sort/slice.gs.d.ts +5 -3
  258. package/dist/gs/sort/slice.gs.js +60 -22
  259. package/dist/gs/sort/slice.gs.js.map +1 -1
  260. package/dist/gs/sort/sort.gs.d.ts +4 -4
  261. package/dist/gs/sort/sort.gs.js +11 -8
  262. package/dist/gs/sort/sort.gs.js.map +1 -1
  263. package/dist/gs/strings/builder.d.ts +1 -1
  264. package/dist/gs/strings/builder.js +29 -19
  265. package/dist/gs/strings/builder.js.map +1 -1
  266. package/dist/gs/strings/iter.js +140 -75
  267. package/dist/gs/strings/iter.js.map +1 -1
  268. package/dist/gs/strings/replace.js +2 -2
  269. package/dist/gs/strings/replace.js.map +1 -1
  270. package/dist/gs/strings/strings.js +52 -6
  271. package/dist/gs/strings/strings.js.map +1 -1
  272. package/dist/gs/sync/atomic/type.gs.d.ts +9 -8
  273. package/dist/gs/sync/atomic/type.gs.js +0 -2
  274. package/dist/gs/sync/atomic/type.gs.js.map +1 -1
  275. package/dist/gs/sync/sync.d.ts +8 -3
  276. package/dist/gs/sync/sync.js +66 -11
  277. package/dist/gs/sync/sync.js.map +1 -1
  278. package/dist/gs/syscall/constants.d.ts +36 -24
  279. package/dist/gs/syscall/constants.js +12 -0
  280. package/dist/gs/syscall/constants.js.map +1 -1
  281. package/dist/gs/syscall/errors.d.ts +117 -111
  282. package/dist/gs/syscall/errors.js +45 -0
  283. package/dist/gs/syscall/errors.js.map +1 -1
  284. package/dist/gs/syscall/fs.d.ts +37 -0
  285. package/dist/gs/syscall/fs.js +102 -0
  286. package/dist/gs/syscall/fs.js.map +1 -1
  287. package/dist/gs/syscall/js/index.d.ts +90 -0
  288. package/dist/gs/syscall/js/index.js +383 -0
  289. package/dist/gs/syscall/js/index.js.map +1 -0
  290. package/dist/gs/syscall/types.d.ts +26 -1
  291. package/dist/gs/syscall/types.js +45 -1
  292. package/dist/gs/syscall/types.js.map +1 -1
  293. package/dist/gs/testing/index.d.ts +1 -0
  294. package/dist/gs/testing/index.js +2 -0
  295. package/dist/gs/testing/index.js.map +1 -0
  296. package/dist/gs/testing/testing.d.ts +78 -0
  297. package/dist/gs/testing/testing.js +318 -0
  298. package/dist/gs/testing/testing.js.map +1 -0
  299. package/dist/gs/time/time.d.ts +41 -4
  300. package/dist/gs/time/time.js +227 -36
  301. package/dist/gs/time/time.js.map +1 -1
  302. package/dist/gs/unicode/unicode.d.ts +23 -1
  303. package/dist/gs/unicode/unicode.js +79 -10
  304. package/dist/gs/unicode/unicode.js.map +1 -1
  305. package/dist/gs/unicode/utf8/utf8.d.ts +4 -4
  306. package/dist/gs/unicode/utf8/utf8.js +24 -11
  307. package/dist/gs/unicode/utf8/utf8.js.map +1 -1
  308. package/dist/gs/unique/index.d.ts +11 -0
  309. package/dist/gs/unique/index.js +76 -0
  310. package/dist/gs/unique/index.js.map +1 -0
  311. package/go.mod +8 -8
  312. package/go.sum +14 -14
  313. package/gs/builtin/builtin.ts +585 -27
  314. package/gs/builtin/channel.ts +183 -29
  315. package/gs/builtin/defer.ts +13 -2
  316. package/gs/builtin/hostio.test.ts +1 -0
  317. package/gs/builtin/hostio.ts +38 -0
  318. package/gs/builtin/map.ts +46 -6
  319. package/gs/builtin/print.ts +12 -3
  320. package/gs/builtin/runtime-contract.test.ts +383 -10
  321. package/gs/builtin/slice.test.ts +70 -0
  322. package/gs/builtin/slice.ts +785 -265
  323. package/gs/builtin/type.ts +160 -41
  324. package/gs/builtin/varRef.ts +40 -1
  325. package/gs/bytes/buffer.gs.ts +74 -70
  326. package/gs/bytes/iter.gs.ts +13 -14
  327. package/gs/bytes/meta.json +8 -3
  328. package/gs/bytes/reader.gs.ts +20 -19
  329. package/gs/compress/zlib/index.test.ts +28 -0
  330. package/gs/compress/zlib/index.ts +200 -0
  331. package/gs/compress/zlib/meta.json +3 -0
  332. package/gs/context/context.test.ts +71 -0
  333. package/gs/context/context.ts +30 -29
  334. package/gs/crypto/ecdh/index.test.ts +43 -0
  335. package/gs/crypto/ecdh/index.ts +274 -0
  336. package/gs/crypto/ed25519/index.test.ts +41 -0
  337. package/gs/crypto/ed25519/index.ts +238 -0
  338. package/gs/crypto/ed25519/meta.json +13 -0
  339. package/gs/crypto/internal/constanttime/index.test.ts +25 -0
  340. package/gs/crypto/internal/constanttime/index.ts +22 -0
  341. package/gs/crypto/internal/fips140deps/byteorder/index.ts +1 -0
  342. package/gs/crypto/internal/fips140deps/godebug/index.ts +1 -0
  343. package/gs/crypto/rand/index.test.ts +89 -1
  344. package/gs/crypto/rand/index.ts +103 -1
  345. package/gs/crypto/rand/meta.json +4 -1
  346. package/gs/crypto/sha256/index.test.ts +78 -0
  347. package/gs/crypto/sha256/index.ts +150 -0
  348. package/gs/crypto/sha256/meta.json +9 -0
  349. package/gs/crypto/sha512/index.test.ts +31 -0
  350. package/gs/crypto/sha512/index.ts +161 -0
  351. package/gs/crypto/sha512/meta.json +11 -0
  352. package/gs/embed/index.ts +20 -0
  353. package/gs/embed/meta.json +5 -0
  354. package/gs/encoding/json/index.test.ts +39 -3
  355. package/gs/encoding/json/index.ts +45 -3
  356. package/gs/errors/errors.test.ts +85 -0
  357. package/gs/errors/errors.ts +132 -4
  358. package/gs/fmt/fmt.test.ts +3 -1
  359. package/gs/fmt/fmt.ts +55 -19
  360. package/gs/github.com/aperturerobotics/protobuf-go-lite/index.test.ts +128 -1
  361. package/gs/github.com/aperturerobotics/protobuf-go-lite/index.ts +342 -4
  362. package/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.test.ts +180 -0
  363. package/gs/github.com/aperturerobotics/protobuf-go-lite/json/index.ts +1084 -0
  364. package/gs/github.com/aperturerobotics/starpc/srpc/index.test.ts +31 -0
  365. package/gs/github.com/aperturerobotics/starpc/srpc/index.ts +1233 -0
  366. package/gs/github.com/aperturerobotics/starpc/srpc/meta.json +46 -0
  367. package/gs/github.com/aperturerobotics/util/conc/index.test.ts +30 -0
  368. package/gs/github.com/aperturerobotics/util/conc/index.ts +172 -0
  369. package/gs/github.com/aperturerobotics/util/conc/meta.json +9 -0
  370. package/gs/github.com/aperturerobotics/wasivm/wazero/kernel/runtime/browser/browser.ts +1 -4
  371. package/gs/github.com/hack-pad/safejs/internal/catch/index.test.ts +35 -0
  372. package/gs/github.com/hack-pad/safejs/internal/catch/index.ts +65 -0
  373. package/gs/github.com/hack-pad/safejs/internal/catch/meta.json +9 -0
  374. package/gs/github.com/klauspost/compress/internal/le/index.test.ts +37 -0
  375. package/gs/github.com/klauspost/compress/internal/le/index.ts +115 -0
  376. package/gs/github.com/mr-tron/base58/base58/index.test.ts +70 -0
  377. package/gs/github.com/mr-tron/base58/base58/index.ts +231 -0
  378. package/gs/github.com/mr-tron/base58/base58/meta.json +3 -0
  379. package/gs/github.com/zeebo/blake3/internal/consts/index.test.ts +46 -0
  380. package/gs/github.com/zeebo/blake3/internal/consts/index.ts +26 -0
  381. package/gs/go/internal/scannerhooks/index.test.ts +14 -0
  382. package/gs/go/internal/scannerhooks/index.ts +9 -0
  383. package/gs/go/scanner/index.test.ts +22 -0
  384. package/gs/go/scanner/index.ts +47 -0
  385. package/gs/go/token/index.test.ts +47 -1
  386. package/gs/go/token/index.ts +583 -4
  387. package/gs/hash/fnv/index.test.ts +67 -0
  388. package/gs/hash/fnv/index.ts +351 -0
  389. package/gs/hash/fnv/meta.json +3 -0
  390. package/gs/hash/index.test.ts +37 -0
  391. package/gs/hash/index.ts +118 -0
  392. package/gs/hash/meta.json +5 -0
  393. package/gs/internal/abi/index.test.ts +18 -0
  394. package/gs/internal/abi/index.ts +14 -0
  395. package/gs/internal/bytealg/index.test.ts +18 -0
  396. package/gs/internal/bytealg/index.ts +16 -0
  397. package/gs/internal/byteorder/index.test.ts +39 -0
  398. package/gs/internal/byteorder/index.ts +100 -27
  399. package/gs/internal/godebug/index.test.ts +16 -0
  400. package/gs/internal/godebug/index.ts +35 -0
  401. package/gs/io/fs/index.ts +1 -0
  402. package/gs/io/fs/meta.json +5 -0
  403. package/gs/io/fs/readlink.test.ts +43 -0
  404. package/gs/io/fs/readlink.ts +69 -0
  405. package/gs/io/fs/walk.test.ts +61 -0
  406. package/gs/io/fs/walk.ts +17 -9
  407. package/gs/io/io.ts +177 -31
  408. package/gs/io/meta.json +10 -2
  409. package/gs/iter/iter.ts +8 -2
  410. package/gs/maps/iter.ts +75 -26
  411. package/gs/maps/maps.test.ts +23 -0
  412. package/gs/maps/maps.ts +13 -11
  413. package/gs/math/bits/index.test.ts +20 -0
  414. package/gs/math/bits/index.ts +107 -64
  415. package/gs/math/const.gs.test.ts +11 -5
  416. package/gs/math/const.gs.ts +5 -6
  417. package/gs/mime/index.ts +60 -0
  418. package/gs/net/http/httptest/index.test.ts +53 -0
  419. package/gs/net/http/httptest/index.ts +120 -0
  420. package/gs/net/http/index.test.ts +148 -0
  421. package/gs/net/http/index.ts +432 -0
  422. package/gs/net/http/meta.json +6 -0
  423. package/gs/net/http/pprof/index.test.ts +47 -0
  424. package/gs/net/http/pprof/index.ts +65 -0
  425. package/gs/os/dir_unix.gs.ts +2 -3
  426. package/gs/os/error.gs.ts +9 -10
  427. package/gs/os/error.test.ts +41 -0
  428. package/gs/os/file_unix_js.test.ts +55 -0
  429. package/gs/os/tempfile.gs.test.ts +37 -10
  430. package/gs/os/types_js.gs.ts +96 -17
  431. package/gs/path/filepath/match.test.ts +31 -12
  432. package/gs/path/filepath/match.ts +181 -3
  433. package/gs/path/filepath/meta.json +6 -0
  434. package/gs/path/filepath/path.test.ts +80 -0
  435. package/gs/path/filepath/path.ts +244 -11
  436. package/gs/path/path.ts +20 -5
  437. package/gs/reflect/field.test.ts +63 -0
  438. package/gs/reflect/index.ts +5 -1
  439. package/gs/reflect/iter.ts +2 -2
  440. package/gs/reflect/map.test.ts +42 -1
  441. package/gs/reflect/map.ts +39 -0
  442. package/gs/reflect/type.ts +728 -65
  443. package/gs/reflect/typefor.test.ts +100 -0
  444. package/gs/reflect/types.ts +3 -1
  445. package/gs/reflect/value.ts +50 -1
  446. package/gs/reflect/visiblefields.ts +1 -1
  447. package/gs/runtime/debug/index.test.ts +45 -0
  448. package/gs/runtime/debug/index.ts +96 -0
  449. package/gs/runtime/pprof/index.test.ts +36 -0
  450. package/gs/runtime/pprof/index.ts +104 -0
  451. package/gs/runtime/pprof/meta.json +6 -0
  452. package/gs/runtime/runtime.test.ts +19 -0
  453. package/gs/runtime/runtime.ts +98 -3
  454. package/gs/runtime/trace/index.test.ts +45 -0
  455. package/gs/runtime/trace/index.ts +97 -0
  456. package/gs/runtime/trace/meta.json +7 -0
  457. package/gs/slices/meta.json +2 -1
  458. package/gs/slices/slices.test.ts +180 -0
  459. package/gs/slices/slices.ts +502 -15
  460. package/gs/sort/meta.json +7 -0
  461. package/gs/sort/slice.gs.ts +85 -26
  462. package/gs/sort/slice.test.ts +40 -0
  463. package/gs/sort/sort.gs.ts +16 -13
  464. package/gs/strings/builder.test.ts +8 -0
  465. package/gs/strings/builder.ts +33 -20
  466. package/gs/strings/iter.test.ts +5 -7
  467. package/gs/strings/iter.ts +146 -71
  468. package/gs/strings/replace.test.ts +1 -4
  469. package/gs/strings/replace.ts +6 -6
  470. package/gs/strings/strings.test.ts +4 -0
  471. package/gs/strings/strings.ts +54 -6
  472. package/gs/sync/atomic/type.gs.ts +13 -14
  473. package/gs/sync/meta.json +3 -1
  474. package/gs/sync/sync.test.ts +69 -1
  475. package/gs/sync/sync.ts +72 -13
  476. package/gs/syscall/constants.ts +39 -24
  477. package/gs/syscall/errors.ts +165 -112
  478. package/gs/syscall/fs.ts +195 -0
  479. package/gs/syscall/js/index.ts +485 -0
  480. package/gs/syscall/js/meta.json +4 -0
  481. package/gs/syscall/net.test.ts +111 -0
  482. package/gs/syscall/types.ts +63 -2
  483. package/gs/testing/index.ts +1 -0
  484. package/gs/testing/meta.json +5 -0
  485. package/gs/testing/testing.test.ts +146 -0
  486. package/gs/testing/testing.ts +399 -0
  487. package/gs/time/meta.json +2 -2
  488. package/gs/time/time.test.ts +110 -0
  489. package/gs/time/time.ts +309 -57
  490. package/gs/unicode/unicode.test.ts +36 -0
  491. package/gs/unicode/unicode.ts +115 -9
  492. package/gs/unicode/utf8/utf8.test.ts +13 -0
  493. package/gs/unicode/utf8/utf8.ts +28 -16
  494. package/gs/unique/index.ts +98 -0
  495. package/package.json +3 -2
@@ -1,657 +1,710 @@
1
1
  import * as $ from '@goscript/builtin/index.js'
2
- import { Errno } from './types.js'
3
-
4
- export const EPERM: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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 ENOTEMPTY: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = EDEADLK // File locking deadlock error
381
+ export const EDEADLOCK: ErrnoObject = EDEADLK // File locking deadlock error
329
382
 
330
- export const EBFONT: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
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: Errno = {
707
+ export const EDQUOT: ErrnoObject = {
655
708
  Error: () => 'quota exceeded',
656
709
  Is: (target: $.GoError) => target === EDQUOT,
657
710
  Errno: () => 122,