goscript 0.0.39 → 0.0.41
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/compiler/analysis.go +15 -6
- package/compiler/compiler.go +185 -35
- package/compiler/expr-call.go +7 -9
- package/compiler/expr-type.go +25 -0
- package/compiler/field.go +21 -7
- package/compiler/gs_dependencies_test.go +80 -0
- package/compiler/lit.go +1 -6
- package/compiler/output.go +10 -4
- package/compiler/spec.go +16 -3
- package/compiler/type-assert.go +111 -21
- package/compiler/type.go +56 -12
- package/dist/gs/builtin/builtin.d.ts +20 -8
- package/dist/gs/builtin/builtin.js +30 -53
- package/dist/gs/builtin/builtin.js.map +1 -1
- package/dist/gs/builtin/errors.d.ts +8 -0
- package/dist/gs/builtin/errors.js +18 -0
- package/dist/gs/builtin/errors.js.map +1 -0
- package/dist/gs/builtin/index.d.ts +7 -0
- package/dist/gs/builtin/index.js +7 -0
- package/dist/gs/builtin/index.js.map +1 -1
- package/dist/gs/builtin/slice.d.ts +5 -2
- package/dist/gs/builtin/slice.js +123 -77
- package/dist/gs/builtin/slice.js.map +1 -1
- package/dist/gs/bytes/buffer.gs.d.ts +1 -1
- package/dist/gs/bytes/buffer.gs.js +1 -1
- package/dist/gs/bytes/buffer.gs.js.map +1 -1
- package/dist/gs/bytes/bytes.gs.d.ts +1 -1
- package/dist/gs/bytes/bytes.gs.js +111 -15
- package/dist/gs/bytes/bytes.gs.js.map +1 -1
- package/dist/gs/bytes/iter.gs.d.ts +1 -1
- package/dist/gs/bytes/iter.gs.js +1 -1
- package/dist/gs/bytes/iter.gs.js.map +1 -1
- package/dist/gs/bytes/reader.gs.d.ts +1 -1
- package/dist/gs/bytes/reader.gs.js +1 -1
- package/dist/gs/bytes/reader.gs.js.map +1 -1
- package/dist/gs/context/context.d.ts +1 -1
- package/dist/gs/context/context.js +1 -1
- package/dist/gs/context/context.js.map +1 -1
- package/dist/gs/errors/errors.d.ts +1 -1
- package/dist/gs/errors/errors.js +3 -15
- package/dist/gs/errors/errors.js.map +1 -1
- package/dist/gs/fmt/fmt.d.ts +49 -0
- package/dist/gs/fmt/fmt.js +322 -0
- package/dist/gs/fmt/fmt.js.map +1 -0
- package/dist/gs/fmt/index.d.ts +1 -0
- package/dist/gs/fmt/index.js +2 -0
- package/dist/gs/fmt/index.js.map +1 -0
- package/dist/gs/github.com/pkg/errors/errors.d.ts +1 -1
- package/dist/gs/github.com/pkg/errors/errors.js +1 -1
- package/dist/gs/github.com/pkg/errors/errors.js.map +1 -1
- package/dist/gs/github.com/pkg/errors/go113.d.ts +1 -1
- package/dist/gs/github.com/pkg/errors/go113.js +1 -1
- package/dist/gs/github.com/pkg/errors/go113.js.map +1 -1
- package/dist/gs/github.com/pkg/errors/stack.d.ts +1 -1
- package/dist/gs/github.com/pkg/errors/stack.js +1 -1
- package/dist/gs/github.com/pkg/errors/stack.js.map +1 -1
- package/dist/gs/internal/byteorder/index.d.ts +1 -1
- package/dist/gs/internal/byteorder/index.js +1 -1
- package/dist/gs/internal/byteorder/index.js.map +1 -1
- package/dist/gs/internal/oserror/errors.d.ts +1 -1
- package/dist/gs/io/fs/format.js +1 -1
- package/dist/gs/io/fs/format.js.map +1 -1
- package/dist/gs/io/fs/fs.d.ts +1 -1
- package/dist/gs/io/fs/fs.js +1 -1
- package/dist/gs/io/fs/fs.js.map +1 -1
- package/dist/gs/io/fs/glob.d.ts +1 -1
- package/dist/gs/io/fs/glob.js +1 -1
- package/dist/gs/io/fs/glob.js.map +1 -1
- package/dist/gs/io/fs/readdir.d.ts +1 -1
- package/dist/gs/io/fs/readdir.js +1 -1
- package/dist/gs/io/fs/readdir.js.map +1 -1
- package/dist/gs/io/fs/readfile.d.ts +1 -1
- package/dist/gs/io/fs/readfile.js +1 -1
- package/dist/gs/io/fs/readfile.js.map +1 -1
- package/dist/gs/io/fs/stat.d.ts +1 -1
- package/dist/gs/io/fs/stat.js +1 -1
- package/dist/gs/io/fs/stat.js.map +1 -1
- package/dist/gs/io/fs/sub.d.ts +1 -1
- package/dist/gs/io/fs/sub.js +1 -1
- package/dist/gs/io/fs/sub.js.map +1 -1
- package/dist/gs/io/fs/walk.d.ts +1 -1
- package/dist/gs/io/fs/walk.js +1 -1
- package/dist/gs/io/fs/walk.js.map +1 -1
- package/dist/gs/io/io.d.ts +1 -1
- package/dist/gs/maps/iter.d.ts +1 -1
- package/dist/gs/maps/iter.js +1 -1
- package/dist/gs/maps/iter.js.map +1 -1
- package/dist/gs/maps/maps.d.ts +1 -1
- package/dist/gs/maps/maps.js +1 -1
- package/dist/gs/maps/maps.js.map +1 -1
- package/dist/gs/math/erfinv.gs.js +1 -1
- package/dist/gs/math/erfinv.gs.js.map +1 -1
- package/dist/gs/math/gamma.gs.js +1 -1
- package/dist/gs/math/gamma.gs.js.map +1 -1
- package/dist/gs/math/j0.gs.js +1 -1
- package/dist/gs/math/j0.gs.js.map +1 -1
- package/dist/gs/math/j1.gs.js +1 -1
- package/dist/gs/math/j1.gs.js.map +1 -1
- package/dist/gs/math/lgamma.gs.js +1 -1
- package/dist/gs/math/lgamma.gs.js.map +1 -1
- package/dist/gs/math/pow10.gs.js +1 -1
- package/dist/gs/math/pow10.gs.js.map +1 -1
- package/dist/gs/math/sin.gs.js +1 -1
- package/dist/gs/math/sin.gs.js.map +1 -1
- package/dist/gs/math/tan.gs.js +1 -1
- package/dist/gs/math/tan.gs.js.map +1 -1
- package/dist/gs/math/tanh.gs.js +1 -1
- package/dist/gs/math/tanh.gs.js.map +1 -1
- package/dist/gs/math/trig_reduce.gs.js +1 -1
- package/dist/gs/math/trig_reduce.gs.js.map +1 -1
- package/dist/gs/os/dir.gs.d.ts +1 -1
- package/dist/gs/os/dir_unix.gs.d.ts +1 -1
- package/dist/gs/os/dir_unix.gs.js +1 -1
- package/dist/gs/os/dir_unix.gs.js.map +1 -1
- package/dist/gs/os/dirent_js.gs.d.ts +1 -1
- package/dist/gs/os/env.gs.d.ts +1 -1
- package/dist/gs/os/env.gs.js +1 -1
- package/dist/gs/os/env.gs.js.map +1 -1
- package/dist/gs/os/error.gs.d.ts +1 -1
- package/dist/gs/os/error.gs.js +1 -1
- package/dist/gs/os/error.gs.js.map +1 -1
- package/dist/gs/os/exec.gs.d.ts +1 -1
- package/dist/gs/os/exec.gs.js +1 -1
- package/dist/gs/os/exec.gs.js.map +1 -1
- package/dist/gs/os/exec_posix.gs.d.ts +1 -1
- package/dist/gs/os/exec_posix.gs.js +1 -1
- package/dist/gs/os/exec_posix.gs.js.map +1 -1
- package/dist/gs/os/exec_unix.gs.d.ts +1 -1
- package/dist/gs/os/executable.gs.d.ts +1 -1
- package/dist/gs/os/executable_js.gs.d.ts +1 -1
- package/dist/gs/os/executable_wasm.gs.d.ts +1 -1
- package/dist/gs/os/file_constants_js.gs.d.ts +1 -1
- package/dist/gs/os/file_constants_js.gs.js +1 -1
- package/dist/gs/os/file_constants_js.gs.js.map +1 -1
- package/dist/gs/os/file_js.gs.d.ts +1 -1
- package/dist/gs/os/file_open_unix.gs.d.ts +1 -1
- package/dist/gs/os/file_posix_js.gs.d.ts +1 -1
- package/dist/gs/os/file_unix_js.gs.d.ts +1 -1
- package/dist/gs/os/getwd_js.gs.d.ts +1 -1
- package/dist/gs/os/path.gs.d.ts +1 -1
- package/dist/gs/os/path.gs.js +1 -1
- package/dist/gs/os/path.gs.js.map +1 -1
- package/dist/gs/os/path_unix.gs.js +1 -1
- package/dist/gs/os/path_unix.gs.js.map +1 -1
- package/dist/gs/os/pidfd_js.gs.d.ts +1 -1
- package/dist/gs/os/pipe_wasm.gs.d.ts +1 -1
- package/dist/gs/os/proc.gs.d.ts +1 -1
- package/dist/gs/os/proc.gs.js +1 -1
- package/dist/gs/os/proc.gs.js.map +1 -1
- package/dist/gs/os/proc_js.gs.d.ts +1 -1
- package/dist/gs/os/proc_js.gs.js +1 -1
- package/dist/gs/os/proc_js.gs.js.map +1 -1
- package/dist/gs/os/rawconn_js.gs.d.ts +1 -1
- package/dist/gs/os/removeall_js.gs.d.ts +1 -1
- package/dist/gs/os/root_js.gs.d.ts +1 -1
- package/dist/gs/os/root_js.gs.js +1 -1
- package/dist/gs/os/root_js.gs.js.map +1 -1
- package/dist/gs/os/root_nonwindows.gs.d.ts +1 -1
- package/dist/gs/os/root_noopenat.gs.d.ts +1 -1
- package/dist/gs/os/stat.gs.d.ts +1 -1
- package/dist/gs/os/stat_js.gs.d.ts +1 -1
- package/dist/gs/os/stat_unix_js.gs.d.ts +1 -1
- package/dist/gs/os/sys.gs.d.ts +1 -1
- package/dist/gs/os/sys_bsd.gs.d.ts +1 -1
- package/dist/gs/os/sys_js.gs.d.ts +1 -1
- package/dist/gs/os/tempfile.gs.d.ts +1 -1
- package/dist/gs/os/types.gs.d.ts +1 -1
- package/dist/gs/os/types.gs.js +1 -1
- package/dist/gs/os/types.gs.js.map +1 -1
- package/dist/gs/os/types_js.gs.d.ts +1 -1
- package/dist/gs/os/types_js.gs.js +1 -1
- package/dist/gs/os/types_js.gs.js.map +1 -1
- package/dist/gs/os/types_unix.gs.d.ts +1 -1
- package/dist/gs/os/types_unix.gs.js +1 -1
- package/dist/gs/os/types_unix.gs.js.map +1 -1
- package/dist/gs/os/zero_copy_posix.gs.d.ts +1 -1
- package/dist/gs/os/zero_copy_posix.gs.js +1 -1
- package/dist/gs/os/zero_copy_posix.gs.js.map +1 -1
- package/dist/gs/path/filepath/index.d.ts +3 -0
- package/dist/gs/path/filepath/index.js +3 -0
- package/dist/gs/path/filepath/index.js.map +1 -0
- package/dist/gs/path/filepath/match.d.ts +3 -0
- package/dist/gs/path/filepath/match.js +212 -0
- package/dist/gs/path/filepath/match.js.map +1 -0
- package/dist/gs/path/filepath/path.d.ts +26 -0
- package/dist/gs/path/filepath/path.js +266 -0
- package/dist/gs/path/filepath/path.js.map +1 -0
- package/dist/gs/path/match.d.ts +1 -1
- package/dist/gs/path/match.js +1 -1
- package/dist/gs/path/match.js.map +1 -1
- package/dist/gs/path/path.js +1 -1
- package/dist/gs/path/path.js.map +1 -1
- package/dist/gs/reflect/value.d.ts +1 -1
- package/dist/gs/reflect/value.js +14 -6
- package/dist/gs/reflect/value.js.map +1 -1
- package/dist/gs/reflect/visiblefields.d.ts +1 -1
- package/dist/gs/reflect/visiblefields.js +1 -1
- package/dist/gs/reflect/visiblefields.js.map +1 -1
- package/dist/gs/slices/slices.d.ts +1 -1
- package/dist/gs/slices/slices.js +1 -1
- package/dist/gs/slices/slices.js.map +1 -1
- package/dist/gs/sort/index.d.ts +4 -0
- package/dist/gs/sort/index.js +4 -0
- package/dist/gs/sort/index.js.map +1 -0
- package/dist/gs/sort/search.gs.d.ts +6 -0
- package/dist/gs/sort/search.gs.js +125 -0
- package/dist/gs/sort/search.gs.js.map +1 -0
- package/dist/gs/sort/slice.gs.d.ts +4 -0
- package/dist/gs/sort/slice.gs.js +49 -0
- package/dist/gs/sort/slice.gs.js.map +1 -0
- package/dist/gs/sort/sort.gs.d.ts +37 -0
- package/dist/gs/sort/sort.gs.js +203 -0
- package/dist/gs/sort/sort.gs.js.map +1 -0
- package/dist/gs/strconv/atob.gs.d.ts +1 -1
- package/dist/gs/strconv/atob.gs.js +1 -1
- package/dist/gs/strconv/atob.gs.js.map +1 -1
- package/dist/gs/strconv/atof.gs.d.ts +1 -1
- package/dist/gs/strconv/atoi.gs.d.ts +1 -1
- package/dist/gs/strconv/atoi.gs.js +5 -6
- package/dist/gs/strconv/atoi.gs.js.map +1 -1
- package/dist/gs/strconv/ftoa.gs.d.ts +1 -1
- package/dist/gs/strconv/ftoa.gs.js +1 -1
- package/dist/gs/strconv/ftoa.gs.js.map +1 -1
- package/dist/gs/strconv/itoa.gs.d.ts +1 -1
- package/dist/gs/strconv/itoa.gs.js +1 -1
- package/dist/gs/strconv/itoa.gs.js.map +1 -1
- package/dist/gs/strconv/quote.gs.d.ts +1 -1
- package/dist/gs/strconv/quote.gs.js +1 -1
- package/dist/gs/strconv/quote.gs.js.map +1 -1
- package/dist/gs/strings/builder.d.ts +1 -1
- package/dist/gs/strings/builder.js +1 -1
- package/dist/gs/strings/builder.js.map +1 -1
- package/dist/gs/strings/iter.js +1 -1
- package/dist/gs/strings/iter.js.map +1 -1
- package/dist/gs/strings/reader.d.ts +1 -1
- package/dist/gs/strings/reader.js +7 -8
- package/dist/gs/strings/reader.js.map +1 -1
- package/dist/gs/strings/replace.d.ts +1 -1
- package/dist/gs/strings/replace.js +1 -1
- package/dist/gs/strings/replace.js.map +1 -1
- package/dist/gs/strings/strings.d.ts +1 -1
- package/dist/gs/strings/strings.js +1 -1
- package/dist/gs/strings/strings.js.map +1 -1
- package/dist/gs/sync/atomic/doc.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/doc_64.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/type.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/type.gs.js +1 -1
- package/dist/gs/sync/atomic/type.gs.js.map +1 -1
- package/dist/gs/sync/atomic/value.gs.d.ts +1 -1
- package/dist/gs/sync/atomic/value.gs.js +1 -1
- package/dist/gs/sync/atomic/value.gs.js.map +1 -1
- package/dist/gs/syscall/index.d.ts +1 -1
- package/dist/gs/syscall/index.js +1 -1
- package/dist/gs/syscall/index.js.map +1 -1
- package/dist/gs/unicode/utf8/utf8.d.ts +1 -1
- package/dist/gs/unicode/utf8/utf8.js +1 -1
- package/dist/gs/unicode/utf8/utf8.js.map +1 -1
- package/gs/builtin/builtin.ts +33 -64
- package/gs/builtin/errors.ts +25 -0
- package/gs/builtin/index.ts +7 -0
- package/gs/builtin/slice.ts +142 -71
- package/gs/bytes/buffer.gs.ts +1 -1
- package/gs/bytes/bytes.gs.ts +123 -15
- package/gs/bytes/iter.gs.ts +1 -1
- package/gs/bytes/metadata.go +12 -0
- package/gs/bytes/reader.gs.ts +1 -1
- package/gs/context/context.ts +1 -1
- package/gs/errors/errors.ts +3 -16
- package/gs/fmt/fmt.ts +407 -0
- package/gs/fmt/godoc.txt +382 -0
- package/gs/fmt/index.ts +31 -0
- package/gs/fmt/metadata.go +7 -0
- package/gs/github.com/pkg/errors/errors.ts +1 -1
- package/gs/github.com/pkg/errors/go113.ts +2 -2
- package/gs/github.com/pkg/errors/stack.ts +1 -1
- package/gs/internal/byteorder/index.ts +1 -1
- package/gs/internal/metadata.go +7 -0
- package/gs/internal/oserror/errors.ts +1 -1
- package/gs/io/fs/format.ts +1 -1
- package/gs/io/fs/fs.ts +1 -1
- package/gs/io/fs/glob.ts +1 -1
- package/gs/io/fs/readdir.ts +1 -1
- package/gs/io/fs/readfile.ts +1 -1
- package/gs/io/fs/stat.ts +1 -1
- package/gs/io/fs/sub.ts +1 -1
- package/gs/io/fs/walk.ts +1 -1
- package/gs/io/io.ts +1 -1
- package/gs/io/metadata.go +11 -0
- package/gs/maps/iter.ts +1 -1
- package/gs/maps/maps.ts +1 -1
- package/gs/maps/metadata.go +8 -0
- package/gs/math/abs.gs.ts +1 -1
- package/gs/math/acosh.gs.ts +1 -1
- package/gs/math/asinh.gs.ts +1 -1
- package/gs/math/atan.gs.ts +1 -1
- package/gs/math/atan2.gs.ts +1 -1
- package/gs/math/atanh.gs.ts +1 -1
- package/gs/math/bits.gs.ts +1 -1
- package/gs/math/cbrt.gs.ts +1 -1
- package/gs/math/const.gs.ts +1 -1
- package/gs/math/copysign.gs.ts +1 -1
- package/gs/math/dim.gs.ts +1 -1
- package/gs/math/erf.gs.ts +1 -1
- package/gs/math/erfinv.gs.ts +1 -1
- package/gs/math/exp.gs.ts +1 -1
- package/gs/math/expm1.gs.ts +1 -1
- package/gs/math/floor.gs.ts +1 -1
- package/gs/math/frexp.gs.ts +1 -1
- package/gs/math/gamma.gs.ts +1 -1
- package/gs/math/hypot.gs.ts +1 -1
- package/gs/math/j0.gs.ts +1 -1
- package/gs/math/j1.gs.ts +1 -1
- package/gs/math/jn.gs.ts +1 -1
- package/gs/math/ldexp.gs.ts +1 -1
- package/gs/math/lgamma.gs.ts +1 -1
- package/gs/math/log.gs.ts +1 -1
- package/gs/math/log10.gs.ts +1 -1
- package/gs/math/log1p.gs.ts +1 -1
- package/gs/math/logb.gs.ts +1 -1
- package/gs/math/metadata.go +7 -0
- package/gs/math/mod.gs.ts +1 -1
- package/gs/math/modf.gs.ts +1 -1
- package/gs/math/nextafter.gs.ts +1 -1
- package/gs/math/pow.gs.ts +1 -1
- package/gs/math/pow10.gs.ts +1 -1
- package/gs/math/remainder.gs.ts +1 -1
- package/gs/math/signbit.gs.ts +1 -1
- package/gs/math/sin.gs.ts +1 -1
- package/gs/math/sincos.gs.ts +1 -1
- package/gs/math/sinh.gs.ts +1 -1
- package/gs/math/sqrt.gs.ts +1 -1
- package/gs/math/tan.gs.ts +1 -1
- package/gs/math/tanh.gs.ts +1 -1
- package/gs/math/trig_reduce.gs.ts +1 -1
- package/gs/math/unsafe.gs.ts +1 -1
- package/gs/os/dir.gs.ts +1 -1
- package/gs/os/dir_unix.gs.ts +1 -1
- package/gs/os/dirent_js.gs.ts +1 -1
- package/gs/os/env.gs.ts +1 -1
- package/gs/os/error.gs.ts +1 -1
- package/gs/os/error_errno.gs.ts +1 -1
- package/gs/os/exec.gs.ts +1 -1
- package/gs/os/exec_nohandle.gs.ts +1 -1
- package/gs/os/exec_posix.gs.ts +1 -1
- package/gs/os/exec_unix.gs.ts +1 -1
- package/gs/os/executable.gs.ts +1 -1
- package/gs/os/executable_js.gs.ts +1 -1
- package/gs/os/executable_wasm.gs.ts +1 -1
- package/gs/os/file_constants_js.gs.ts +1 -1
- package/gs/os/file_js.gs.ts +1 -1
- package/gs/os/file_open_unix.gs.ts +1 -1
- package/gs/os/file_posix_js.gs.ts +1 -1
- package/gs/os/file_unix_js.gs.ts +1 -1
- package/gs/os/getwd_js.gs.ts +1 -1
- package/gs/os/metadata.go +17 -0
- package/gs/os/path.gs.ts +1 -1
- package/gs/os/path_unix.gs.ts +1 -1
- package/gs/os/pidfd_js.gs.ts +1 -1
- package/gs/os/pipe_wasm.gs.ts +1 -1
- package/gs/os/proc.gs.ts +1 -1
- package/gs/os/proc_js.gs.ts +1 -1
- package/gs/os/rawconn_js.gs.ts +1 -1
- package/gs/os/removeall_js.gs.ts +1 -1
- package/gs/os/root_js.gs.ts +1 -1
- package/gs/os/root_nonwindows.gs.ts +1 -1
- package/gs/os/root_noopenat.gs.ts +1 -1
- package/gs/os/stat.gs.ts +1 -1
- package/gs/os/stat_js.gs.ts +1 -1
- package/gs/os/stat_unix_js.gs.ts +1 -1
- package/gs/os/sticky_bsd.gs.ts +1 -1
- package/gs/os/sys.gs.ts +1 -1
- package/gs/os/sys_bsd.gs.ts +1 -1
- package/gs/os/sys_js.gs.ts +1 -1
- package/gs/os/tempfile.gs.ts +1 -1
- package/gs/os/types.gs.ts +1 -1
- package/gs/os/types_js.gs.ts +1 -1
- package/gs/os/types_unix.gs.ts +1 -1
- package/gs/os/wait_unimp.gs.ts +1 -1
- package/gs/os/zero_copy_posix.gs.ts +1 -1
- package/gs/os/zero_copy_stub.gs.ts +1 -1
- package/gs/path/filepath/godoc.txt +35 -0
- package/gs/path/filepath/index.ts +27 -0
- package/gs/path/filepath/match.test.ts +274 -0
- package/gs/path/filepath/match.ts +249 -0
- package/gs/path/filepath/path.test.ts +246 -0
- package/gs/path/filepath/path.ts +329 -0
- package/gs/path/match.ts +1 -1
- package/gs/path/metadata.go +8 -0
- package/gs/path/path.ts +1 -1
- package/gs/reflect/metadata.go +7 -0
- package/gs/reflect/value.ts +14 -6
- package/gs/reflect/visiblefields.ts +1 -1
- package/gs/slices/slices.ts +1 -1
- package/gs/sort/godoc.txt +27 -0
- package/gs/sort/index.ts +24 -0
- package/gs/sort/search.gs.ts +128 -0
- package/gs/sort/slice.gs.ts +59 -0
- package/gs/sort/sort.gs.ts +227 -0
- package/gs/strconv/atob.gs.ts +1 -1
- package/gs/strconv/atof.gs.ts +1 -1
- package/gs/strconv/atoi.gs.ts +5 -6
- package/gs/strconv/doc.gs.ts +1 -1
- package/gs/strconv/ftoa.gs.ts +1 -1
- package/gs/strconv/itoa.gs.ts +1 -1
- package/gs/strconv/metadata.go +7 -0
- package/gs/strconv/quote.gs.ts +1 -1
- package/gs/strings/builder.ts +1 -1
- package/gs/strings/iter.ts +1 -1
- package/gs/strings/metadata.go +11 -0
- package/gs/strings/reader.ts +7 -9
- package/gs/strings/replace.ts +1 -1
- package/gs/strings/strings.ts +1 -1
- package/gs/sync/atomic/doc.gs.ts +1 -1
- package/gs/sync/atomic/doc_64.gs.ts +1 -1
- package/gs/sync/atomic/type.gs.ts +1 -1
- package/gs/sync/atomic/value.gs.ts +1 -1
- package/gs/sync/metadata.go +7 -0
- package/gs/syscall/index.ts +1 -1
- package/gs/unicode/utf8/utf8.ts +1 -1
- package/package.json +3 -3
- package/gs/builtin/io.ts +0 -22
package/gs/fmt/godoc.txt
ADDED
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
package fmt // import "fmt"
|
|
2
|
+
|
|
3
|
+
Package fmt implements formatted I/O with functions analogous to C's printf and
|
|
4
|
+
scanf. The format 'verbs' are derived from C's but are simpler.
|
|
5
|
+
|
|
6
|
+
# Printing
|
|
7
|
+
|
|
8
|
+
The verbs:
|
|
9
|
+
|
|
10
|
+
General:
|
|
11
|
+
|
|
12
|
+
%v the value in a default format
|
|
13
|
+
when printing structs, the plus flag (%+v) adds field names
|
|
14
|
+
%#v a Go-syntax representation of the value
|
|
15
|
+
(floating-point infinities and NaNs print as ±Inf and NaN)
|
|
16
|
+
%T a Go-syntax representation of the type of the value
|
|
17
|
+
%% a literal percent sign; consumes no value
|
|
18
|
+
|
|
19
|
+
Boolean:
|
|
20
|
+
|
|
21
|
+
%t the word true or false
|
|
22
|
+
|
|
23
|
+
Integer:
|
|
24
|
+
|
|
25
|
+
%b base 2
|
|
26
|
+
%c the character represented by the corresponding Unicode code point
|
|
27
|
+
%d base 10
|
|
28
|
+
%o base 8
|
|
29
|
+
%O base 8 with 0o prefix
|
|
30
|
+
%q a single-quoted character literal safely escaped with Go syntax.
|
|
31
|
+
%x base 16, with lower-case letters for a-f
|
|
32
|
+
%X base 16, with upper-case letters for A-F
|
|
33
|
+
%U Unicode format: U+1234; same as "U+%04X"
|
|
34
|
+
|
|
35
|
+
Floating-point and complex constituents:
|
|
36
|
+
|
|
37
|
+
%b decimalless scientific notation with exponent a power of two,
|
|
38
|
+
in the manner of strconv.FormatFloat with the 'b' format,
|
|
39
|
+
e.g. -123456p-78
|
|
40
|
+
%e scientific notation, e.g. -1.234456e+78
|
|
41
|
+
%E scientific notation, e.g. -1.234456E+78
|
|
42
|
+
%f decimal point but no exponent, e.g. 123.456
|
|
43
|
+
%F synonym for %f
|
|
44
|
+
%g %e for large exponents, %f otherwise. Precision is discussed below.
|
|
45
|
+
%G %E for large exponents, %F otherwise
|
|
46
|
+
%x hexadecimal notation (with decimal power of two exponent), e.g. -0x1.23abcp+20
|
|
47
|
+
%X upper-case hexadecimal notation, e.g. -0X1.23ABCP+20
|
|
48
|
+
|
|
49
|
+
The exponent is always a decimal integer.
|
|
50
|
+
For formats other than %b the exponent is at least two digits.
|
|
51
|
+
|
|
52
|
+
String and slice of bytes (treated equivalently with these verbs):
|
|
53
|
+
|
|
54
|
+
%s the uninterpreted bytes of the string or slice
|
|
55
|
+
%q a double-quoted string safely escaped with Go syntax
|
|
56
|
+
%x base 16, lower-case, two characters per byte
|
|
57
|
+
%X base 16, upper-case, two characters per byte
|
|
58
|
+
|
|
59
|
+
Slice:
|
|
60
|
+
|
|
61
|
+
%p address of 0th element in base 16 notation, with leading 0x
|
|
62
|
+
|
|
63
|
+
Pointer:
|
|
64
|
+
|
|
65
|
+
%p base 16 notation, with leading 0x
|
|
66
|
+
The %b, %d, %o, %x and %X verbs also work with pointers,
|
|
67
|
+
formatting the value exactly as if it were an integer.
|
|
68
|
+
|
|
69
|
+
The default format for %v is:
|
|
70
|
+
|
|
71
|
+
bool: %t
|
|
72
|
+
int, int8 etc.: %d
|
|
73
|
+
uint, uint8 etc.: %d, %#x if printed with %#v
|
|
74
|
+
float32, complex64, etc: %g
|
|
75
|
+
string: %s
|
|
76
|
+
chan: %p
|
|
77
|
+
pointer: %p
|
|
78
|
+
|
|
79
|
+
For compound objects, the elements are printed using these rules, recursively,
|
|
80
|
+
laid out like this:
|
|
81
|
+
|
|
82
|
+
struct: {field0 field1 ...}
|
|
83
|
+
array, slice: [elem0 elem1 ...]
|
|
84
|
+
maps: map[key1:value1 key2:value2 ...]
|
|
85
|
+
pointer to above: &{}, &[], &map[]
|
|
86
|
+
|
|
87
|
+
Width is specified by an optional decimal number immediately preceding the verb.
|
|
88
|
+
If absent, the width is whatever is necessary to represent the value. Precision
|
|
89
|
+
is specified after the (optional) width by a period followed by a decimal
|
|
90
|
+
number. If no period is present, a default precision is used. A period with no
|
|
91
|
+
following number specifies a precision of zero. Examples:
|
|
92
|
+
|
|
93
|
+
%f default width, default precision
|
|
94
|
+
%9f width 9, default precision
|
|
95
|
+
%.2f default width, precision 2
|
|
96
|
+
%9.2f width 9, precision 2
|
|
97
|
+
%9.f width 9, precision 0
|
|
98
|
+
|
|
99
|
+
Width and precision are measured in units of Unicode code points, that is,
|
|
100
|
+
runes. (This differs from C's printf where the units are always measured in
|
|
101
|
+
bytes.) Either or both of the flags may be replaced with the character '*',
|
|
102
|
+
causing their values to be obtained from the next operand (preceding the one to
|
|
103
|
+
format), which must be of type int.
|
|
104
|
+
|
|
105
|
+
For most values, width is the minimum number of runes to output, padding the
|
|
106
|
+
formatted form with spaces if necessary.
|
|
107
|
+
|
|
108
|
+
For strings, byte slices and byte arrays, however, precision limits the length
|
|
109
|
+
of the input to be formatted (not the size of the output), truncating if
|
|
110
|
+
necessary. Normally it is measured in runes, but for these types when formatted
|
|
111
|
+
with the %x or %X format it is measured in bytes.
|
|
112
|
+
|
|
113
|
+
For floating-point values, width sets the minimum width of the field and
|
|
114
|
+
precision sets the number of places after the decimal, if appropriate, except
|
|
115
|
+
that for %g/%G precision sets the maximum number of significant digits (trailing
|
|
116
|
+
zeros are removed). For example, given 12.345 the format %6.3f prints 12.345
|
|
117
|
+
while %.3g prints 12.3. The default precision for %e, %f and %#g is 6; for %g it
|
|
118
|
+
is the smallest number of digits necessary to identify the value uniquely.
|
|
119
|
+
|
|
120
|
+
For complex numbers, the width and precision apply to the two components
|
|
121
|
+
independently and the result is parenthesized, so %f applied to 1.2+3.4i
|
|
122
|
+
produces (1.200000+3.400000i).
|
|
123
|
+
|
|
124
|
+
When formatting a single integer code point or a rune string (type []rune)
|
|
125
|
+
with %q, invalid Unicode code points are changed to the Unicode replacement
|
|
126
|
+
character, U+FFFD, as in strconv.QuoteRune.
|
|
127
|
+
|
|
128
|
+
Other flags:
|
|
129
|
+
|
|
130
|
+
'+' always print a sign for numeric values;
|
|
131
|
+
guarantee ASCII-only output for %q (%+q)
|
|
132
|
+
'-' pad with spaces on the right rather than the left (left-justify the field)
|
|
133
|
+
'#' alternate format: add leading 0b for binary (%#b), 0 for octal (%#o),
|
|
134
|
+
0x or 0X for hex (%#x or %#X); suppress 0x for %p (%#p);
|
|
135
|
+
for %q, print a raw (backquoted) string if [strconv.CanBackquote]
|
|
136
|
+
returns true;
|
|
137
|
+
always print a decimal point for %e, %E, %f, %F, %g and %G;
|
|
138
|
+
do not remove trailing zeros for %g and %G;
|
|
139
|
+
write e.g. U+0078 'x' if the character is printable for %U (%#U)
|
|
140
|
+
' ' (space) leave a space for elided sign in numbers (% d);
|
|
141
|
+
put spaces between bytes printing strings or slices in hex (% x, % X)
|
|
142
|
+
'0' pad with leading zeros rather than spaces;
|
|
143
|
+
for numbers, this moves the padding after the sign
|
|
144
|
+
|
|
145
|
+
Flags are ignored by verbs that do not expect them. For example there is no
|
|
146
|
+
alternate decimal format, so %#d and %d behave identically.
|
|
147
|
+
|
|
148
|
+
For each Printf-like function, there is also a Print function that takes no
|
|
149
|
+
format and is equivalent to saying %v for every operand. Another variant Println
|
|
150
|
+
inserts blanks between operands and appends a newline.
|
|
151
|
+
|
|
152
|
+
Regardless of the verb, if an operand is an interface value, the internal
|
|
153
|
+
concrete value is used, not the interface itself. Thus:
|
|
154
|
+
|
|
155
|
+
var i interface{} = 23
|
|
156
|
+
fmt.Printf("%v\n", i)
|
|
157
|
+
|
|
158
|
+
will print 23.
|
|
159
|
+
|
|
160
|
+
Except when printed using the verbs %T and %p, special formatting considerations
|
|
161
|
+
apply for operands that implement certain interfaces. In order of application:
|
|
162
|
+
|
|
163
|
+
1. If the operand is a reflect.Value, the operand is replaced by the concrete
|
|
164
|
+
value that it holds, and printing continues with the next rule.
|
|
165
|
+
|
|
166
|
+
2. If an operand implements the Formatter interface, it will be invoked. In this
|
|
167
|
+
case the interpretation of verbs and flags is controlled by that implementation.
|
|
168
|
+
|
|
169
|
+
3. If the %v verb is used with the # flag (%#v) and the operand implements the
|
|
170
|
+
GoStringer interface, that will be invoked.
|
|
171
|
+
|
|
172
|
+
If the format (which is implicitly %v for Println etc.) is valid for a string
|
|
173
|
+
(%s %q %x %X), or is %v but not %#v, the following two rules apply:
|
|
174
|
+
|
|
175
|
+
4. If an operand implements the error interface, the Error method will be
|
|
176
|
+
invoked to convert the object to a string, which will then be formatted as
|
|
177
|
+
required by the verb (if any).
|
|
178
|
+
|
|
179
|
+
5. If an operand implements method String() string, that method will be invoked
|
|
180
|
+
to convert the object to a string, which will then be formatted as required by
|
|
181
|
+
the verb (if any).
|
|
182
|
+
|
|
183
|
+
For compound operands such as slices and structs, the format applies to the
|
|
184
|
+
elements of each operand, recursively, not to the operand as a whole. Thus %q
|
|
185
|
+
will quote each element of a slice of strings, and %6.2f will control formatting
|
|
186
|
+
for each element of a floating-point array.
|
|
187
|
+
|
|
188
|
+
However, when printing a byte slice with a string-like verb (%s %q %x %X),
|
|
189
|
+
it is treated identically to a string, as a single item.
|
|
190
|
+
|
|
191
|
+
To avoid recursion in cases such as
|
|
192
|
+
|
|
193
|
+
type X string
|
|
194
|
+
func (x X) String() string { return Sprintf("<%s>", x) }
|
|
195
|
+
|
|
196
|
+
convert the value before recurring:
|
|
197
|
+
|
|
198
|
+
func (x X) String() string { return Sprintf("<%s>", string(x)) }
|
|
199
|
+
|
|
200
|
+
Infinite recursion can also be triggered by self-referential data structures,
|
|
201
|
+
such as a slice that contains itself as an element, if that type has a String
|
|
202
|
+
method. Such pathologies are rare, however, and the package does not protect
|
|
203
|
+
against them.
|
|
204
|
+
|
|
205
|
+
When printing a struct, fmt cannot and therefore does not invoke formatting
|
|
206
|
+
methods such as Error or String on unexported fields.
|
|
207
|
+
|
|
208
|
+
# Explicit argument indexes
|
|
209
|
+
|
|
210
|
+
In Printf, Sprintf, and Fprintf, the default behavior is for each formatting
|
|
211
|
+
verb to format successive arguments passed in the call. However, the notation
|
|
212
|
+
[n] immediately before the verb indicates that the nth one-indexed argument
|
|
213
|
+
is to be formatted instead. The same notation before a '*' for a width or
|
|
214
|
+
precision selects the argument index holding the value. After processing a
|
|
215
|
+
bracketed expression [n], subsequent verbs will use arguments n+1, n+2, etc.
|
|
216
|
+
unless otherwise directed.
|
|
217
|
+
|
|
218
|
+
For example,
|
|
219
|
+
|
|
220
|
+
fmt.Sprintf("%[2]d %[1]d\n", 11, 22)
|
|
221
|
+
|
|
222
|
+
will yield "22 11", while
|
|
223
|
+
|
|
224
|
+
fmt.Sprintf("%[3]*.[2]*[1]f", 12.0, 2, 6)
|
|
225
|
+
|
|
226
|
+
equivalent to
|
|
227
|
+
|
|
228
|
+
fmt.Sprintf("%6.2f", 12.0)
|
|
229
|
+
|
|
230
|
+
will yield " 12.00". Because an explicit index affects subsequent verbs,
|
|
231
|
+
this notation can be used to print the same values multiple times by resetting
|
|
232
|
+
the index for the first argument to be repeated:
|
|
233
|
+
|
|
234
|
+
fmt.Sprintf("%d %d %#[1]x %#x", 16, 17)
|
|
235
|
+
|
|
236
|
+
will yield "16 17 0x10 0x11".
|
|
237
|
+
|
|
238
|
+
# Format errors
|
|
239
|
+
|
|
240
|
+
If an invalid argument is given for a verb, such as providing a string to %d,
|
|
241
|
+
the generated string will contain a description of the problem, as in these
|
|
242
|
+
examples:
|
|
243
|
+
|
|
244
|
+
Wrong type or unknown verb: %!verb(type=value)
|
|
245
|
+
Printf("%d", "hi"): %!d(string=hi)
|
|
246
|
+
Too many arguments: %!(EXTRA type=value)
|
|
247
|
+
Printf("hi", "guys"): hi%!(EXTRA string=guys)
|
|
248
|
+
Too few arguments: %!verb(MISSING)
|
|
249
|
+
Printf("hi%d"): hi%!d(MISSING)
|
|
250
|
+
Non-int for width or precision: %!(BADWIDTH) or %!(BADPREC)
|
|
251
|
+
Printf("%*s", 4.5, "hi"): %!(BADWIDTH)hi
|
|
252
|
+
Printf("%.*s", 4.5, "hi"): %!(BADPREC)hi
|
|
253
|
+
Invalid or invalid use of argument index: %!(BADINDEX)
|
|
254
|
+
Printf("%*[2]d", 7): %!d(BADINDEX)
|
|
255
|
+
Printf("%.[2]d", 7): %!d(BADINDEX)
|
|
256
|
+
|
|
257
|
+
All errors begin with the string "%!" followed sometimes by a single character
|
|
258
|
+
(the verb) and end with a parenthesized description.
|
|
259
|
+
|
|
260
|
+
If an Error or String method triggers a panic when called by a print routine,
|
|
261
|
+
the fmt package reformats the error message from the panic, decorating it with
|
|
262
|
+
an indication that it came through the fmt package. For example, if a String
|
|
263
|
+
method calls panic("bad"), the resulting formatted message will look like
|
|
264
|
+
|
|
265
|
+
%!s(PANIC=bad)
|
|
266
|
+
|
|
267
|
+
The %!s just shows the print verb in use when the failure occurred. If the panic
|
|
268
|
+
is caused by a nil receiver to an Error, String, or GoString method, however,
|
|
269
|
+
the output is the undecorated string, "<nil>".
|
|
270
|
+
|
|
271
|
+
# Scanning
|
|
272
|
+
|
|
273
|
+
An analogous set of functions scans formatted text to yield values. Scan, Scanf
|
|
274
|
+
and Scanln read from os.Stdin; Fscan, Fscanf and Fscanln read from a specified
|
|
275
|
+
io.Reader; Sscan, Sscanf and Sscanln read from an argument string.
|
|
276
|
+
|
|
277
|
+
Scan, Fscan, Sscan treat newlines in the input as spaces.
|
|
278
|
+
|
|
279
|
+
Scanln, Fscanln and Sscanln stop scanning at a newline and require that the
|
|
280
|
+
items be followed by a newline or EOF.
|
|
281
|
+
|
|
282
|
+
Scanf, Fscanf, and Sscanf parse the arguments according to a format string,
|
|
283
|
+
analogous to that of Printf. In the text that follows, 'space' means any Unicode
|
|
284
|
+
whitespace character except newline.
|
|
285
|
+
|
|
286
|
+
In the format string, a verb introduced by the % character consumes and parses
|
|
287
|
+
input; these verbs are described in more detail below. A character other than %,
|
|
288
|
+
space, or newline in the format consumes exactly that input character, which
|
|
289
|
+
must be present. A newline with zero or more spaces before it in the format
|
|
290
|
+
string consumes zero or more spaces in the input followed by a single newline or
|
|
291
|
+
the end of the input. A space following a newline in the format string consumes
|
|
292
|
+
zero or more spaces in the input. Otherwise, any run of one or more spaces in
|
|
293
|
+
the format string consumes as many spaces as possible in the input. Unless the
|
|
294
|
+
run of spaces in the format string appears adjacent to a newline, the run must
|
|
295
|
+
consume at least one space from the input or find the end of the input.
|
|
296
|
+
|
|
297
|
+
The handling of spaces and newlines differs from that of C's scanf family: in C,
|
|
298
|
+
newlines are treated as any other space, and it is never an error when a run of
|
|
299
|
+
spaces in the format string finds no spaces to consume in the input.
|
|
300
|
+
|
|
301
|
+
The verbs behave analogously to those of Printf. For example, %x will scan an
|
|
302
|
+
integer as a hexadecimal number, and %v will scan the default representation
|
|
303
|
+
format for the value. The Printf verbs %p and %T and the flags # and + are not
|
|
304
|
+
implemented. For floating-point and complex values, all valid formatting verbs
|
|
305
|
+
(%b %e %E %f %F %g %G %x %X and %v) are equivalent and accept both decimal and
|
|
306
|
+
hexadecimal notation (for example: "2.3e+7", "0x4.5p-8") and digit-separating
|
|
307
|
+
underscores (for example: "3.14159_26535_89793").
|
|
308
|
+
|
|
309
|
+
Input processed by verbs is implicitly space-delimited: the implementation of
|
|
310
|
+
every verb except %c starts by discarding leading spaces from the remaining
|
|
311
|
+
input, and the %s verb (and %v reading into a string) stops consuming input at
|
|
312
|
+
the first space or newline character.
|
|
313
|
+
|
|
314
|
+
The familiar base-setting prefixes 0b (binary), 0o and 0 (octal), and 0x
|
|
315
|
+
(hexadecimal) are accepted when scanning integers without a format or with the
|
|
316
|
+
%v verb, as are digit-separating underscores.
|
|
317
|
+
|
|
318
|
+
Width is interpreted in the input text but there is no syntax for scanning with
|
|
319
|
+
a precision (no %5.2f, just %5f). If width is provided, it applies after leading
|
|
320
|
+
spaces are trimmed and specifies the maximum number of runes to read to satisfy
|
|
321
|
+
the verb. For example,
|
|
322
|
+
|
|
323
|
+
Sscanf(" 1234567 ", "%5s%d", &s, &i)
|
|
324
|
+
|
|
325
|
+
will set s to "12345" and i to 67 while
|
|
326
|
+
|
|
327
|
+
Sscanf(" 12 34 567 ", "%5s%d", &s, &i)
|
|
328
|
+
|
|
329
|
+
will set s to "12" and i to 34.
|
|
330
|
+
|
|
331
|
+
In all the scanning functions, a carriage return followed immediately by a
|
|
332
|
+
newline is treated as a plain newline (\r\n means the same as \n).
|
|
333
|
+
|
|
334
|
+
In all the scanning functions, if an operand implements method Scan (that is,
|
|
335
|
+
it implements the Scanner interface) that method will be used to scan the text
|
|
336
|
+
for that operand. Also, if the number of arguments scanned is less than the
|
|
337
|
+
number of arguments provided, an error is returned.
|
|
338
|
+
|
|
339
|
+
All arguments to be scanned must be either pointers to basic types or
|
|
340
|
+
implementations of the Scanner interface.
|
|
341
|
+
|
|
342
|
+
Like Scanf and Fscanf, Sscanf need not consume its entire input. There is no way
|
|
343
|
+
to recover how much of the input string Sscanf used.
|
|
344
|
+
|
|
345
|
+
Note: Fscan etc. can read one character (rune) past the input they return,
|
|
346
|
+
which means that a loop calling a scan routine may skip some of the input.
|
|
347
|
+
This is usually a problem only when there is no space between input values.
|
|
348
|
+
If the reader provided to Fscan implements ReadRune, that method will be used
|
|
349
|
+
to read characters. If the reader also implements UnreadRune, that method
|
|
350
|
+
will be used to save the character and successive calls will not lose data.
|
|
351
|
+
To attach ReadRune and UnreadRune methods to a reader without that capability,
|
|
352
|
+
use bufio.NewReader.
|
|
353
|
+
|
|
354
|
+
func Append(b []byte, a ...any) []byte
|
|
355
|
+
func Appendf(b []byte, format string, a ...any) []byte
|
|
356
|
+
func Appendln(b []byte, a ...any) []byte
|
|
357
|
+
func Errorf(format string, a ...any) error
|
|
358
|
+
func FormatString(state State, verb rune) string
|
|
359
|
+
func Fprint(w io.Writer, a ...any) (n int, err error)
|
|
360
|
+
func Fprintf(w io.Writer, format string, a ...any) (n int, err error)
|
|
361
|
+
func Fprintln(w io.Writer, a ...any) (n int, err error)
|
|
362
|
+
func Fscan(r io.Reader, a ...any) (n int, err error)
|
|
363
|
+
func Fscanf(r io.Reader, format string, a ...any) (n int, err error)
|
|
364
|
+
func Fscanln(r io.Reader, a ...any) (n int, err error)
|
|
365
|
+
func Print(a ...any) (n int, err error)
|
|
366
|
+
func Printf(format string, a ...any) (n int, err error)
|
|
367
|
+
func Println(a ...any) (n int, err error)
|
|
368
|
+
func Scan(a ...any) (n int, err error)
|
|
369
|
+
func Scanf(format string, a ...any) (n int, err error)
|
|
370
|
+
func Scanln(a ...any) (n int, err error)
|
|
371
|
+
func Sprint(a ...any) string
|
|
372
|
+
func Sprintf(format string, a ...any) string
|
|
373
|
+
func Sprintln(a ...any) string
|
|
374
|
+
func Sscan(str string, a ...any) (n int, err error)
|
|
375
|
+
func Sscanf(str string, format string, a ...any) (n int, err error)
|
|
376
|
+
func Sscanln(str string, a ...any) (n int, err error)
|
|
377
|
+
type Formatter interface{ ... }
|
|
378
|
+
type GoStringer interface{ ... }
|
|
379
|
+
type ScanState interface{ ... }
|
|
380
|
+
type Scanner interface{ ... }
|
|
381
|
+
type State interface{ ... }
|
|
382
|
+
type Stringer interface{ ... }
|
package/gs/fmt/index.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export {
|
|
2
|
+
Errorf,
|
|
3
|
+
Print,
|
|
4
|
+
Printf,
|
|
5
|
+
Println,
|
|
6
|
+
Sprint,
|
|
7
|
+
Sprintf,
|
|
8
|
+
Sprintln,
|
|
9
|
+
Fprint,
|
|
10
|
+
Fprintf,
|
|
11
|
+
Fprintln,
|
|
12
|
+
Append,
|
|
13
|
+
Appendf,
|
|
14
|
+
Appendln,
|
|
15
|
+
FormatString,
|
|
16
|
+
Scan,
|
|
17
|
+
Scanf,
|
|
18
|
+
Scanln,
|
|
19
|
+
Sscan,
|
|
20
|
+
Sscanf,
|
|
21
|
+
Sscanln,
|
|
22
|
+
Fscan,
|
|
23
|
+
Fscanf,
|
|
24
|
+
Fscanln,
|
|
25
|
+
Formatter,
|
|
26
|
+
GoStringer,
|
|
27
|
+
Stringer,
|
|
28
|
+
State,
|
|
29
|
+
Scanner,
|
|
30
|
+
ScanState,
|
|
31
|
+
} from './fmt.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as $ from '
|
|
1
|
+
import * as $ from '@goscript/builtin/index.js'
|
|
2
2
|
|
|
3
|
-
import * as stderrors from '
|
|
3
|
+
import * as stderrors from '@goscript/errors/index.js'
|
|
4
4
|
|
|
5
5
|
// Is reports whether any error in err's chain matches target.
|
|
6
6
|
//
|
package/gs/io/fs/format.ts
CHANGED
package/gs/io/fs/fs.ts
CHANGED
package/gs/io/fs/glob.ts
CHANGED
package/gs/io/fs/readdir.ts
CHANGED
package/gs/io/fs/readfile.ts
CHANGED
package/gs/io/fs/stat.ts
CHANGED
package/gs/io/fs/sub.ts
CHANGED
package/gs/io/fs/walk.ts
CHANGED
package/gs/io/io.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// such as those in package os, into shared public interfaces that abstract
|
|
4
4
|
// the functionality, plus some other related primitives.
|
|
5
5
|
|
|
6
|
-
import * as $ from '@goscript/builtin/
|
|
6
|
+
import * as $ from '@goscript/builtin/index.js'
|
|
7
7
|
|
|
8
8
|
// Simple error implementation for io package
|
|
9
9
|
class IOError {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package io
|
|
2
|
+
|
|
3
|
+
// GsDependencies lists the import paths that this gs/ package requires
|
|
4
|
+
// These dependencies will be automatically copied when this package is included
|
|
5
|
+
var GsDependencies = []string{
|
|
6
|
+
"errors",
|
|
7
|
+
"internal/oserror",
|
|
8
|
+
"path",
|
|
9
|
+
"time",
|
|
10
|
+
"unicode/utf8",
|
|
11
|
+
}
|
package/gs/maps/iter.ts
CHANGED
package/gs/maps/maps.ts
CHANGED
package/gs/math/abs.gs.ts
CHANGED
package/gs/math/acosh.gs.ts
CHANGED
package/gs/math/asinh.gs.ts
CHANGED
package/gs/math/atan.gs.ts
CHANGED
package/gs/math/atan2.gs.ts
CHANGED
package/gs/math/atanh.gs.ts
CHANGED
package/gs/math/bits.gs.ts
CHANGED
package/gs/math/cbrt.gs.ts
CHANGED
package/gs/math/const.gs.ts
CHANGED
package/gs/math/copysign.gs.ts
CHANGED
package/gs/math/dim.gs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as $ from "@goscript/builtin/
|
|
1
|
+
import * as $ from "@goscript/builtin/index.js";
|
|
2
2
|
import { Inf, IsInf, IsNaN, NaN } from "./bits.gs.js";
|
|
3
3
|
// archMax and archMin imports removed - using optimized implementation
|
|
4
4
|
import { Signbit } from "./signbit.gs.js";
|
package/gs/math/erf.gs.ts
CHANGED