├── .devcontainer └── devcontainer.json ├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ └── bug_report.md └── workflows │ ├── codeql-analysis.yml │ ├── docker-publish.yml │ └── go.yml ├── .gitignore ├── .goreleaser.yml ├── .ignore ├── .sccignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── Dockerfile ├── LANGUAGES.md ├── LICENSE ├── README.md ├── SCC-OUTPUT-REPORT.html ├── benchmark.sh ├── cmd └── badges │ ├── .gitignore │ ├── example.py │ ├── main.go │ └── main_test.go ├── examples ├── complexity │ ├── complexity.cpp │ └── complexity.java ├── countas │ ├── test.jsp │ └── test.new ├── duplicates │ ├── 1.java │ ├── 10.java │ ├── 11.java │ ├── 12.java │ ├── 13.java │ ├── 14.java │ ├── 15.java │ ├── 16.java │ ├── 17.java │ ├── 18.java │ ├── 19.java │ ├── 2.java │ ├── 20.java │ ├── 3.java │ ├── 4.java │ ├── 5.java │ ├── 6.java │ ├── 7.java │ ├── 8.java │ └── 9.java ├── generated │ ├── test.cs │ └── test.h ├── ignore │ ├── .gitignore │ └── README.md ├── issue114 │ ├── .gitignore │ ├── .ignore │ ├── .travis.yml │ ├── java │ ├── license │ └── makefile ├── issue115 │ └── .test │ │ └── file ├── issue120 │ ├── test │ └── test.java ├── issue149 │ └── .gitignore ├── issue152 │ └── example.black.css ├── issue214 │ ├── ббббббббббббббббббббббббббббббббб.md │ ├── ѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬ.md │ └── 中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文.md ├── issue246.py ├── issue260 │ └── test.c ├── issue323 │ ├── a.php │ └── b.php ├── issue339 │ ├── matlab.m │ └── objectivec.m ├── issue345 │ └── filename.cc ├── issue379 │ └── filename.py ├── issue552 │ └── test.txt ├── issue564 │ ├── a │ │ └── level1 │ │ │ └── level2 │ │ │ └── test.py │ ├── b │ │ └── c │ │ │ └── level2 │ │ │ └── test.py │ ├── level1 │ │ ├── level2 │ │ │ └── test.py │ │ └── test.go │ └── test.go ├── issue610 │ └── issue610.ts ├── language │ ├── .bash_login │ ├── .cshrc │ ├── .dockerignore │ ├── .ignore │ ├── .kshrc │ ├── .tcshrc │ ├── .zshrc │ ├── Blueprint.blp │ ├── Build.csx │ ├── Dockerfile │ ├── FSharp.fs │ ├── GNUMakefile │ ├── Gemfile │ ├── HassIQApp.mc │ ├── PostScript.ps │ ├── Rakefile │ ├── Sally.yarn │ ├── abnf.abnf │ ├── alchemist.crn │ ├── arturo.art │ ├── astro.astro │ ├── barber_solutions.als │ ├── bean.beancount │ ├── bicep.bicep │ ├── bitbucket-pipelines.yml │ ├── boo.boo │ ├── bosque.bsq │ ├── c3.c3 │ ├── cairo.cairo │ ├── capnproto.capnp │ ├── chapel.chpl │ ├── circom.circom │ ├── clojure.cljc │ ├── cloudformation.json │ ├── cloudformation.yml │ ├── component.templ │ ├── cuda.cu │ ├── daml.daml │ ├── docker.nu │ ├── dot.gv │ ├── elixirtemplate.eex │ ├── elm.elm │ ├── emit.emit │ ├── factor.factor │ ├── flow9.flow │ ├── fsl.fsl │ ├── fxml.fxml │ ├── gleam.gleam │ ├── go.go │ ├── godot.tscn │ ├── goplus.gop │ ├── graphql.graphql │ ├── gwion.gw │ ├── haml.haml │ ├── hare.ha │ ├── hcl.hcl │ ├── ini.ini │ ├── javascript.js │ ├── jq.jq │ ├── jsonc.jsonc │ ├── jsonnet.jsonnet │ ├── kitchen-sink.json5 │ ├── koto.koto │ ├── lalrpop.lalrpop │ ├── license │ ├── linear_solve.fut │ ├── livescript.ls │ ├── llvmir.ll │ ├── lua.lua │ ├── luau.luau │ ├── luna.luna │ ├── main.cj │ ├── makefile │ ├── metal.metal │ ├── moonbit.mbt │ ├── nawk.awk │ ├── perl.pl │ ├── pkl.pkl │ ├── python.py │ ├── qasm.qasm │ ├── qsharp.qs │ ├── racket.rkt │ ├── raml.raml │ ├── redscript.reds │ ├── rscript.r │ ├── scallop.scl │ ├── slang.slang │ ├── slint.slint │ ├── smalltalk.cs.st │ ├── snakefile.smk │ ├── stan.stan │ ├── syntax.wren │ ├── tact.tact │ ├── teal.teal │ ├── tera.tera │ ├── test.ch │ ├── test.dm │ ├── test.java │ ├── test.prg │ ├── test.sieve │ ├── test.tf │ ├── test.tofu │ ├── textile.textile │ ├── ttcn.ttcn │ ├── typescript.ts │ ├── typespec.tsp │ ├── typst.typ │ ├── up.up │ ├── vala.vala │ ├── version.rc │ ├── wenyan.wy │ ├── wsdl.wsdl │ ├── xmake.lua │ ├── xmlschema.xsd │ ├── yaml.yml │ ├── zig.zig │ └── zokrates.zok ├── long │ ├── test.feature │ ├── test.ftl │ ├── test.jsp │ ├── test.mxml │ ├── test.rdl │ ├── test.vcl │ └── test.xslt ├── minified │ ├── 0-941d61979b9396d94f06.js │ ├── 1-fa6e7d2ffea9ee90c8d8.js │ ├── app-5cddf2000f4491a89a40.js │ ├── bootstrap-grid.min.css │ ├── bootstrap-reboot.min.css │ ├── bootstrap.bundle.min.js │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── component---src-pages-index-tsx-65151e9f2f564e3fe49c.js │ ├── intercooler-1.2.1.min.js │ ├── jquery-3.1.1.min.js │ ├── jquery.dataTables.min.css │ ├── jquery.dataTables.min.js │ ├── popper.min.js │ └── webpack-runtime-c6e0a1eee0c3fa087a21.js ├── nolines.py ├── oneline.py ├── onenewline.py ├── performance_tests │ ├── create_folders_with_files.py │ └── create_performance_test.py ├── remap │ ├── java.java │ └── unknown ├── shared_extension │ ├── coq │ │ └── Qabs.v │ ├── verilog │ │ └── button_debounce.v │ └── vlang │ │ └── users.v ├── symlink │ ├── link.py │ ├── link2.py │ ├── link3.py │ ├── link4.py │ └── test.py ├── threenewline.py ├── twolines.py └── twonewline.py ├── go.mod ├── go.sum ├── languages.json ├── main.go ├── packages ├── aur │ └── PKGBUILD └── chocolatey │ ├── ReadMe.md │ ├── scc.nuspec │ └── tools │ ├── LICENSE.txt │ ├── VERIFICATION.txt │ ├── chocolateyinstall.ps1 │ └── chocolateyuninstall.ps1 ├── performance-over-time.png ├── processor ├── bloom.go ├── cocomo.go ├── cocomo_test.go ├── constants.go ├── detector.go ├── detector_test.go ├── file.go ├── file_test.go ├── filereader.go ├── formatters.go ├── formatters_test.go ├── helpers.go ├── helpers_test.go ├── processor.go ├── processor_test.go ├── structs.go ├── structs_test.go ├── workers.go ├── workers_regression_test.go ├── workers_test.go └── workers_tokei_test.go ├── scc.jpg ├── scripts ├── include.go └── languages.tmpl ├── test-all.sh └── vendor ├── github.com ├── boyter │ ├── gocodewalker │ │ ├── .gitignore │ │ ├── .goreleaser.yml │ │ ├── .ignore │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── dir_suffix.go │ │ ├── file.go │ │ ├── gitmodule.go │ │ ├── go-gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cache.go │ │ │ ├── doc.go │ │ │ ├── error.go │ │ │ ├── errors.go │ │ │ ├── exclude.go │ │ │ ├── gitignore.go │ │ │ ├── lexer.go │ │ │ ├── match.go │ │ │ ├── parser.go │ │ │ ├── pattern.go │ │ │ ├── position.go │ │ │ ├── repository.go │ │ │ ├── rune.go │ │ │ ├── token.go │ │ │ ├── tokenset.go │ │ │ └── tokentype.go │ │ ├── hidden.go │ │ └── hidden_windows.go │ └── simplecache │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ └── simplecache.go ├── danwakefield │ └── fnmatch │ │ ├── .gitignore │ │ ├── LICENSE │ │ ├── README.md │ │ └── fnmatch.go ├── inconshreveable │ └── mousetrap │ │ ├── LICENSE │ │ ├── README.md │ │ ├── trap_others.go │ │ └── trap_windows.go ├── json-iterator │ └── go │ │ ├── .codecov.yml │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Gopkg.lock │ │ ├── Gopkg.toml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── adapter.go │ │ ├── any.go │ │ ├── any_array.go │ │ ├── any_bool.go │ │ ├── any_float.go │ │ ├── any_int32.go │ │ ├── any_int64.go │ │ ├── any_invalid.go │ │ ├── any_nil.go │ │ ├── any_number.go │ │ ├── any_object.go │ │ ├── any_str.go │ │ ├── any_uint32.go │ │ ├── any_uint64.go │ │ ├── build.sh │ │ ├── config.go │ │ ├── fuzzy_mode_convert_table.md │ │ ├── iter.go │ │ ├── iter_array.go │ │ ├── iter_float.go │ │ ├── iter_int.go │ │ ├── iter_object.go │ │ ├── iter_skip.go │ │ ├── iter_skip_sloppy.go │ │ ├── iter_skip_strict.go │ │ ├── iter_str.go │ │ ├── jsoniter.go │ │ ├── pool.go │ │ ├── reflect.go │ │ ├── reflect_array.go │ │ ├── reflect_dynamic.go │ │ ├── reflect_extension.go │ │ ├── reflect_json_number.go │ │ ├── reflect_json_raw_message.go │ │ ├── reflect_map.go │ │ ├── reflect_marshaler.go │ │ ├── reflect_native.go │ │ ├── reflect_optional.go │ │ ├── reflect_slice.go │ │ ├── reflect_struct_decoder.go │ │ ├── reflect_struct_encoder.go │ │ ├── stream.go │ │ ├── stream_float.go │ │ ├── stream_int.go │ │ ├── stream_str.go │ │ └── test.sh ├── mattn │ ├── go-colorable │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorable_appengine.go │ │ ├── colorable_others.go │ │ ├── colorable_windows.go │ │ ├── go.test.sh │ │ └── noncolorable.go │ ├── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.test.sh │ │ ├── isatty_bsd.go │ │ ├── isatty_others.go │ │ ├── isatty_plan9.go │ │ ├── isatty_solaris.go │ │ ├── isatty_tcgets.go │ │ └── isatty_windows.go │ └── go-runewidth │ │ ├── LICENSE │ │ ├── README.md │ │ ├── runewidth.go │ │ ├── runewidth_appengine.go │ │ ├── runewidth_js.go │ │ ├── runewidth_posix.go │ │ ├── runewidth_table.go │ │ └── runewidth_windows.go ├── modern-go │ ├── concurrent │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── executor.go │ │ ├── go_above_19.go │ │ ├── go_below_19.go │ │ ├── log.go │ │ ├── test.sh │ │ └── unbounded_executor.go │ └── reflect2 │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── Gopkg.lock │ │ ├── Gopkg.toml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── go_above_118.go │ │ ├── go_above_19.go │ │ ├── go_below_118.go │ │ ├── reflect2.go │ │ ├── reflect2_amd64.s │ │ ├── reflect2_kind.go │ │ ├── relfect2_386.s │ │ ├── relfect2_amd64p32.s │ │ ├── relfect2_arm.s │ │ ├── relfect2_arm64.s │ │ ├── relfect2_mips64x.s │ │ ├── relfect2_mipsx.s │ │ ├── relfect2_ppc64x.s │ │ ├── relfect2_s390x.s │ │ ├── safe_field.go │ │ ├── safe_map.go │ │ ├── safe_slice.go │ │ ├── safe_struct.go │ │ ├── safe_type.go │ │ ├── type_map.go │ │ ├── unsafe_array.go │ │ ├── unsafe_eface.go │ │ ├── unsafe_field.go │ │ ├── unsafe_iface.go │ │ ├── unsafe_link.go │ │ ├── unsafe_map.go │ │ ├── unsafe_ptr.go │ │ ├── unsafe_slice.go │ │ ├── unsafe_struct.go │ │ └── unsafe_type.go ├── rivo │ └── uniseg │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── doc.go │ │ ├── eastasianwidth.go │ │ ├── emojipresentation.go │ │ ├── gen_breaktest.go │ │ ├── gen_properties.go │ │ ├── grapheme.go │ │ ├── graphemeproperties.go │ │ ├── graphemerules.go │ │ ├── line.go │ │ ├── lineproperties.go │ │ ├── linerules.go │ │ ├── properties.go │ │ ├── sentence.go │ │ ├── sentenceproperties.go │ │ ├── sentencerules.go │ │ ├── step.go │ │ ├── width.go │ │ ├── word.go │ │ ├── wordproperties.go │ │ └── wordrules.go ├── rs │ └── zerolog │ │ ├── .gitignore │ │ ├── CNAME │ │ ├── LICENSE │ │ ├── README.md │ │ ├── _config.yml │ │ ├── array.go │ │ ├── console.go │ │ ├── context.go │ │ ├── ctx.go │ │ ├── encoder.go │ │ ├── encoder_cbor.go │ │ ├── encoder_json.go │ │ ├── event.go │ │ ├── fields.go │ │ ├── globals.go │ │ ├── go112.go │ │ ├── hook.go │ │ ├── internal │ │ ├── cbor │ │ │ ├── README.md │ │ │ ├── base.go │ │ │ ├── cbor.go │ │ │ ├── decode_stream.go │ │ │ ├── string.go │ │ │ ├── time.go │ │ │ └── types.go │ │ └── json │ │ │ ├── base.go │ │ │ ├── bytes.go │ │ │ ├── string.go │ │ │ ├── time.go │ │ │ └── types.go │ │ ├── log.go │ │ ├── log │ │ └── log.go │ │ ├── not_go112.go │ │ ├── pretty.png │ │ ├── sampler.go │ │ ├── syslog.go │ │ └── writer.go └── spf13 │ ├── cobra │ ├── .gitignore │ ├── .golangci.yml │ ├── .mailmap │ ├── CONDUCT.md │ ├── CONTRIBUTING.md │ ├── LICENSE.txt │ ├── MAINTAINERS │ ├── Makefile │ ├── README.md │ ├── active_help.go │ ├── args.go │ ├── bash_completions.go │ ├── bash_completionsV2.go │ ├── cobra.go │ ├── command.go │ ├── command_notwin.go │ ├── command_win.go │ ├── completions.go │ ├── fish_completions.go │ ├── flag_groups.go │ ├── powershell_completions.go │ ├── shell_completions.go │ └── zsh_completions.go │ └── pflag │ ├── .editorconfig │ ├── .gitignore │ ├── .golangci.yaml │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bool.go │ ├── bool_slice.go │ ├── bytes.go │ ├── count.go │ ├── duration.go │ ├── duration_slice.go │ ├── flag.go │ ├── float32.go │ ├── float32_slice.go │ ├── float64.go │ ├── float64_slice.go │ ├── golangflag.go │ ├── int.go │ ├── int16.go │ ├── int32.go │ ├── int32_slice.go │ ├── int64.go │ ├── int64_slice.go │ ├── int8.go │ ├── int_slice.go │ ├── ip.go │ ├── ip_slice.go │ ├── ipmask.go │ ├── ipnet.go │ ├── ipnet_slice.go │ ├── string.go │ ├── string_array.go │ ├── string_slice.go │ ├── string_to_int.go │ ├── string_to_int64.go │ ├── string_to_string.go │ ├── uint.go │ ├── uint16.go │ ├── uint32.go │ ├── uint64.go │ ├── uint8.go │ └── uint_slice.go ├── golang.org └── x │ ├── crypto │ ├── LICENSE │ ├── PATENTS │ └── blake2b │ │ ├── blake2b.go │ │ ├── blake2bAVX2_amd64.go │ │ ├── blake2bAVX2_amd64.s │ │ ├── blake2b_amd64.s │ │ ├── blake2b_generic.go │ │ ├── blake2b_ref.go │ │ ├── blake2x.go │ │ └── register.go │ ├── sync │ ├── LICENSE │ ├── PATENTS │ └── errgroup │ │ ├── errgroup.go │ │ ├── go120.go │ │ └── pre_go120.go │ ├── sys │ ├── LICENSE │ ├── PATENTS │ ├── cpu │ │ ├── asm_aix_ppc64.s │ │ ├── asm_darwin_x86_gc.s │ │ ├── byteorder.go │ │ ├── cpu.go │ │ ├── cpu_aix.go │ │ ├── cpu_arm.go │ │ ├── cpu_arm64.go │ │ ├── cpu_arm64.s │ │ ├── cpu_darwin_x86.go │ │ ├── cpu_gc_arm64.go │ │ ├── cpu_gc_s390x.go │ │ ├── cpu_gc_x86.go │ │ ├── cpu_gc_x86.s │ │ ├── cpu_gccgo_arm64.go │ │ ├── cpu_gccgo_s390x.go │ │ ├── cpu_gccgo_x86.c │ │ ├── cpu_gccgo_x86.go │ │ ├── cpu_linux.go │ │ ├── cpu_linux_arm.go │ │ ├── cpu_linux_arm64.go │ │ ├── cpu_linux_mips64x.go │ │ ├── cpu_linux_noinit.go │ │ ├── cpu_linux_ppc64x.go │ │ ├── cpu_linux_riscv64.go │ │ ├── cpu_linux_s390x.go │ │ ├── cpu_loong64.go │ │ ├── cpu_mips64x.go │ │ ├── cpu_mipsx.go │ │ ├── cpu_netbsd_arm64.go │ │ ├── cpu_openbsd_arm64.go │ │ ├── cpu_openbsd_arm64.s │ │ ├── cpu_other_arm.go │ │ ├── cpu_other_arm64.go │ │ ├── cpu_other_mips64x.go │ │ ├── cpu_other_ppc64x.go │ │ ├── cpu_other_riscv64.go │ │ ├── cpu_other_x86.go │ │ ├── cpu_ppc64x.go │ │ ├── cpu_riscv64.go │ │ ├── cpu_s390x.go │ │ ├── cpu_s390x.s │ │ ├── cpu_wasm.go │ │ ├── cpu_x86.go │ │ ├── cpu_zos.go │ │ ├── cpu_zos_s390x.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── hwcap_linux.go │ │ ├── parse.go │ │ ├── proc_cpuinfo_linux.go │ │ ├── runtime_auxv.go │ │ ├── runtime_auxv_go121.go │ │ ├── syscall_aix_gccgo.go │ │ ├── syscall_aix_ppc64_gc.go │ │ └── syscall_darwin_x86_gc.go │ └── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_arm.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_ppc64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_loong64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_riscv64.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_solaris_amd64.s │ │ ├── asm_zos_s390x.s │ │ ├── auxv.go │ │ ├── auxv_unsupported.go │ │ ├── bluetooth_linux.go │ │ ├── bpxsvc_zos.go │ │ ├── bpxsvc_zos.s │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_zos.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ifreq_linux.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_signed.go │ │ ├── ioctl_unsigned.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mmap_nomremap.go │ │ ├── mremap.go │ │ ├── pagesize_unix.go │ │ ├── pledge_openbsd.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_ios.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── readdirent_getdents.go │ │ ├── readdirent_getdirentries.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── sockcmsg_unix_other.go │ │ ├── sockcmsg_zos.go │ │ ├── symaddr_zos_s390x.s │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_freebsd_riscv64.go │ │ ├── syscall_hurd.go │ │ ├── syscall_hurd_386.go │ │ ├── syscall_illumos.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gc_arm.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_loong64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_libc.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_openbsd_ppc64.go │ │ ├── syscall_openbsd_riscv64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── syscall_zos_s390x.go │ │ ├── sysvshm_linux.go │ │ ├── sysvshm_unix.go │ │ ├── sysvshm_unix_other.go │ │ ├── timestruct.go │ │ ├── unveil_openbsd.go │ │ ├── vgetrandom_linux.go │ │ ├── vgetrandom_unsupported.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_freebsd_riscv64.go │ │ ├── zerrors_linux.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_loong64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_openbsd_arm64.go │ │ ├── zerrors_openbsd_mips64.go │ │ ├── zerrors_openbsd_ppc64.go │ │ ├── zerrors_openbsd_riscv64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zerrors_zos_s390x.go │ │ ├── zptrace_armnn_linux.go │ │ ├── zptrace_linux_arm64.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── zptrace_x86_linux.go │ │ ├── zsymaddr_zos_s390x.s │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_freebsd_riscv64.go │ │ ├── zsyscall_illumos_amd64.go │ │ ├── zsyscall_linux.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_loong64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_386.s │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_amd64.s │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm.s │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_arm64.s │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_openbsd_mips64.s │ │ ├── zsyscall_openbsd_ppc64.go │ │ ├── zsyscall_openbsd_ppc64.s │ │ ├── zsyscall_openbsd_riscv64.go │ │ ├── zsyscall_openbsd_riscv64.s │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsyscall_zos_s390x.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysctl_openbsd_arm64.go │ │ ├── zsysctl_openbsd_mips64.go │ │ ├── zsysctl_openbsd_ppc64.go │ │ ├── zsysctl_openbsd_riscv64.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_freebsd_riscv64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_loong64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_openbsd_arm64.go │ │ ├── zsysnum_openbsd_mips64.go │ │ ├── zsysnum_openbsd_ppc64.go │ │ ├── zsysnum_openbsd_riscv64.go │ │ ├── zsysnum_zos_s390x.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_freebsd_riscv64.go │ │ ├── ztypes_linux.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_loong64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ ├── ztypes_openbsd_arm64.go │ │ ├── ztypes_openbsd_mips64.go │ │ ├── ztypes_openbsd_ppc64.go │ │ ├── ztypes_openbsd_riscv64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ └── text │ ├── LICENSE │ ├── PATENTS │ ├── feature │ └── plural │ │ ├── common.go │ │ ├── message.go │ │ ├── plural.go │ │ └── tables.go │ ├── internal │ ├── catmsg │ │ ├── catmsg.go │ │ ├── codec.go │ │ └── varint.go │ ├── format │ │ ├── format.go │ │ └── parser.go │ ├── internal.go │ ├── language │ │ ├── common.go │ │ ├── compact.go │ │ ├── compact │ │ │ ├── compact.go │ │ │ ├── language.go │ │ │ ├── parents.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ ├── compose.go │ │ ├── coverage.go │ │ ├── language.go │ │ ├── lookup.go │ │ ├── match.go │ │ ├── parse.go │ │ ├── tables.go │ │ └── tags.go │ ├── match.go │ ├── number │ │ ├── common.go │ │ ├── decimal.go │ │ ├── format.go │ │ ├── number.go │ │ ├── pattern.go │ │ ├── roundingmode_string.go │ │ └── tables.go │ ├── stringset │ │ └── set.go │ └── tag │ │ └── tag.go │ ├── language │ ├── coverage.go │ ├── doc.go │ ├── language.go │ ├── match.go │ ├── parse.go │ ├── tables.go │ └── tags.go │ └── message │ ├── catalog.go │ ├── catalog │ ├── catalog.go │ ├── dict.go │ ├── go19.go │ └── gopre19.go │ ├── doc.go │ ├── format.go │ ├── message.go │ └── print.go ├── gopkg.in └── yaml.v2 │ ├── .travis.yml │ ├── LICENSE │ ├── LICENSE.libyaml │ ├── NOTICE │ ├── README.md │ ├── apic.go │ ├── decode.go │ ├── emitterc.go │ ├── encode.go │ ├── parserc.go │ ├── readerc.go │ ├── resolve.go │ ├── scannerc.go │ ├── sorter.go │ ├── writerc.go │ ├── yaml.go │ ├── yamlh.go │ └── yamlprivateh.go └── modules.txt /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Go", 3 | "image": "mcr.microsoft.com/devcontainers/go:1.24", 4 | "customizations": { 5 | "codespaces": { 6 | "openFiles": [ 7 | "CODE_OF_CONDUCT.md", 8 | "CONTRIBUTING.md", 9 | "README.md", 10 | "languages.json" 11 | ] 12 | }, 13 | "vscode": { 14 | "extensions": ["golang.go"], 15 | "settings": { 16 | "go.gopath": "/go" 17 | } 18 | } 19 | }, 20 | "remoteUser": "vscode" 21 | } 22 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | .sccignore linguist-language=Ignore-List 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: boyter 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | 15 | 1. Tell us how you were using `scc` either as command line or library. 16 | 2. If command line please list the arguments. If library please supply code to demonstrate the issue. 17 | 3. If the issue is a miscount or some such please link or supply a file which demonstrates the issue. 18 | 19 | **Expected behavior** 20 | A clear and concise description of what you expected to happen. 21 | 22 | **Desktop (please complete the following information):** 23 | - OS: [e.g. macOS, Windows, Linux] 24 | - Version [e.g. 22] 25 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | name: Go 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v5 18 | with: 19 | go-version-file: './go.mod' 20 | 21 | - name: Build 22 | run: go build -v ./... 23 | 24 | - name: Test 25 | run: go test -v ./... 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | scc 11 | 12 | # Output of the go coverage tool, specifically when used with LiteIDE 13 | *.out 14 | 15 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 16 | .glide/ 17 | 18 | # IDE 19 | .idea/ 20 | *.code-workspace 21 | 22 | # Performance tests 23 | examples/performance_tests/0 24 | examples/performance_tests/1 25 | examples/performance_tests/2 26 | examples/performance_tests/3 27 | examples/performance_tests/4 28 | examples/performance_tests/5 29 | examples/performance_tests/6 30 | examples/performance_tests/7 31 | examples/performance_tests/8 32 | 33 | # Ignore test 34 | ignored.xml 35 | gitignorefile.txt 36 | 37 | # macOS 38 | 39 | .DS_Store 40 | 41 | dist/ 42 | -------------------------------------------------------------------------------- /.ignore: -------------------------------------------------------------------------------- 1 | vendor/ 2 | ignorefile.txt -------------------------------------------------------------------------------- /.sccignore: -------------------------------------------------------------------------------- 1 | examples 2 | .github 3 | dist -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## How to contribute to sloc cloc and code (scc) 2 | 3 | #### **Did you find a bug?** 4 | 5 | * **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/boyter/scc/issues). 6 | 7 | * If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/boyter/scc/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. 8 | 9 | #### **Did you write a patch that fixes a bug?** 10 | 11 | * Open a new GitHub pull request with the patch. 12 | 13 | * Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. 14 | 15 | * Before submitting, please specify that you explicitly licence your contribution under MIT licence. 16 | 17 | 18 | #### **Always remember** 19 | 20 | * Do as Bill and Ted and be excellent to each other. 21 | 22 | Thanks! 23 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.24.0-alpine3.20 AS scc-get 2 | 3 | ENV GOOS=linux \ 4 | GOARCH=amd64 \ 5 | CGO_ENABLED=0 6 | 7 | ARG VERSION=v3.4.0 8 | COPY . /scc 9 | WORKDIR /scc 10 | RUN go build -ldflags="-s -w" -o /bin/scc 11 | 12 | FROM alpine:3.20 13 | COPY --from=scc-get /bin/scc /bin/scc 14 | CMD ["/bin/scc"] 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ben Boyter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /cmd/badges/.gitignore: -------------------------------------------------------------------------------- 1 | badges 2 | -------------------------------------------------------------------------------- /examples/complexity/complexity.cpp: -------------------------------------------------------------------------------- 1 | // 4 Complexity 2 | #include 3 | 4 | int main() 5 | { 6 | int i = 0; 7 | while(1) { 8 | std::cin >> i; 9 | if(i == 0) { 10 | return 0; 11 | } 12 | switch(i) { 13 | case 1: 14 | std::cout << "one\n"; 15 | break; 16 | case 2: 17 | std::cout << "two\n"; 18 | break; 19 | case 3: 20 | std::cout << "three\n"; 21 | default: 22 | std::cout << "try again\n"; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /examples/complexity/complexity.java: -------------------------------------------------------------------------------- 1 | printf(" /* "); 2 | for (i = 0; i < 100; i++) { 3 | a += i; 4 | } 5 | printf(" */ "); -------------------------------------------------------------------------------- /examples/countas/test.jsp: -------------------------------------------------------------------------------- 1 | this should be counted as HTML using countas rules -------------------------------------------------------------------------------- /examples/countas/test.new: -------------------------------------------------------------------------------- 1 | this should be counted as java using the countas rules -------------------------------------------------------------------------------- /examples/ignore/.gitignore: -------------------------------------------------------------------------------- 1 | ignore.java -------------------------------------------------------------------------------- /examples/ignore/README.md: -------------------------------------------------------------------------------- 1 | Files in here are to ensure that .ignore and .gitignore work recursively -------------------------------------------------------------------------------- /examples/issue114/.gitignore: -------------------------------------------------------------------------------- 1 | this should be counted as gitignore -------------------------------------------------------------------------------- /examples/issue114/.ignore: -------------------------------------------------------------------------------- 1 | this should be counted as .ignore -------------------------------------------------------------------------------- /examples/issue114/.travis.yml: -------------------------------------------------------------------------------- 1 | this should be a yml file -------------------------------------------------------------------------------- /examples/issue114/java: -------------------------------------------------------------------------------- 1 | This file is not java -------------------------------------------------------------------------------- /examples/issue114/license: -------------------------------------------------------------------------------- 1 | this should be counted as license -------------------------------------------------------------------------------- /examples/issue114/makefile: -------------------------------------------------------------------------------- 1 | this should be counted as a makefile -------------------------------------------------------------------------------- /examples/issue115/.test/file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | 3 | 4 | print "Hello, World\n"; 5 | -------------------------------------------------------------------------------- /examples/issue120/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | print "Hello, World\n"; -------------------------------------------------------------------------------- /examples/issue120/test.java: -------------------------------------------------------------------------------- 1 | this is a java file -------------------------------------------------------------------------------- /examples/issue149/.gitignore: -------------------------------------------------------------------------------- 1 | / -------------------------------------------------------------------------------- /examples/issue152/example.black.css: -------------------------------------------------------------------------------- 1 | this is just to force a css match -------------------------------------------------------------------------------- /examples/issue214/ббббббббббббббббббббббббббббббббб.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/issue214/ббббббббббббббббббббббббббббббббб.md -------------------------------------------------------------------------------- /examples/issue214/ѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬ.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/issue214/ѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬѬ.md -------------------------------------------------------------------------------- /examples/issue214/中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/issue214/中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文中文.md -------------------------------------------------------------------------------- /examples/issue246.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | """ 4 | Docstrings containing an apostrophe (') are handled incorrectly 5 | The line above is counted as code despite being in the middle of a docstring. 6 | The end of docstring flag seems to be changed to an apostrophe, 7 | which means the next line will not exit the docstring. 8 | """ 9 | # Code containing single quotes will exit the docstring, 10 | # but presuming the quotes are balanced the second 11 | # quote will put us in string scanning mode. 12 | if __name__ == '__main__': 13 | print('Hello, World!') 14 | # Not counted as a comment 15 | 16 | # ^ Not counted as a blank line 17 | # Break out of string scanner with unbalanced single quote: ' 18 | exit(0) 19 | -------------------------------------------------------------------------------- /examples/issue260/test.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/issue260/test.c -------------------------------------------------------------------------------- /examples/issue323/a.php: -------------------------------------------------------------------------------- 1 | "yah" 3 | | false -> "nope" -------------------------------------------------------------------------------- /examples/language/GNUMakefile: -------------------------------------------------------------------------------- 1 | gnumakefile -------------------------------------------------------------------------------- /examples/language/Gemfile: -------------------------------------------------------------------------------- 1 | This is a gemfile -------------------------------------------------------------------------------- /examples/language/PostScript.ps: -------------------------------------------------------------------------------- 1 | %!PS 2 | % an example from https://github.com/bwipp/postscriptbarcode/blob/master/contrib/development/emit_c_style_array.ps 3 | 4 | (%stderr) (w) file /f exch def 5 | f (Version: ) writestring f version writestring f (\n) writestring 6 | f (Size: ) writestring f size 10 ( ) cvrs writestring f (\n) writestring 7 | f (ECC: ) writestring f eclevel writestring f (\n) writestring 8 | f (Mask: ) writestring f bestmaskval 2 tobin writestring f (\n) writestring 9 | 0 1 size 1 sub { 10 | /y exch def 11 | 0 1 size 1 sub { 12 | /x exch def 13 | f pixs y size mul x add get 0 eq {(0)}{(1)} ifelse writestring 14 | f (,) writestring 15 | } for 16 | f (\n) writestring 17 | } for 18 | f closefile 19 | -------------------------------------------------------------------------------- /examples/language/Rakefile: -------------------------------------------------------------------------------- 1 | This is a rakefile -------------------------------------------------------------------------------- /examples/language/Sally.yarn: -------------------------------------------------------------------------------- 1 | <> 2 | Player: Hey, Sally. #line:794945 3 | Sally: Oh! Hi. #line:2dc39b 4 | Sally: You snuck up on me. #line:34de2f 5 | Sally: Don't do that. #line:dcc2bc 6 | <> 7 | Player: Hey. #line:a8e70c 8 | Sally: Hi. #line:305cde 9 | <> 10 | 11 | <> 12 | [[Anything exciting happen on your watch?|Sally.Watch]] #line:5d7a7c 13 | <> 14 | 15 | <> 16 | [[Sorry about the console.|Sally.Sorry]] #line:0a7e39 17 | <> 18 | [[See you later.|Sally.Exit]] #line:0facf7 19 | 20 | 21 | <= ($max - 2)>> 22 | I would like a horse please. 23 | <> 24 | <> 25 | <> 26 | Just a drink thanks. 27 | <> 28 | <> 29 | Drat, I can't afford anything. 30 | <> -------------------------------------------------------------------------------- /examples/language/abnf.abnf: -------------------------------------------------------------------------------- 1 | postal-address = name-part street zip-part 2 | 3 | name-part = *(personal-part SP) last-name [SP suffix] CRLF 4 | name-part =/ personal-part CRLF 5 | 6 | personal-part = first-name / (initial ".") 7 | first-name = *ALPHA 8 | initial = ALPHA 9 | last-name = *ALPHA 10 | suffix = ("Jr." / "Sr." / 1*("I" / "V" / "X")) 11 | 12 | street = [apt SP] house-num SP street-name CRLF 13 | apt = 1*4DIGIT 14 | house-num = 1*8(DIGIT / ALPHA) 15 | street-name = 1*VCHAR 16 | 17 | zip-part = town-name "," SP state 1*2SP zip-code CRLF 18 | town-name = 1*(ALPHA / SP) 19 | state = 2ALPHA 20 | zip-code = 5DIGIT ["-" 4DIGIT] -------------------------------------------------------------------------------- /examples/language/alchemist.crn: -------------------------------------------------------------------------------- 1 | _ -> readk + In_n 2 | readk -> init0 + In_k 3 | init0 + k -> r + t + init0 4 | init0 + 0k -> init1 5 | init1 + t -> k + init1 6 | init1 + 0t + r + n -> i + loop0 7 | loop0 + 0n -> Out_r 8 | loop0 + n -> i + loop1 9 | loop1 + k -> r + t + loop1 10 | loop1 + 0k -> loop2 11 | loop2 + t -> k + loop2 12 | loop2 + 0t -> loop3 13 | loop3 + 0i -> loop4 14 | loop3 + i -> loop5 15 | loop4 + t -> i + loop4 16 | loop4 + 0t -> loop3 17 | loop5 + r -> t + loop3 18 | loop5 + 0r -> loop6 19 | loop6 + t -> i + r + loop6 20 | loop6 + 0t -> i + loop0 -------------------------------------------------------------------------------- /examples/language/astro.astro: -------------------------------------------------------------------------------- 1 |

Here are a few facts about me:

2 |
    3 |
  • My name is {identity.firstName}.
  • 4 |
  • I live in {identity.country} and I work as a {identity.occupation}.
  • 5 | {identity.hobbies.length >= 2 && 6 |
  • Two of my hobbies are: {identity.hobbies[0]} and {identity.hobbies[1]}
  • 7 | } 8 |
9 |

My skills are:

10 |
    11 | {skills.map((skill) =>
  • {skill}
  • )} 12 |
-------------------------------------------------------------------------------- /examples/language/bean.beancount: -------------------------------------------------------------------------------- 1 | 2014-02-05 * "Moving money to Isle of Man" ^transfers-offshore-17 2 | Assets:WellsFargo:Savings -40000.00 USD 3 | Assets:WellsFargo:Checking 40000.00 USD 4 | 5 | 2014-02-09 * "Wire to FX broker" ^transfers-offshore-17 6 | Assets:WellsFargo:Checking -40025.00 USD 7 | Expenses:Fees:WireTransfers 25.00 USD 8 | Assets:OANDA:USDollar 40000.00 9 | 10 | 2014-03-16 * "Conversion to offshore beans" ^transfers-offshore-17 11 | Assets:OANDA:USDollar -40000.00 USD 12 | Assets:OANDA:GBPounds 23391.81 GBP @ 1.71 USD 13 | 14 | 2014-03-16 * "God save the Queen (and taxes)" ^transfers-offshore-17 15 | Assets:OANDA:GBPounds -23391.81 GBP 16 | Expenses:Fees:WireTransfers 15.00 GBP 17 | Assets:Brittania:PrivateBanking 23376.81 GBP -------------------------------------------------------------------------------- /examples/language/bitbucket-pipelines.yml: -------------------------------------------------------------------------------- 1 | image: node:10.15.0 2 | 3 | pipelines: 4 | default: 5 | - step: 6 | name: Build and test 7 | script: 8 | - npm install 9 | - npm test 10 | tags: # add the 'tags' section 11 | release-*: # specify the tag 12 | - step: # define the build pipeline for the tag 13 | name: Build and release 14 | script: 15 | - npm install 16 | - npm test 17 | - npm run release 18 | branches: 19 | staging: 20 | - step: 21 | name: Clone 22 | script: 23 | - echo "Clone all the things!" -------------------------------------------------------------------------------- /examples/language/boo.boo: -------------------------------------------------------------------------------- 1 | this should be matched as boo -------------------------------------------------------------------------------- /examples/language/c3.c3: -------------------------------------------------------------------------------- 1 | // This is a comment 2 | import std::io; 3 | 4 | <* 5 | Doc contracts 6 | *> 7 | fn void main() 8 | { 9 | io::printn("Hello, World!"); 10 | } -------------------------------------------------------------------------------- /examples/language/cairo.cairo: -------------------------------------------------------------------------------- 1 | fn main() -> felt252 { 2 | fib(16) 3 | } 4 | 5 | fn fib(mut n: felt252) -> felt252 { 6 | let mut a: felt252 = 0; 7 | let mut b: felt252 = 1; 8 | loop { 9 | if n == 0 { 10 | break a; 11 | } 12 | n = n - 1; 13 | let temp = b; 14 | b = a + b; 15 | a = temp; 16 | } 17 | } 18 | 19 | #[cfg(test)] 20 | mod tests { 21 | use super::fib; 22 | 23 | #[test] 24 | #[available_gas(100000)] 25 | fn it_works() { 26 | assert(fib(16) == 987, 'it works!'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/language/capnproto.capnp: -------------------------------------------------------------------------------- 1 | @0xdbb9ad1f14bf0b36; # unique file ID, generated by `capnp id` 2 | 3 | # Add a comment 4 | struct Person { 5 | name @0 :Text; 6 | birthdate @3 :Date; 7 | 8 | email @1 :Text; 9 | phones @2 :List(PhoneNumber); 10 | 11 | struct PhoneNumber { 12 | number @0 :Text; 13 | type @1 :Type; 14 | 15 | enum Type { 16 | mobile @0; 17 | home @1; 18 | work @2; 19 | } 20 | } 21 | } 22 | 23 | struct Date { 24 | year @0 :Int16; 25 | month @1 :UInt8; 26 | day @2 :UInt8; 27 | } -------------------------------------------------------------------------------- /examples/language/chapel.chpl: -------------------------------------------------------------------------------- 1 | class Integer { 2 | var x:int; 3 | } 4 | proc deferInFunction() { 5 | var c = new unmanaged Integer(1); 6 | writeln("created ", c); 7 | defer { 8 | writeln("defer action: deleting ", c); 9 | delete c; 10 | } 11 | // ... (function body, possibly including return statements) 12 | // The defer action is executed no matter how this function returns. 13 | } 14 | deferInFunction(); -------------------------------------------------------------------------------- /examples/language/circom.circom: -------------------------------------------------------------------------------- 1 | // 34 lines 23 code 7 comments 4 blanks 2 | pragma circom 2.0.8; 3 | 4 | /* 5 | * Sum an array of non-zero values. 6 | */ 7 | function sum(values, size) { 8 | var sum = 0; 9 | for (var i = 0; i < size; i++) { 10 | assert(values[i] != 0); 11 | sum += values[i]; 12 | } 13 | log("sum = ", sum); 14 | return sum; 15 | } 16 | 17 | /* 18 | * Ensure x is a solution to x^5 - 2x^4 + 5x - 4 = 0. 19 | */ 20 | template Polynomial() { 21 | signal input x; 22 | signal x2; 23 | signal x4; 24 | signal x5; 25 | signal output y; 26 | 27 | x2 <== x * x; 28 | x4 <== x2 * x2; 29 | x5 <== x4 * x; 30 | y <== x5 - 2 * x4 + 5 * x - 4; // y = x^5 - 2 * x^4 + 5x - 4. 31 | y === 0; // Ensure that y = 0. 32 | } 33 | 34 | component main = Polynomial(); -------------------------------------------------------------------------------- /examples/language/clojure.cljc: -------------------------------------------------------------------------------- 1 | some code -------------------------------------------------------------------------------- /examples/language/component.templ: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | templ nameList(items []Item) { 4 |
    5 | for _, item := range items { 6 |
  • { item.Name }
  • 7 | } 8 |
9 | } -------------------------------------------------------------------------------- /examples/language/cuda.cu: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // Kernel function to add the elements of two arrays 4 | __global__ 5 | void add(int n, float *x, float *y) 6 | { 7 | for (int i = 0; i < n; i++) 8 | y[i] = x[i] + y[i]; 9 | } 10 | 11 | int main(void) 12 | { 13 | int N = 1<<20; 14 | float *x, *y; 15 | 16 | // Allocate Unified Memory – accessible from CPU or GPU 17 | cudaMallocManaged(&x, N*sizeof(float)); 18 | cudaMallocManaged(&y, N*sizeof(float)); 19 | 20 | // initialize x and y arrays on the host 21 | for (int i = 0; i < N; i++) { 22 | x[i] = 1.0f; 23 | y[i] = 2.0f; 24 | } 25 | 26 | // Run kernel on 1M elements on the GPU 27 | add<<<1, 1>>>(N, x, y); 28 | 29 | // Wait for GPU to finish before accessing on host 30 | cudaDeviceSynchronize(); 31 | 32 | // Check for errors (all values should be 3.0f) 33 | float maxError = 0.0f; 34 | for (int i = 0; i < N; i++) 35 | maxError = fmax(maxError, fabs(y[i]-3.0f)); 36 | std::cout << "Max error: " << maxError << std::endl; 37 | 38 | // Free memory 39 | cudaFree(x); 40 | cudaFree(y); 41 | 42 | return 0; 43 | } -------------------------------------------------------------------------------- /examples/language/daml.daml: -------------------------------------------------------------------------------- 1 | applyFilter (filter : Int -> Int -> Bool) 2 | (x : Int) 3 | (y : Int) = filter x y 4 | 5 | compute = script do 6 | applyFilter (<) 3 2 === False 7 | applyFilter (/=) 3 2 === True 8 | 9 | round (2.5 : Decimal) === 3 10 | round (3.5 : Decimal) === 4 11 | 12 | explode "me" === ["m", "e"] 13 | 14 | applyFilter (\a b -> a /= b) 3 2 === True -------------------------------------------------------------------------------- /examples/language/docker.nu: -------------------------------------------------------------------------------- 1 | # docker wrapper that returns a nushell table 2 | def docker [ 3 | ...args:string # command to be passed to the real docker command 4 | ] { 5 | let data = (^docker $args --format={{json .}}|lines|each {$it|from json}) 6 | if Labels in ($data|get) { 7 | $data|docker labels 8 | } { 9 | $data 10 | } 11 | 12 | } 13 | 14 | # subcommand used to reformat docker labels into their own table 15 | def 'docker labels' [] { 16 | update Labels { 17 | get Labels| 18 | split row ','| 19 | where ($it|str starts-with ' ') == $false| 20 | split column '=' name value 21 | } 22 | } -------------------------------------------------------------------------------- /examples/language/dot.gv: -------------------------------------------------------------------------------- 1 | graph graphname { 2 | // This attribute applies to the graph itself 3 | size="1,1"; 4 | // The label attribute can be used to change the label of a node 5 | a [label="Foo"]; 6 | // Here, the node shape is changed. 7 | b [shape=box]; 8 | // These edges both have different line properties 9 | a -- b -- c [color=blue]; 10 | b -- d [style=dotted]; 11 | // [style=invis] hides a node. 12 | } -------------------------------------------------------------------------------- /examples/language/elixirtemplate.eex: -------------------------------------------------------------------------------- 1 | Hi, <%= name %> 2 | 3 | defmodule Example do 4 | require EEx 5 | EEx.function_from_file(:def, :greeting, "greeting.eex", [:name]) 6 | end -------------------------------------------------------------------------------- /examples/language/elm.elm: -------------------------------------------------------------------------------- 1 | case someBool of 2 | True -> 3 | "yah" 4 | 5 | False -> 6 | "nope" -------------------------------------------------------------------------------- /examples/language/emit.emit: -------------------------------------------------------------------------------- 1 | // emit program 2 | create x = 10; 3 | 4 | x = x - 3; 5 | 6 | create y; 7 | 8 | time strike; 9 | 10 | y kills x; 11 | 12 | create traveler; 13 | 14 | print(x); //timeline 1 - nothing since x is dead. timeline 2 - prints 7 since traveler stopped x from being killed. 15 | 16 | if(x is dead){ 17 | 18 | traveler warps strike{ 19 | traveler kills y; 20 | traveler kills traveler; //kill self, preventing paradoxes by interfering with itself 21 | }; 22 | 23 | }; -------------------------------------------------------------------------------- /examples/language/factor.factor: -------------------------------------------------------------------------------- 1 | ! Written for SCC by CapitalEx 2 | USING: combinators io kernel math.order math.parser random 3 | ranges ; 4 | IN: simple-guessing-game 5 | 6 | : pick-number ( -- n ) 7 | 100 [1..b] random ; 8 | 9 | : read-number ( -- n ) 10 | "Enter a guess: " write readln dec> ; 11 | 12 | : guessing-game ( n -- ) 13 | dup read-number <=> dup { 14 | { +lt+ [ "Too high!" print t ] } 15 | { +gt+ [ "Too low!" print t ] } 16 | [ drop "You won!" print f ] 17 | } case [ guessing-game ] [ drop ] if ; 18 | 19 | MAIN: [ 20 | "I'm thinking of a number between 1 and 100" print 21 | pick-number 22 | guessing-game 23 | ] -------------------------------------------------------------------------------- /examples/language/flow9.flow: -------------------------------------------------------------------------------- 1 | import runtime; 2 | 3 | /* 4 | If we list all the natural numbers below 10 that are multiples of 3 or 5, 5 | we get 3, 5, 6 and 9. The sum of these multiples is 23. 6 | 7 | Find the sum of all the multiples of 3 or 5 below 1000. 8 | */ 9 | 10 | euler1(limit : int) -> int { 11 | foldRange(1, limit - 1, 0, \acc, i -> { 12 | if (i % 3 == 0 || i % 5 == 0) { 13 | acc + i; 14 | } else acc; 15 | }); 16 | } 17 | 18 | main() { 19 | println(euler1(1000)); // Correct: 233168 20 | quit(0); 21 | } 22 | -------------------------------------------------------------------------------- /examples/language/fxml.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /examples/language/gleam.gleam: -------------------------------------------------------------------------------- 1 | import gleam/int 2 | import gleam/io 3 | 4 | pub fn main() { 5 | let x = int.random(2) 6 | let y = int.random(2) 7 | io.debug(x) 8 | io.debug(y) 9 | 10 | let result = case x, y { 11 | 0, 0 -> "Both are zero" 12 | 0, _ -> "First is zero" 13 | _, 0 -> "Second is zero" 14 | _, _ -> "Neither are zero" 15 | } 16 | io.debug(result) 17 | } -------------------------------------------------------------------------------- /examples/language/go.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "fmt" 4 | 5 | // This is a comment 6 | /** 7 | another comment 8 | **/ 9 | 10 | // Msg function 11 | func Msg() { 12 | 13 | } 14 | 15 | func main() { 16 | fmt.Println("hw") 17 | } 18 | 19 | // This is a comment 20 | -------------------------------------------------------------------------------- /examples/language/godot.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=4 format=3 uid="uid://bam4cbdd6h24e"] 2 | 3 | [ext_resource type="Texture2D" uid="uid://dw1aad3whrra0" path="res://assets/sprites/cavesofgallet_tiles.png" id="1_27u2s"] 4 | 5 | [sub_resource type="RectangleShape2D" id="RectangleShape2D_2rh4h"] 6 | size = Vector2(9, 1) 7 | 8 | [sub_resource type="OccluderPolygon2D" id="OccluderPolygon2D_72i7s"] 9 | polygon = PackedVector2Array(-4, 0, 4, 0, 4, -1, -4, -1) 10 | 11 | [node name="Sprite2D" type="Sprite2D"] 12 | texture = ExtResource("1_27u2s") 13 | region_enabled = true 14 | region_rect = Rect2(49, 8, 9, 1) 15 | 16 | [node name="StaticBody2D" type="StaticBody2D" parent="."] 17 | 18 | [node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"] 19 | shape = SubResource("RectangleShape2D_2rh4h") 20 | one_way_collision = true 21 | 22 | [node name="LightOccluder2D" type="LightOccluder2D" parent="."] 23 | position = Vector2(0, 1) 24 | occluder = SubResource("OccluderPolygon2D_72i7s") -------------------------------------------------------------------------------- /examples/language/goplus.gop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/gop run 2 | 3 | // test 4 | import ( 5 | "fmt" 6 | "sync" 7 | ) 8 | 9 | func collatz(num int32) []int32 { 10 | if num <= 0 { 11 | panic("num must not be zero") /* collatz sequence needs num >= 0 */ 12 | } 13 | var res []int32 14 | res <- num 15 | for num > 1 { 16 | if num&1 == 0 { 17 | num /= 2 18 | res <- num 19 | } else { 20 | num *= 3 21 | num++ 22 | res <- num 23 | } 24 | } 25 | return res 26 | } 27 | 28 | var wg sync.WaitGroup 29 | 30 | for i in [int32(i) for i in 1:11] { 31 | wg.Add(1) 32 | go func(ii int32) { 33 | defer wg.Done() 34 | println i, ":", collatz(ii) 35 | }(i) 36 | } 37 | wg.Wait() 38 | -------------------------------------------------------------------------------- /examples/language/gwion.gw: -------------------------------------------------------------------------------- 1 | #import Std 2 | #import Math 3 | #import Modules 4 | 5 | fun int get_ncycles() { 6 | if(me.args()) 7 | return me.arg(0) => Std.atoi; 8 | return 2; 9 | } 10 | 11 | fun float get_user_duration() { 12 | if(me.args() > 1) 13 | return me.arg(1) => Std.atof; 14 | return 1; 15 | } 16 | 17 | fun dur get_duration() { 18 | return get_user_duration()::second; 19 | } 20 | 21 | 22 | get_ncycles() :=> const int ncycles; 23 | get_duration() :=> var dur duration; 24 | 25 | 1 :=> var int compensate; 26 | const SinOsc s ~> dac; 27 | 28 | while(duration >= samp) { 29 | repeat(ncycles * compensate) { 30 | Math.rand2f(220, 880) :=> s.freq; 31 | duration => now; 32 | } 33 | duration/2. :=> duration; 34 | 2 *=> compensate; 35 | } 36 | -------------------------------------------------------------------------------- /examples/language/haml.haml: -------------------------------------------------------------------------------- 1 | # file: app/controllers/movies_controller.rb 2 | 3 | class MoviesController < ApplicationController 4 | def index 5 | @title = "Teen Wolf" 6 | end 7 | end 8 | 9 | -# file: app/views/movies/index.html.haml 10 | 11 | #content 12 | .title 13 | %h1= @title 14 | = link_to 'Home', home_url -------------------------------------------------------------------------------- /examples/language/hare.ha: -------------------------------------------------------------------------------- 1 | use fmt; 2 | use strings; 3 | 4 | export type error = !str; 5 | 6 | type example = struct { 7 | number: i64, 8 | error: error, 9 | }; 10 | 11 | fn function(a: i32, b: i32) i32 = a + b; 12 | 13 | export fn main() void = { 14 | for (true) { 15 | break; 16 | }; 17 | 18 | const string = "A string"; // a comment 19 | const another_string = `aaa`; 20 | let iter = strings::iter(string); 21 | 22 | let r = match (strings::next(&iter)) { 23 | case void => return; 24 | case let r: rune => 25 | // comment 26 | yield r; 27 | }; 28 | 29 | switch (r) { 30 | case 'a' => 31 | abort(); 32 | case => 33 | if (r != 'd') fmt::println("not d!")! else fmt::println("d!")!; 34 | }; 35 | 36 | for (let i = 0z; i <= 10; i += 1) { 37 | fmt::print(i, ' ')!; 38 | }; 39 | }; 40 | -------------------------------------------------------------------------------- /examples/language/ini.ini: -------------------------------------------------------------------------------- 1 | ; last modified 1 April 2001 by John Doe 2 | [owner] 3 | name = John Doe 4 | organization = Acme Widgets Inc. 5 | 6 | [database] 7 | ; use IP address in case network name resolution is not working 8 | server = 192.0.2.62 9 | port = 143 10 | file = "payroll.dat" 11 | -------------------------------------------------------------------------------- /examples/language/javascript.js: -------------------------------------------------------------------------------- 1 | class Person { 2 | constructor(name) { 3 | this.name = name; 4 | } 5 | } 6 | 7 | class Student extends Person { 8 | constructor(name, id) { 9 | super(name); 10 | this.id = id; 11 | } 12 | } 13 | 14 | function PrintName(student) { 15 | console.log(student.name); 16 | } 17 | 18 | function PrintID(student) { 19 | console.log(student.id); 20 | } 21 | 22 | const bob = new Student("Robert", 12345); 23 | PrintName(bob) // Robert 24 | PrintID(bob) // 12345 25 | -------------------------------------------------------------------------------- /examples/language/jq.jq: -------------------------------------------------------------------------------- 1 | # Use gojq for infinite precision integer arithmetic 2 | def tobase($b): 3 | def digit: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[.:.+1]; 4 | def mod: . % $b; 5 | def div: ((. - mod) / $b); 6 | def digits: recurse( select(. >= $b) | div) | mod ; 7 | 8 | select(2 <= $b and $b <= 36) 9 | | [digits | digit] | reverse | add; 10 | 11 | def send_more_money: 12 | def choose(m;n;used): ([range(m;n+1)] - used)[]; 13 | def num(a;b;c;d): 1000*a + 100*b + 10*c + d; 14 | def num(a;b;c;d;e): 10*num(a;b;c;d) + e; 15 | first( 16 | 1 as $m 17 | | 0 as $o 18 | | choose(8;9;[]) as $s 19 | | choose(2;9;[$s]) as $e 20 | | choose(2;9;[$s,$e]) as $n 21 | | choose(2;9;[$s,$e,$n]) as $d 22 | | choose(2;9;[$s,$e,$n,$d]) as $r 23 | | choose(2;9;[$s,$e,$n,$d,$r]) as $y 24 | | select(num($s;$e;$n;$d) + num($m;$o;$r;$e) == 25 | num($m;$o;$n;$e;$y)) 26 | | [$s,$e,$n,$d,$m,$o,$r,$e,$m,$o,$n,$e,$y] ); -------------------------------------------------------------------------------- /examples/language/jsonc.jsonc: -------------------------------------------------------------------------------- 1 | // Line comment 2 | { 3 | /* 4 | * Multi 5 | * Line 6 | * Comment 7 | */ 8 | "text": "JSON with comments" 9 | } 10 | -------------------------------------------------------------------------------- /examples/language/jsonnet.jsonnet: -------------------------------------------------------------------------------- 1 | local foo = "bar"; 2 | 3 | // This is a comment 4 | # This is another comment 5 | /* 6 | * This is a bigger comment 7 | */ 8 | 9 | { 10 | local bar = "foo", 11 | 12 | array: [ 13 | "foo", 14 | "bar", 15 | 123, 16 | { foo: "bar" }, 17 | ], 18 | 19 | number: 3e10, 20 | anotherNumber: 3.14, 21 | yetAnotherNumber: 4, 22 | bool: true, 23 | 24 | f:: function(x) x > 0, 25 | 26 | object: { 27 | foo: $.f(1) || $.f(-1), 28 | bar: if std.objectHas(self, "foo") then "foo" else "bar", 29 | another: { 30 | foo: self["bar.bar"], 31 | }, 32 | } + { 33 | another+: { 34 | "bar.bar": ||| 35 | foo 36 | %(bar)s 37 | ||| % $.object, 38 | }, 39 | }, 40 | } 41 | -------------------------------------------------------------------------------- /examples/language/kitchen-sink.json5: -------------------------------------------------------------------------------- 1 | // example from https://json5.org/ 2 | { 3 | // comments 4 | unquoted: 'and you can quote me on that', 5 | singleQuotes: 'I can use "double quotes" here', 6 | lineBreaks: "Look, Mom! \ 7 | No \\n's!", 8 | hexadecimal: 0xdecaf, 9 | leadingDecimalPoint: .8675309, andTrailing: 8675309., 10 | positiveSign: +1, 11 | trailingComma: 'in objects', andIn: ['arrays',], 12 | "backwardsCompatible": "with JSON", 13 | } 14 | -------------------------------------------------------------------------------- /examples/language/koto.koto: -------------------------------------------------------------------------------- 1 | get_primes = |n: Number| -> Iterator 2 | if n <= 1 3 | return 4 | 5 | sieve = [] 6 | sieve.resize (n + 1), true 7 | 8 | for x in 2..=n.sqrt() 9 | if sieve[x] 10 | i = x * x 11 | while i <= n 12 | sieve[i] = false 13 | i += x 14 | 15 | (2..=n).keep |x| sieve[x] 16 | 17 | assert_eq (get_primes 20).to_tuple(), (2, 3, 5, 7, 11, 13, 17, 19) -------------------------------------------------------------------------------- /examples/language/lalrpop.lalrpop: -------------------------------------------------------------------------------- 1 | // 37 lines 26 code 3 comments 8 blanks 2 | use crate::ast::{ExprSymbol, Opcode}; 3 | use crate::tok9::Tok; 4 | 5 | grammar<'input>(input: &'input str); 6 | 7 | // line comment 8 | pub Expr: Box> = { // comment 1 9 | Expr r##"verbatim2"## Factor => Box::new(ExprSymbol::Op(<>)), 10 | Factor, // comment 2 11 | }; 12 | 13 | Factor: Box> = { // comment 3 14 | Factor "FactorOp" Term => Box::new(ExprSymbol::Op(<>)), 15 | Term, 16 | }; 17 | 18 | // comment 4 19 | 20 | Term: Box> = { 21 | r#"verbatim"# => Box::new(ExprSymbol::NumSymbol(<>)), 22 | "(" ")" 23 | }; 24 | 25 | extern { 26 | type Location = usize; 27 | type Error = (); 28 | 29 | enum Tok<'input> { 30 | r#"verbatim"# => Tok::NumSymbol(<&'input str>), 31 | "FactorOp" => Tok::FactorOp(), 32 | r##"verbatim2"## => Tok::ExprOp(), 33 | "(" => Tok::ParenOpen, 34 | ")" => Tok::ParenClose, 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /examples/language/license: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/language/license -------------------------------------------------------------------------------- /examples/language/linear_solve.fut: -------------------------------------------------------------------------------- 1 | -- Solving a linear system using Gauss-Jordan elimination without pivoting. 2 | -- 3 | -- Taken from https://www.cs.cmu.edu/~scandal/nesl/alg-numerical.html#solve 4 | -- 5 | -- == 6 | -- input { [[1.0f32, 2.0f32, 1.0f32], [2.0f32, 1.0f32, 1.0f32], [1.0f32, 1.0f32, 2.0f32]] 7 | -- [1.0f32, 2.0f32, 3.0f32] } 8 | -- output { [0.5f32, -0.5f32, 1.5f32] } 9 | 10 | let Gauss_Jordan [n][m] (A: [n][m]f32): [n][m]f32 = 11 | loop (A) for i < n do 12 | let irow = A[0] 13 | let Ap = A[1:n] 14 | let v1 = irow[i] 15 | let irow = map (/v1) irow 16 | let Ap = map (\jrow -> 17 | let scale = jrow[i] 18 | in map2 (\x y -> y - scale * x) irow jrow) 19 | Ap 20 | in concat Ap ([irow]) 21 | 22 | let linear_solve [n][m] (A: [n][m]f32) (b: [n]f32): [n]f32 = 23 | -- Pad the matrix with b. 24 | let Ap = map2 (++) A (transpose [b]) 25 | let Ap' = Gauss_Jordan Ap 26 | -- Extract last column. 27 | in Ap'[0:n,m] 28 | 29 | let main [n][m] (A: [n][m]f32) (b: [n]f32): [n]f32 = linear_solve A b -------------------------------------------------------------------------------- /examples/language/livescript.ls: -------------------------------------------------------------------------------- 1 | # Easy listing of implicit objects 2 | table1 = 3 | * id: 1 4 | name: 'george' 5 | * id: 2 6 | name: 'mike' 7 | * id: 3 8 | name: 'donald' 9 | 10 | 11 | 12 | 13 | 14 | table2 = 15 | * id: 2 16 | age: 21 17 | * id: 1 18 | age: 20 19 | * id: 3 20 | age: 26 21 | 22 | 23 | 24 | 25 | # Implicit access, accessignment 26 | up-case-name = (.name .= to-upper-case!) 27 | 28 | # List comprehensions, destructuring, piping 29 | [{id:id1, name, age} for {id:id1, name} in table1 30 | for {id:id2, age} in table2 31 | when id1 is id2] 32 | |> sort-by (.id) # using 'sort-by' from prelude.ls 33 | |> each up-case-name # using 'each' from prelude.ls 34 | |> JSON.stringify 35 | #=> 36 | #[{"id":1,"name":"GEORGE","age":20}, 37 | # {"id":2,"name":"MIKE", "age":21}, 38 | # {"id":3,"name":"DONALD","age":26}] 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | # operators as functions, piping 51 | map (.age), table2 |> fold1 (+) 52 | #=> 67 ('fold1' and 'map' from prelude.ls) -------------------------------------------------------------------------------- /examples/language/llvmir.ll: -------------------------------------------------------------------------------- 1 | ; f returns the sum of the given operands. 2 | define i32 @f(i32 %x, i32 %y) { 3 | %result = add i32 %x, %y 4 | ret i32 %result 5 | } -------------------------------------------------------------------------------- /examples/language/lua.lua: -------------------------------------------------------------------------------- 1 | -- lua test 2 | 3 | local function f(a) 4 | for i = 1, a do 5 | io.write(a .. " x " .. i .. " = " .. (i*a)) 6 | if i ~= a then 7 | io.write(', ') 8 | end 9 | end 10 | print() 11 | end 12 | 13 | for i = 1, 9 do 14 | f(i) 15 | end 16 | -------------------------------------------------------------------------------- /examples/language/luau.luau: -------------------------------------------------------------------------------- 1 | -- test for luau 2 | 3 | local function f(a: number): string 4 | local res = "" 5 | for i = 1, a do 6 | res = res .. (a .. " x " .. i .. " = " .. (i*a)) 7 | if i ~= a then 8 | res = res .. (', ') 9 | end 10 | end 11 | return res 12 | end 13 | 14 | for i = 1, 9 do 15 | print(f(i)) 16 | end 17 | -------------------------------------------------------------------------------- /examples/language/luna.luna: -------------------------------------------------------------------------------- 1 | def barify t: 'bar ' + t.toText + ' bar' 2 | 3 | # This is a comment 4 | reportedValue = case myNumber of 5 | Just v -> 'Got a number ' + v.toText + '.' 6 | Nothing -> 'Did not get a number.' 7 | print reportedValue 8 | 9 | 10 | class Shape: 11 | Circle: 12 | radius :: Real 13 | Rectangle: 14 | width :: Real 15 | height :: Real 16 | 17 | def perimeter: case self of 18 | Circle r: 2.0 * pi * r 19 | Rectangle w h: 2.0 * w + 2.0 * h 20 | 21 | def area: case self of 22 | Circle r: pi * r * r 23 | Rectangle w h: w * h -------------------------------------------------------------------------------- /examples/language/main.cj: -------------------------------------------------------------------------------- 1 | import std.sync.* 2 | import std.time.* 3 | import std.collection.* 4 | 5 | let count = AtomicInt64(0) 6 | 7 | main(): Int64 { 8 | let list = ArrayList>() 9 | 10 | // create 1000 threads. 11 | for (i in 0..1000) { 12 | let fut = spawn { 13 | sleep(Duration.millisecond) // sleep for 1ms. 14 | count.fetchAdd(1) 15 | } 16 | list.append(fut) 17 | } 18 | 19 | // Wait for all threads finished. 20 | for (f in list) { 21 | f.get() 22 | } 23 | 24 | let val = count.load() 25 | println("count = ${val}") 26 | return 0 27 | } 28 | -------------------------------------------------------------------------------- /examples/language/makefile: -------------------------------------------------------------------------------- 1 | makefile -------------------------------------------------------------------------------- /examples/language/moonbit.mbt: -------------------------------------------------------------------------------- 1 | fn iter(data : Bytes) -> Iter[Byte] { 2 | Iter::new( 3 | fn(yield) { 4 | // The code that actually does the iteration 5 | ///////////////////////////////////////////// 6 | for i = 0, len = data.length(); i < len; i = i + 1 { 7 | if yield(data[i]) == IterEnd { 8 | break IterEnd 9 | } 10 | ///////////////////////////////////////////// 11 | } else { 12 | IterContinue 13 | } 14 | }, 15 | ) 16 | } -------------------------------------------------------------------------------- /examples/language/nawk.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/nawk -f 2 | 3 | BEGIN { 4 | print("Enter string to encode:") 5 | } 6 | 7 | { 8 | print("Encoded string:") 9 | print(rot13($0)) 10 | } 11 | 12 | function rot13(str, new, idx) { 13 | new = "" 14 | for (idx = 1; idx <= length; ++idx) { 15 | new = new rot13_impl(substr(str, idx, 1)) 16 | } 17 | return new 18 | } 19 | 20 | function rot13_impl(ch, list, idx) { 21 | list = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" 22 | idx = index(list, ch) 23 | if (idx == 0) { 24 | return ch 25 | } else { 26 | return substr(list, idx + 13, 1) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /examples/language/perl.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | for($i=1; $i<10; $i++){ 4 | for($j=1; $j<$i+1; $j++){ 5 | printf "%-4s%-2d ", "$j*$i=", $i*$j; 6 | } 7 | print "\n"; 8 | } 9 | -------------------------------------------------------------------------------- /examples/language/python.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | 4 | for i in range(1, 10): 5 | for j in range(1, i+1): 6 | print(f"{i}x{j}={i*j}", end=' ') 7 | else: 8 | print() 9 | -------------------------------------------------------------------------------- /examples/language/qsharp.qs: -------------------------------------------------------------------------------- 1 | operation BellTest (count : Int, initial: Result) : (Int, Int, Int) { 2 | mutable numOnes = 0; 3 | mutable agree = 0; 4 | using ((q0, q1) = (Qubit(), Qubit())) { 5 | for (test in 1..count) 6 | { 7 | Set (initial, q0); 8 | Set (Zero, q1); 9 | 10 | H(q0); 11 | CNOT(q0,q1); 12 | let res = M (q0); 13 | 14 | if (M (q1) == res) { 15 | set agree += 1; 16 | } 17 | 18 | // Count the number of ones we saw: 19 | if (res == One) { 20 | set numOnes += 1; 21 | } 22 | 23 | } 24 | 25 | Set(Zero, q0); 26 | Set(Zero, q1); 27 | } 28 | 29 | // Return number of times we saw a |0> and number of times we saw a |1> 30 | return (count-numOnes, numOnes, agree); 31 | } -------------------------------------------------------------------------------- /examples/language/rscript.r: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env Rscript 2 | 3 | print("===== Start =====") 4 | 5 | for (i in 1:9) { 6 | for (j in 1:i) { 7 | cat(i, 'x', j, '=', i*j, ' ') 8 | } 9 | cat('\n') 10 | } 11 | 12 | print("===== End =====") 13 | -------------------------------------------------------------------------------- /examples/language/scallop.scl: -------------------------------------------------------------------------------- 1 | // There are three classes 2 | rel classes = {0, 1, 2} 3 | 4 | // There are 6 students, 2 in each class 5 | rel student = { 6 | (0, "tom"), (0, "jenny"), // Class 0 7 | (1, "alice"), (1, "bob"), // Class 1 8 | (2, "jerry"), (2, "john"), // Class 2 9 | } 10 | 11 | // Each student is enrolled in a course (Math or CS) 12 | rel enroll = { 13 | ("tom", "CS"), ("jenny", "Math"), // Class 0 14 | ("alice", "CS"), ("bob", "CS"), // Class 1 15 | ("jerry", "Math"), ("john", "Math"), // Class 2 16 | } 17 | 18 | // Count how many student enrolls in CS course in each class 19 | rel count_enroll_cs_in_class(c, n) :- 20 | n = count(s: student(c, s), enroll(s, "CS") where c: classes(c)) 21 | 22 | // Expected: {(0, 1), (1, 2), (2, 0)} 23 | // Interpretation: class 0 has 1 student enroll in CS, class 1 has 2, class 2 has 0 24 | query count_enroll_cs_in_class -------------------------------------------------------------------------------- /examples/language/slang.slang: -------------------------------------------------------------------------------- 1 | // 15 lines 8 code 4 comments 2 blanks 2 | 3 | Texture2D in_tex; 4 | RWTexture2D out_tex; 5 | 6 | // Blit compute shader 7 | [shader("compute")] 8 | [numthreads(8, 8, 1)] 9 | void main(uint2 id: SV_DispatchThreadID) { 10 | /* 11 | Perform the blit 12 | */ 13 | out_tex[id] = in_tex[id]; 14 | return; 15 | } -------------------------------------------------------------------------------- /examples/language/tact.tact: -------------------------------------------------------------------------------- 1 | // 20 lines 12 code 4 comments 4 blanks 2 | 3 | import "@stdlib/ownable"; // comment 4 | 5 | /* comment */ 6 | fun global() { 7 | let str: String = "\n \r \t \u1234 \xFF // /* ... */"; 8 | 9 | // comment 10 | while (true) { // comment 11 | if /* comment */ (true) { /* comment */ } 12 | } 13 | } 14 | 15 | // "quoted" 16 | struct St { /* " */ 17 | field1: Int; // /* 18 | field2: Int as uint128; 19 | field3: Int; // */ 20 | } 21 | -------------------------------------------------------------------------------- /examples/language/teal.teal: -------------------------------------------------------------------------------- 1 | #pragma version 4 2 | // loop 1 - 10 3 | // init loop var 4 | int 0 5 | loop: 6 | int 1 7 | + 8 | dup 9 | // implement loop code 10 | // ... 11 | // check upper bound 12 | int 10 13 | <= 14 | bnz loop 15 | // once the loop exits, the last counter value will be left on stack -------------------------------------------------------------------------------- /examples/language/tera.tera: -------------------------------------------------------------------------------- 1 | {% set map = section.pages | group_by(attribute="year") %} 2 | {% set_global years = [] %} 3 | {% for year, ignored in map %} 4 | {% set_global years = years | concat(with=year) %} 5 | {% endfor %} 6 | {% for year in years | reverse %} 7 | {% set posts = map[year] %} 8 | {% endfor %} -------------------------------------------------------------------------------- /examples/language/test.ch: -------------------------------------------------------------------------------- 1 | /* 2 | Constants and macro definitions for the program 3 | https://github.com/boyter/scc/issues/484 4 | */ 5 | 6 | // Define a constant for the number to calculate factorial 7 | #define NUM_TO_FACTORIAL 5 8 | 9 | // Define messages to display 10 | #define MSG_FACT_GT_100 "Factorial is greater than 100" 11 | #define MSG_FACT_LE_100 "Factorial is less than or equal to 100" 12 | 13 | // Define a macro for maximum factorial limit 14 | #define MAX_FACT_LIMIT 100 15 | 16 | // Prototype for the Factorial function 17 | FUNCTION Factorial( n ) 18 | RETURN NIL 19 | 20 | // Prototype for the Main function 21 | FUNCTION Main() 22 | RETURN NIL -------------------------------------------------------------------------------- /examples/language/test.dm: -------------------------------------------------------------------------------- 1 | // A singleline comment 2 | /* 3 | A multiline comment 4 | /* 5 | Nested multiline 6 | */ 7 | */ 8 | 9 | /proc/foo() 10 | for(var/turf/station/T in world) 11 | if(T.name == "floor") 12 | del(T) 13 | T.color = "red" 14 | 15 | /turf/station 16 | icon = 'station.dmi' 17 | icon_state = "wall" 18 | var/description = {" 19 | Multiline 20 | string 21 | "} 22 | -------------------------------------------------------------------------------- /examples/language/test.prg: -------------------------------------------------------------------------------- 1 | /* 2 | This program demonstrates the calculation 3 | of the factorial of a number using a function. 4 | 5 | https://github.com/boyter/scc/issues/484 6 | */ 7 | 8 | FUNCTION Factorial( n ) 9 | LOCAL result := 1 10 | LOCAL i 11 | 12 | // Loop from 1 to n 13 | FOR i := 1 TO n 14 | result := result * i 15 | NEXT 16 | 17 | RETURN result 18 | 19 | // Main program execution starts here 20 | FUNCTION Main() 21 | LOCAL num := 5 22 | LOCAL fact 23 | 24 | // Calculate the factorial of the number 25 | fact := Factorial( num ) 26 | 27 | // Check if the factorial is greater than 100 28 | IF fact > 100 29 | ? "Factorial is greater than 100" 30 | ELSE 31 | ? "Factorial is less than or equal to 100" 32 | ENDIF 33 | 34 | RETURN -------------------------------------------------------------------------------- /examples/language/test.tf: -------------------------------------------------------------------------------- 1 | # This is a comment 2 | // This is another comment 3 | 4 | /* This is a 5 | multiline 6 | comment 7 | */ 8 | 9 | provider "null" {} 10 | 11 | locals { 12 | list = [for i, v in ["foo", "bar"] : v if v == "foo"] 13 | map = { for k, v in { "a" = "foo", "b" = "bar" } : v => k } 14 | } 15 | 16 | resource "null_resource" "count" { 17 | count = 2 18 | 19 | triggers = { 20 | conditional = 1 < 2 || 2 <= 3 && "a" == "c" ? "foo" : "bar" 21 | conditional2 = 1 > 2 || 2 >= 3 && "a" != "c" ? "foo" : "bar" 22 | } 23 | 24 | provisioner "local-exec" { 25 | command = "echo ${join(" ", local.list)}" 26 | } 27 | } 28 | 29 | resource "null_resource" "foreach" { 30 | for_each = toset(local.map) 31 | } 32 | -------------------------------------------------------------------------------- /examples/language/test.tofu: -------------------------------------------------------------------------------- 1 | # This is a comment 2 | // This is another comment 3 | 4 | /* This is a 5 | multiline 6 | comment 7 | */ 8 | 9 | provider "null" {} 10 | 11 | locals { 12 | list = [for i, v in ["foo", "bar"] : v if v == "foo"] 13 | map = { for k, v in { "a" = "foo", "b" = "bar" } : v => k } 14 | } 15 | 16 | resource "null_resource" "count" { 17 | count = 2 18 | 19 | triggers = { 20 | conditional = 1 < 2 || 2 <= 3 && "a" == "c" ? "foo" : "bar" 21 | conditional2 = 1 > 2 || 2 >= 3 && "a" != "c" ? "foo" : "bar" 22 | } 23 | 24 | provisioner "local-exec" { 25 | command = "echo ${join(" ", local.list)}" 26 | } 27 | } 28 | 29 | resource "null_resource" "foreach" { 30 | for_each = toset(local.map) 31 | } 32 | -------------------------------------------------------------------------------- /examples/language/textile.textile: -------------------------------------------------------------------------------- 1 | ###. -*- mode: textile; -*- 2 | 3 | See ["Textile":https://textile-lang.com]. 4 | 5 | ###.. //////////////// 6 | // Local Variables: 7 | // coding: utf-8-unix 8 | // End: 9 | ////////////////////// -------------------------------------------------------------------------------- /examples/language/typescript.ts: -------------------------------------------------------------------------------- 1 | const url = `/foo/bar/*`; 2 | 3 | function getUrl(path?: string): string { 4 | return path ?? url; 5 | } 6 | 7 | function getUrl2() { 8 | return url; 9 | } 10 | -------------------------------------------------------------------------------- /examples/language/typespec.tsp: -------------------------------------------------------------------------------- 1 | import "@typespec/http"; 2 | 3 | using TypeSpec.Http; 4 | 5 | model Store { 6 | name: string; 7 | address: Address; 8 | } 9 | 10 | model Address { 11 | street: string; 12 | city: string; 13 | } 14 | 15 | @route("/stores") 16 | interface Stores { 17 | list(@query filter: string): Store[]; 18 | read(@path id: Store): Store; 19 | } -------------------------------------------------------------------------------- /examples/language/typst.typ: -------------------------------------------------------------------------------- 1 | // 16 lines 9 code 3 comments 4 blanks 2 | 3 | // Some example settings 4 | #set document(title: "a title", author: "an author") 5 | #set page(numbering: "1 / 1", number-align: center) 6 | #set par(justify: true) 7 | #set text(size: 13pt, lang: "fr") // with a trailing comment 8 | #set heading(numbering: "1.1") /* with another trailing comment */ 9 | 10 | #let foo = "multiline 11 | string" 12 | 13 | #let bar = "singleline string" 14 | 15 | /* comment */ /* nested /* comment */ */ 16 | #lorem(50) -------------------------------------------------------------------------------- /examples/language/up.up: -------------------------------------------------------------------------------- 1 | // func => function definition keyword (reserved word) 2 | // function_a => function name (user-defined) 3 | // int1 => parameter name (user-defined) 4 | // [variable_name]: int => parameter data type (int is a reserved word) 5 | // [function] -> string => return data type (string is a reserved word) 6 | // nilStr => variable name (user-defined) 7 | // "nil" => variable value (user-defined) 8 | func function_a(int1: int) -> string { 9 | nilStr = "nil" 10 | return nilStr + int1 11 | } 12 | 13 | // func => function definition keyword (reserved word) 14 | // integer_mul => function name (user-defined) 15 | // integer => parameter name (user-defined) 16 | // [variable_name]: int => parameter data type (int is a reserved word) 17 | // [function] -> int => return data type (int is a reserved word) 18 | func integer_mul(integer: int) -> int { 19 | return integer * 2 20 | } 21 | 22 | func main() -> nil { 23 | print(function_a(3) + integer_mul()) 24 | } -------------------------------------------------------------------------------- /examples/language/vala.vala: -------------------------------------------------------------------------------- 1 | // test for vala 2 | 3 | class Demo.Demo : GLib.Object { 4 | public static int main(string[] args) { 5 | int[] arr = {1, 2, 3, 4, 5, 6, 7, 8, 9}; 6 | foreach (var i in arr) { 7 | foreach (var j in arr[0:i]) { 8 | var n = i * j; 9 | stdout.printf(@"$j * $i = $n "); 10 | } 11 | stdout.printf("\n"); 12 | } 13 | stdout.printf(""" 14 | Test for "verbatim strings". 15 | \r \n \a \b 16 | """); 17 | stdout.printf("\n"); 18 | return 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/language/wenyan.wy: -------------------------------------------------------------------------------- 1 | 批曰。「「文氣淋灕。字句切實」」。 2 | 吾有一言。曰「「春日宴。」」。書之。 3 | 有數九。名之曰「酒數」。 4 | 5 | 恆為是。若「酒數」等於零者乃止也。 6 | 7 | 吾有三言。曰「「與君」」。曰「酒數」。 8 | 曰「「杯酒。可以窮歡宴。綠酒一杯歌一遍。」」。書之。 9 | 10 | 減「酒數」以一。昔之「酒數」者。今其是矣云云。 11 | 12 | 吾有一言。曰「「綠酒千杯腸已爛。」」。書之。 -------------------------------------------------------------------------------- /examples/language/wsdl.wsdl: -------------------------------------------------------------------------------- 1 | this is a wsdl file -------------------------------------------------------------------------------- /examples/language/xmake.lua: -------------------------------------------------------------------------------- 1 | set_project("test-project") 2 | 3 | set_version("0.1.0") 4 | 5 | set_xmakever("2.9.9") 6 | 7 | set_allowedplats("windows") 8 | set_allowedmodes("debug", "release", "releasedbg") 9 | 10 | includes("src", "xmake", "test") 11 | 12 | -- fixed config 13 | set_languages("c++20") 14 | add_rules("mode.debug", "mode.release", "mode.releasedbg") 15 | 16 | if is_mode("debug") then 17 | add_defines("LIBRARY_DEBUG") 18 | elseif is_mode("release") then 19 | set_optimize("smallest") 20 | end 21 | 22 | if is_plat("windows") then 23 | add_defines("UNICODE", "_UNICODE") 24 | add_cxflags("/permissive-", {tools = "cl"}) 25 | end 26 | 27 | set_encodings("utf-8") 28 | 29 | -- dynamic config 30 | if has_config("dev") then 31 | set_policy("compatibility.version", "3.0") 32 | 33 | set_warnings("all") 34 | 35 | if is_plat("windows") then 36 | set_runtimes("MD") 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /examples/language/xmlschema.xsd: -------------------------------------------------------------------------------- 1 | something -------------------------------------------------------------------------------- /examples/language/zig.zig: -------------------------------------------------------------------------------- 1 | const std = @import("std"); 2 | const print = std.debug.print; 3 | 4 | pub fn main() void { 5 | const arr = [_]u32{1, 2, 3, 4, 5, 6, 7, 8, 9}; 6 | for (arr) |m| { 7 | var n: u32 = 1; 8 | while (n <= m) : (n += 1) { 9 | print("{} x {} = {}, ", .{n, m, n*m}); 10 | } 11 | print("\n", .{}); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/language/zokrates.zok: -------------------------------------------------------------------------------- 1 | /* 2 | This is a multi-line comment 3 | written in more than just one line. 4 | */ 5 | 6 | def main() -> field { 7 | // an inline comment 8 | 9 | u32 mut res = 0; 10 | for u32 i in 0..4 { 11 | for u32 j in i..5 { 12 | res = res + i; 13 | } 14 | } 15 | return res; 16 | } -------------------------------------------------------------------------------- /examples/long/test.feature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/long/test.feature -------------------------------------------------------------------------------- /examples/long/test.ftl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/long/test.ftl -------------------------------------------------------------------------------- /examples/long/test.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/long/test.jsp -------------------------------------------------------------------------------- /examples/long/test.mxml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/long/test.mxml -------------------------------------------------------------------------------- /examples/long/test.rdl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/long/test.rdl -------------------------------------------------------------------------------- /examples/long/test.vcl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/long/test.vcl -------------------------------------------------------------------------------- /examples/long/test.xslt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/long/test.xslt -------------------------------------------------------------------------------- /examples/nolines.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/examples/nolines.py -------------------------------------------------------------------------------- /examples/oneline.py: -------------------------------------------------------------------------------- 1 | import this -------------------------------------------------------------------------------- /examples/onenewline.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/remap/java.java: -------------------------------------------------------------------------------- 1 | this is java but has this marker -*- C++ -*- so should be counted as C Header when remap is on -------------------------------------------------------------------------------- /examples/remap/unknown: -------------------------------------------------------------------------------- 1 | this is unknown but has this marker -*- C++ -*- so should be counted as C Header when remap is on -------------------------------------------------------------------------------- /examples/symlink/link.py: -------------------------------------------------------------------------------- 1 | test.py -------------------------------------------------------------------------------- /examples/symlink/link2.py: -------------------------------------------------------------------------------- 1 | link.py -------------------------------------------------------------------------------- /examples/symlink/link3.py: -------------------------------------------------------------------------------- 1 | link2.py -------------------------------------------------------------------------------- /examples/symlink/link4.py: -------------------------------------------------------------------------------- 1 | link3.py -------------------------------------------------------------------------------- /examples/symlink/test.py: -------------------------------------------------------------------------------- 1 | # this is a comment. 2 | 3 | import os 4 | 5 | for e in os.scandir('.'): 6 | if e.is_file(): 7 | print(e) 8 | -------------------------------------------------------------------------------- /examples/threenewline.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /examples/twolines.py: -------------------------------------------------------------------------------- 1 | import this 2 | print this -------------------------------------------------------------------------------- /examples/twonewline.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/boyter/scc/v3 2 | 3 | go 1.24.0 4 | 5 | require ( 6 | github.com/boyter/gocodewalker v1.4.0 7 | github.com/boyter/simplecache v0.0.0-20250113230110-8a4c9201822a 8 | github.com/json-iterator/go v1.1.12 9 | github.com/mattn/go-runewidth v0.0.16 10 | github.com/rs/zerolog v1.30.0 11 | github.com/spf13/cobra v1.8.1 12 | golang.org/x/crypto v0.35.0 13 | golang.org/x/text v0.22.0 14 | gopkg.in/yaml.v2 v2.4.0 15 | ) 16 | 17 | require ( 18 | github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect 19 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 20 | github.com/mattn/go-colorable v0.1.13 // indirect 21 | github.com/mattn/go-isatty v0.0.19 // indirect 22 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect 23 | github.com/modern-go/reflect2 v1.0.2 // indirect 24 | github.com/rivo/uniseg v0.4.7 // indirect 25 | github.com/spf13/pflag v1.0.6 // indirect 26 | golang.org/x/sync v0.11.0 // indirect 27 | golang.org/x/sys v0.30.0 // indirect 28 | ) 29 | -------------------------------------------------------------------------------- /packages/aur/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Ben Boyter 2 | pkgname=scc 3 | pkgver=2.10.1 4 | pkgrel=1 5 | pkgdesc="Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go" 6 | arch=('x86_64' 'i386') 7 | url="https://github.com/boyter/scc" 8 | license=('MIT') 9 | source=(https://github.com/boyter/scc/releases/download/v$pkgver/scc-$pkgver-$arch-unknown-linux.zip) 10 | sha256sums=('663da4a750fd4f0f3d9328dd58f6850c46f458f94258c04b78b630e47d667ff8') 11 | 12 | package() { 13 | mkdir -p $pkgdir/usr/bin 14 | cp $srcdir/scc $pkgdir/usr/bin 15 | } 16 | -------------------------------------------------------------------------------- /packages/chocolatey/ReadMe.md: -------------------------------------------------------------------------------- 1 | # Instructions 2 | ## Build 3 | ```bash 4 | cpack 5 | ``` 6 | 7 | ## Install 8 | ```bash 9 | chocolatey install scc -fdv -s "'.;https://chocolatey.org/api/v2/'" --version x.y.z 10 | ``` 11 | -------------------------------------------------------------------------------- /packages/chocolatey/tools/VERIFICATION.txt: -------------------------------------------------------------------------------- 1 | VERIFICATION 2 | Verification is intended to assist the Chocolatey moderators and community 3 | in verifying that this package's contents are trustworthy. 4 | 5 | I am the author of this package and the application. 6 | 7 | -------------------------------------------------------------------------------- /performance-over-time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/performance-over-time.png -------------------------------------------------------------------------------- /processor/cocomo_test.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package processor 4 | 5 | import ( 6 | "testing" 7 | ) 8 | 9 | func TestEstimateCost(t *testing.T) { 10 | eff := EstimateEffort(26, 1) 11 | got := EstimateCost(eff, 56000, 2.4) 12 | 13 | // Should be around 582 14 | if got < 580 || got > 585 { 15 | t.Errorf("Got %f", got) 16 | } 17 | } 18 | 19 | func TestEstimateCostManyLines(t *testing.T) { 20 | eff := EstimateEffort(77873, 1) 21 | got := EstimateCost(eff, 56000, 2.4) 22 | 23 | // Should be around 2602096 24 | if got < 2602000 || got > 2602100 { 25 | t.Errorf("Got %f", got) 26 | } 27 | } 28 | 29 | func TestEstimateScheduleMonths(t *testing.T) { 30 | eff := EstimateEffort(537, 1) 31 | got := EstimateScheduleMonths(eff) 32 | 33 | // Should be around 2.7 34 | if got < 2.6 || got > 2.8 { 35 | t.Errorf("Got %f", got) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /processor/helpers.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package processor 4 | 5 | import ( 6 | "time" 7 | ) 8 | 9 | // Returns the current time as a millisecond timestamp 10 | func makeTimestampMilli() int64 { 11 | return time.Now().UnixMilli() 12 | } 13 | 14 | // Returns the current time as a nanosecond timestamp as some things 15 | // are far too fast to measure using nanoseconds 16 | func makeTimestampNano() int64 { 17 | return time.Now().UnixNano() 18 | } 19 | -------------------------------------------------------------------------------- /processor/helpers_test.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package processor 4 | 5 | import ( 6 | "testing" 7 | "time" 8 | ) 9 | 10 | func TestMakeTimestampNano(t *testing.T) { 11 | res := makeTimestampNano() 12 | time.Sleep(5 * time.Nanosecond) 13 | 14 | if res == makeTimestampNano() { 15 | t.Error("Should not match") 16 | } 17 | } 18 | 19 | func TestMakeTimestampMilli(t *testing.T) { 20 | res := makeTimestampMilli() 21 | time.Sleep(5 * time.Millisecond) 22 | 23 | if res == makeTimestampMilli() { 24 | t.Error("Should not match") 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /scc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/scc.jpg -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | 17 | .idea 18 | dist/ 19 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/.ignore: -------------------------------------------------------------------------------- 1 | / 2 | go-gitignore -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License Copyright (c) 2021 Ben Boyter 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/Makefile: -------------------------------------------------------------------------------- 1 | # Some people have gotestsum installed and like it so use it if it exists 2 | HAS_GOTESTSUM := $(shell which gotestsum) 3 | ifdef HAS_GOTESTSUM 4 | TEST_CMD = gotestsum --format testname --packages="./..." -- -count=1 -tags=integration -v -p 1 5 | else 6 | TEST_CMD = go test ./... --count=1 -tags=integration 7 | endif 8 | 9 | lint: 10 | @golangci-lint run --disable-all --enable gci --fix 11 | @golangci-lint run 12 | 13 | test: 14 | @$(TEST_CMD) 15 | 16 | test-run: 17 | @$(TEST_CMD) -run=$(RUN) 18 | 19 | fuzz: 20 | go test -fuzz=FuzzTestGitIgnore -fuzztime 30s 21 | 22 | test-coverage: 23 | go test ./... -coverprofile coverage.out && go tool cover -html=coverage.out -o coverage.html 24 | 25 | mod: 26 | @go mod tidy 27 | @go mod vendor 28 | 29 | clean: 30 | go clean -modcache 31 | 32 | all: mod lint test fuzz 33 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/dir_suffix.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gocodewalker 4 | 5 | import ( 6 | "path/filepath" 7 | "strings" 8 | ) 9 | 10 | // isSuffixDir returns true if base ends with suffix. Suffix "/" will be trimmed. 11 | // suffix must be a valid sub dir of base. 12 | // For examples: 13 | // - isSuffixDir("a", "a") returns true 14 | // - isSuffixDir("a/b/c", "c") returns true 15 | // - isSuffixDir("a/b/c", "b/c") returns true 16 | // - isSuffixDir("a/b/c", "b") returns false 17 | // - isSuffixDir("a/b/c", "a/b") returns false, "a/b" is a valid sub dir but not at the end of "a/b/c" 18 | // - isSuffixDir("a/bb/c", "b/c") returns false 19 | func isSuffixDir(base string, suffix string) bool { 20 | if base == "" || suffix == "" { 21 | return false 22 | } 23 | base = strings.TrimSuffix(filepath.ToSlash(base), "/") 24 | suffix = strings.TrimSuffix(filepath.ToSlash(suffix), "/") 25 | newBase := strings.TrimSuffix(base, suffix) 26 | if newBase == base { 27 | return false 28 | } 29 | return strings.HasSuffix(newBase, "/") || newBase == "" 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/gitmodule.go: -------------------------------------------------------------------------------- 1 | package gocodewalker 2 | 3 | import ( 4 | "regexp" 5 | "strings" 6 | ) 7 | 8 | func extractGitModuleFolders(input string) []string { 9 | // Compile a regular expression to match lines starting with "path =" 10 | re := regexp.MustCompile(`^\s*path\s*=\s*(.*)`) 11 | output := []string{} 12 | 13 | for _, line := range strings.Split(input, "\n") { 14 | // Check if the line matches the "path = " pattern 15 | if matches := re.FindStringSubmatch(line); matches != nil { 16 | // Extract the submodule path (which is captured in the regex group) 17 | submodulePath := strings.TrimSpace(matches[1]) 18 | output = append(output, submodulePath) 19 | } 20 | } 21 | 22 | return output 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/doc.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | /* 4 | Package gitignore provides an interface for parsing .gitignore files, 5 | either individually, or within a repository, and 6 | matching paths against the retrieved patterns. Path matching is done using 7 | fnmatch as specified by git (see https://git-scm.com/docs/gitignore), with 8 | support for recursive matching via the "**" pattern. 9 | */ 10 | package gitignore 11 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/error.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | type Error interface { 6 | error 7 | 8 | // Position returns the position of the error within the .gitignore file 9 | // (if any) 10 | Position() Position 11 | 12 | // Underlying returns the underlying error, permitting direct comparison 13 | // against the wrapped error. 14 | Underlying() error 15 | } 16 | 17 | type err struct { 18 | error 19 | _position Position 20 | } // err() 21 | 22 | // NewError returns a new Error instance for the given error e and position p. 23 | func NewError(e error, p Position) Error { 24 | return &err{error: e, _position: p} 25 | } // NewError() 26 | 27 | func (e *err) Position() Position { return e._position } 28 | 29 | func (e *err) Underlying() error { return e.error } 30 | 31 | // ensure err satisfies the Error interface 32 | var _ Error = &err{} 33 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/errors.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | var ( 10 | CarriageReturnError = errors.New("unexpected carriage return '\\r'") 11 | InvalidPatternError = errors.New("invalid pattern") 12 | InvalidDirectoryError = errors.New("invalid directory") 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/exclude.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | // exclude attempts to return the GitIgnore instance for the 11 | // $GIT_DIR/info/exclude from the working copy to which path belongs. 12 | func exclude(path string) (GitIgnore, error) { 13 | // attempt to locate GIT_DIR 14 | _gitdir := os.Getenv("GIT_DIR") 15 | if _gitdir == "" { 16 | _gitdir = filepath.Join(path, ".git") 17 | } 18 | _info, _err := os.Stat(_gitdir) 19 | if _err != nil { 20 | if os.IsNotExist(_err) { 21 | return nil, nil 22 | } else { 23 | return nil, _err 24 | } 25 | } else if !_info.IsDir() { 26 | return nil, nil 27 | } 28 | 29 | // is there an info/exclude file within this directory? 30 | _file := filepath.Join(_gitdir, "info", "exclude") 31 | _, _err = os.Stat(_file) 32 | if _err != nil { 33 | if os.IsNotExist(_err) { 34 | return nil, nil 35 | } else { 36 | return nil, _err 37 | } 38 | } 39 | 40 | // attempt to load the exclude file 41 | return NewFromFile(_file) 42 | } // exclude() 43 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/match.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | // Match represents the interface of successful matches against a .gitignore 6 | // pattern set. A Match can be queried to determine whether the matched path 7 | // should be ignored or included (i.e. was the path matched by a negated 8 | // pattern), and to extract the position of the pattern within the .gitignore, 9 | // and a string representation of the pattern. 10 | type Match interface { 11 | // Ignore returns true if the match pattern describes files or paths that 12 | // should be ignored. 13 | Ignore() bool 14 | 15 | // Include returns true if the match pattern describes files or paths that 16 | // should be included. 17 | Include() bool 18 | 19 | // String returns a string representation of the matched pattern. 20 | String() string 21 | 22 | // Position returns the position in the .gitignore file at which the 23 | // matching pattern was defined. 24 | Position() Position 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/position.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | import ( 6 | "fmt" 7 | ) 8 | 9 | // Position represents the position of the .gitignore parser, and the position 10 | // of a .gitignore pattern within the parsed stream. 11 | type Position struct { 12 | File string 13 | Line int 14 | Column int 15 | Offset int 16 | } 17 | 18 | // String returns a string representation of the current position. 19 | func (p Position) String() string { 20 | _prefix := "" 21 | if p.File != "" { 22 | _prefix = p.File + ": " 23 | } 24 | 25 | if p.Line == 0 { 26 | return fmt.Sprintf("%s+%d", _prefix, p.Offset) 27 | } else if p.Column == 0 { 28 | return fmt.Sprintf("%s%d", _prefix, p.Line) 29 | } else { 30 | return fmt.Sprintf("%s%d:%d", _prefix, p.Line, p.Column) 31 | } 32 | } // String() 33 | 34 | // Zero returns true if the Position represents the zero Position 35 | func (p Position) Zero() bool { 36 | return p.Line+p.Column+p.Offset == 0 37 | } // Zero() 38 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/rune.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | const ( 6 | // define the sentinel runes of the lexer 7 | _EOF = rune(0) 8 | _CR = rune('\r') 9 | _NEWLINE = rune('\n') 10 | _COMMENT = rune('#') 11 | _SEPARATOR = rune('/') 12 | _ESCAPE = rune('\\') 13 | _SPACE = rune(' ') 14 | _TAB = rune('\t') 15 | _NEGATION = rune('!') 16 | _WILDCARD = rune('*') 17 | ) 18 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/tokenset.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | // tokenset represents an ordered list of Tokens 6 | type tokenset []*Token 7 | 8 | // String() returns a concatenated string of all runes represented by the 9 | // list of tokens. 10 | func (t tokenset) String() string { 11 | // concatenate the tokens into a single string 12 | _rtn := "" 13 | for _, _t := range []*Token(t) { 14 | _rtn = _rtn + _t.Token() 15 | } 16 | return _rtn 17 | } // String() 18 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/go-gitignore/tokentype.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gitignore 4 | 5 | type TokenType int 6 | 7 | const ( 8 | ILLEGAL TokenType = iota 9 | EOF 10 | EOL 11 | WHITESPACE 12 | COMMENT 13 | SEPARATOR 14 | NEGATION 15 | PATTERN 16 | ANY 17 | BAD 18 | ) 19 | 20 | // String returns a string representation of the Token type. 21 | func (t TokenType) String() string { 22 | switch t { 23 | case ILLEGAL: 24 | return "ILLEGAL" 25 | case EOF: 26 | return "EOF" 27 | case EOL: 28 | return "EOL" 29 | case WHITESPACE: 30 | return "WHITESPACE" 31 | case COMMENT: 32 | return "COMMENT" 33 | case SEPARATOR: 34 | return "SEPARATOR" 35 | case NEGATION: 36 | return "NEGATION" 37 | case PATTERN: 38 | return "PATTERN" 39 | case ANY: 40 | return "ANY" 41 | default: 42 | return "BAD TOKEN" 43 | } 44 | } // String() 45 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/hidden.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | //go:build !windows 3 | // +build !windows 4 | 5 | package gocodewalker 6 | 7 | import ( 8 | "io/fs" 9 | "os" 10 | ) 11 | 12 | // IsHidden Returns true if file is hidden 13 | func IsHidden(file os.FileInfo, directory string) (bool, error) { 14 | return IsHiddenDirEntry(fs.FileInfoToDirEntry(file), directory) 15 | } 16 | 17 | // IsHiddenDirEntry is similar to [IsHidden], excepts it accepts [fs.DirEntry] as its argument 18 | func IsHiddenDirEntry(file fs.DirEntry, directory string) (bool, error) { 19 | return file.Name()[0:1] == ".", nil 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/gocodewalker/hidden_windows.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | //go:build windows 3 | // +build windows 4 | 5 | package gocodewalker 6 | 7 | import ( 8 | "io/fs" 9 | "os" 10 | "path" 11 | "syscall" 12 | ) 13 | 14 | // IsHidden Returns true if file is hidden 15 | func IsHidden(file os.FileInfo, directory string) (bool, error) { 16 | return IsHiddenDirEntry(fs.FileInfoToDirEntry(file), directory) 17 | } 18 | 19 | // IsHiddenDirEntry is similar to [IsHidden], excepts it accepts [fs.DirEntry] as its argument 20 | func IsHiddenDirEntry(file fs.DirEntry, directory string) (bool, error) { 21 | fullpath := path.Join(directory, file.Name()) 22 | pointer, err := syscall.UTF16PtrFromString(fullpath) 23 | if err != nil { 24 | return false, err 25 | } 26 | attributes, err := syscall.GetFileAttributes(pointer) 27 | if err != nil { 28 | return false, err 29 | } 30 | return attributes&syscall.FILE_ATTRIBUTE_HIDDEN != 0, nil 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/boyter/simplecache/.gitignore: -------------------------------------------------------------------------------- 1 | .idea -------------------------------------------------------------------------------- /vendor/github.com/boyter/simplecache/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ben Boyter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/danwakefield/fnmatch/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | -------------------------------------------------------------------------------- /vendor/github.com/danwakefield/fnmatch/README.md: -------------------------------------------------------------------------------- 1 | # fnmatch 2 | Updated clone of kballards golang fnmatch gist (https://gist.github.com/kballard/272720) 3 | 4 | 5 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/README.md: -------------------------------------------------------------------------------- 1 | # mousetrap 2 | 3 | mousetrap is a tiny library that answers a single question. 4 | 5 | On a Windows machine, was the process invoked by someone double clicking on 6 | the executable file while browsing in explorer? 7 | 8 | ### Motivation 9 | 10 | Windows developers unfamiliar with command line tools will often "double-click" 11 | the executable for a tool. Because most CLI tools print the help and then exit 12 | when invoked without arguments, this is often very frustrating for those users. 13 | 14 | mousetrap provides a way to detect these invocations so that you can provide 15 | more helpful behavior and instructions on how to run the CLI tool. To see what 16 | this looks like, both from an organizational and a technical perspective, see 17 | https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/ 18 | 19 | ### The interface 20 | 21 | The library exposes a single interface: 22 | 23 | func StartedByExplorer() (bool) 24 | -------------------------------------------------------------------------------- /vendor/github.com/inconshreveable/mousetrap/trap_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package mousetrap 5 | 6 | // StartedByExplorer returns true if the program was invoked by the user 7 | // double-clicking on the executable from explorer.exe 8 | // 9 | // It is conservative and returns false if any of the internal calls fail. 10 | // It does not guarantee that the program was run from a terminal. It only can tell you 11 | // whether it was launched from explorer.exe 12 | // 13 | // On non-Windows platforms, it always returns false. 14 | func StartedByExplorer() bool { 15 | return false 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/.codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "output_tests/.*" 3 | 4 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /bug_test.go 3 | /coverage.txt 4 | /.idea 5 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8.x 5 | - 1.x 6 | 7 | before_install: 8 | - go get -t -v ./... 9 | 10 | script: 11 | - ./test.sh 12 | 13 | after_success: 14 | - bash <(curl -s https://codecov.io/bash) 15 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [[projects]] 5 | name = "github.com/modern-go/concurrent" 6 | packages = ["."] 7 | revision = "e0a39a4cb4216ea8db28e22a69f4ec25610d513a" 8 | version = "1.0.0" 9 | 10 | [[projects]] 11 | name = "github.com/modern-go/reflect2" 12 | packages = ["."] 13 | revision = "4b7aa43c6742a2c18fdef89dd197aaae7dac7ccd" 14 | version = "1.0.1" 15 | 16 | [solve-meta] 17 | analyzer-name = "dep" 18 | analyzer-version = 1 19 | inputs-digest = "ea54a775e5a354cb015502d2e7aa4b74230fc77e894f34a838b268c25ec8eeb8" 20 | solver-name = "gps-cdcl" 21 | solver-version = 1 22 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | 22 | ignored = ["github.com/davecgh/go-spew*","github.com/google/gofuzz*","github.com/stretchr/testify*"] 23 | 24 | [[constraint]] 25 | name = "github.com/modern-go/reflect2" 26 | version = "1.0.1" 27 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 json-iterator 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | set -x 4 | 5 | if [ ! -d /tmp/build-golang/src/github.com/json-iterator ]; then 6 | mkdir -p /tmp/build-golang/src/github.com/json-iterator 7 | ln -s $PWD /tmp/build-golang/src/github.com/json-iterator/go 8 | fi 9 | export GOPATH=/tmp/build-golang 10 | go get -u github.com/golang/dep/cmd/dep 11 | cd /tmp/build-golang/src/github.com/json-iterator/go 12 | exec $GOPATH/bin/dep ensure -update 13 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/fuzzy_mode_convert_table.md: -------------------------------------------------------------------------------- 1 | | json type \ dest type | bool | int | uint | float |string| 2 | | --- | --- | --- | --- |--|--| 3 | | number | positive => true
negative => true
zero => false| 23.2 => 23
-32.1 => -32| 12.1 => 12
-12.1 => 0|as normal|same as origin| 4 | | string | empty string => false
string "0" => false
other strings => true | "123.32" => 123
"-123.4" => -123
"123.23xxxw" => 123
"abcde12" => 0
"-32.1" => -32| 13.2 => 13
-1.1 => 0 |12.1 => 12.1
-12.3 => -12.3
12.4xxa => 12.4
+1.1e2 =>110 |same as origin| 5 | | bool | true => true
false => false| true => 1
false => 0 | true => 1
false => 0 |true => 1
false => 0|true => "true"
false => "false"| 6 | | object | true | 0 | 0 |0|originnal json| 7 | | array | empty array => false
nonempty array => true| [] => 0
[1,2] => 1 | [] => 0
[1,2] => 1 |[] => 0
[1,2] => 1|original json| -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/jsoniter.go: -------------------------------------------------------------------------------- 1 | // Package jsoniter implements encoding and decoding of JSON as defined in 2 | // RFC 4627 and provides interfaces with identical syntax of standard lib encoding/json. 3 | // Converting from encoding/json to jsoniter is no more than replacing the package with jsoniter 4 | // and variable type declarations (if any). 5 | // jsoniter interfaces gives 100% compatibility with code using standard lib. 6 | // 7 | // "JSON and Go" 8 | // (https://golang.org/doc/articles/json_and_go.html) 9 | // gives a description of how Marshal/Unmarshal operate 10 | // between arbitrary or predefined json objects and bytes, 11 | // and it applies to jsoniter.Marshal/Unmarshal as well. 12 | // 13 | // Besides, jsoniter.Iterator provides a different set of interfaces 14 | // iterating given bytes/string/reader 15 | // and yielding parsed elements one by one. 16 | // This set of interfaces reads input as required and gives 17 | // better performance. 18 | package jsoniter 19 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/pool.go: -------------------------------------------------------------------------------- 1 | package jsoniter 2 | 3 | import ( 4 | "io" 5 | ) 6 | 7 | // IteratorPool a thread safe pool of iterators with same configuration 8 | type IteratorPool interface { 9 | BorrowIterator(data []byte) *Iterator 10 | ReturnIterator(iter *Iterator) 11 | } 12 | 13 | // StreamPool a thread safe pool of streams with same configuration 14 | type StreamPool interface { 15 | BorrowStream(writer io.Writer) *Stream 16 | ReturnStream(stream *Stream) 17 | } 18 | 19 | func (cfg *frozenConfig) BorrowStream(writer io.Writer) *Stream { 20 | stream := cfg.streamPool.Get().(*Stream) 21 | stream.Reset(writer) 22 | return stream 23 | } 24 | 25 | func (cfg *frozenConfig) ReturnStream(stream *Stream) { 26 | stream.out = nil 27 | stream.Error = nil 28 | stream.Attachment = nil 29 | cfg.streamPool.Put(stream) 30 | } 31 | 32 | func (cfg *frozenConfig) BorrowIterator(data []byte) *Iterator { 33 | iter := cfg.iteratorPool.Get().(*Iterator) 34 | iter.ResetBytes(data) 35 | return iter 36 | } 37 | 38 | func (cfg *frozenConfig) ReturnIterator(iter *Iterator) { 39 | iter.Error = nil 40 | iter.Attachment = nil 41 | cfg.iteratorPool.Put(iter) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/json-iterator/go/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/json-iterator/go $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_appengine.go: -------------------------------------------------------------------------------- 1 | //go:build appengine 2 | // +build appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows && !appengine 2 | // +build !windows,!appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build appengine || js || nacl || wasm 2 | // +build appengine js nacl wasm 3 | 4 | package isatty 5 | 6 | // IsTerminal returns true if the file descriptor is terminal which 7 | // is always false on js and appengine classic which is a sandboxed PaaS. 8 | func IsTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | 12 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 13 | // terminal. This is also always false on this environment. 14 | func IsCygwinTerminal(fd uintptr) bool { 15 | return false 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine 2 | // +build linux aix zos 3 | // +build !appengine 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/README.md: -------------------------------------------------------------------------------- 1 | go-runewidth 2 | ============ 3 | 4 | [![Build Status](https://github.com/mattn/go-runewidth/workflows/test/badge.svg?branch=master)](https://github.com/mattn/go-runewidth/actions?query=workflow%3Atest) 5 | [![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth) 6 | [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) 7 | [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) 8 | 9 | Provides functions to get fixed width of the character or string. 10 | 11 | Usage 12 | ----- 13 | 14 | ```go 15 | runewidth.StringWidth("つのだ☆HIRO") == 12 16 | ``` 17 | 18 | 19 | Author 20 | ------ 21 | 22 | Yasuhiro Matsumoto 23 | 24 | License 25 | ------- 26 | 27 | under the MIT License: http://mattn.mit-license.org/2013 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_appengine.go: -------------------------------------------------------------------------------- 1 | //go:build appengine 2 | // +build appengine 3 | 4 | package runewidth 5 | 6 | // IsEastAsian return true if the current locale is CJK 7 | func IsEastAsian() bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | //go:build js && !appengine 2 | // +build js,!appengine 3 | 4 | package runewidth 5 | 6 | func IsEastAsian() bool { 7 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows && !appengine 2 | // +build windows,!appengine 3 | 4 | package runewidth 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | var ( 11 | kernel32 = syscall.NewLazyDLL("kernel32") 12 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 13 | ) 14 | 15 | // IsEastAsian return true if the current locale is CJK 16 | func IsEastAsian() bool { 17 | r1, _, _ := procGetConsoleOutputCP.Call() 18 | if r1 == 0 { 19 | return false 20 | } 21 | 22 | switch int(r1) { 23 | case 932, 51932, 936, 949, 950: 24 | return true 25 | } 26 | 27 | return false 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/.gitignore: -------------------------------------------------------------------------------- 1 | /coverage.txt 2 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.8.x 5 | - 1.x 6 | 7 | before_install: 8 | - go get -t -v ./... 9 | 10 | script: 11 | - ./test.sh 12 | 13 | after_success: 14 | - bash <(curl -s https://codecov.io/bash) 15 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/executor.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import "context" 4 | 5 | // Executor replace go keyword to start a new goroutine 6 | // the goroutine should cancel itself if the context passed in has been cancelled 7 | // the goroutine started by the executor, is owned by the executor 8 | // we can cancel all executors owned by the executor just by stop the executor itself 9 | // however Executor interface does not Stop method, the one starting and owning executor 10 | // should use the concrete type of executor, instead of this interface. 11 | type Executor interface { 12 | // Go starts a new goroutine controlled by the context 13 | Go(handler func(ctx context.Context)) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | // Map is a wrapper for sync.Map introduced in go1.9 8 | type Map struct { 9 | sync.Map 10 | } 11 | 12 | // NewMap creates a thread safe Map 13 | func NewMap() *Map { 14 | return &Map{} 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/go_below_19.go: -------------------------------------------------------------------------------- 1 | //+build !go1.9 2 | 3 | package concurrent 4 | 5 | import "sync" 6 | 7 | // Map implements a thread safe map for go version below 1.9 using mutex 8 | type Map struct { 9 | lock sync.RWMutex 10 | data map[interface{}]interface{} 11 | } 12 | 13 | // NewMap creates a thread safe map 14 | func NewMap() *Map { 15 | return &Map{ 16 | data: make(map[interface{}]interface{}, 32), 17 | } 18 | } 19 | 20 | // Load is same as sync.Map Load 21 | func (m *Map) Load(key interface{}) (elem interface{}, found bool) { 22 | m.lock.RLock() 23 | elem, found = m.data[key] 24 | m.lock.RUnlock() 25 | return 26 | } 27 | 28 | // Load is same as sync.Map Store 29 | func (m *Map) Store(key interface{}, elem interface{}) { 30 | m.lock.Lock() 31 | m.data[key] = elem 32 | m.lock.Unlock() 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/log.go: -------------------------------------------------------------------------------- 1 | package concurrent 2 | 3 | import ( 4 | "os" 5 | "log" 6 | "io/ioutil" 7 | ) 8 | 9 | // ErrorLogger is used to print out error, can be set to writer other than stderr 10 | var ErrorLogger = log.New(os.Stderr, "", 0) 11 | 12 | // InfoLogger is used to print informational message, default to off 13 | var InfoLogger = log.New(ioutil.Discard, "", 0) -------------------------------------------------------------------------------- /vendor/github.com/modern-go/concurrent/test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -coverprofile=profile.out -coverpkg=github.com/modern-go/concurrent $d 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor 2 | /coverage.txt 3 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.9.x 5 | - 1.x 6 | 7 | before_install: 8 | - go get -t -v ./... 9 | - go get -t -v github.com/modern-go/reflect2-tests/... 10 | 11 | script: 12 | - ./test.sh 13 | 14 | after_success: 15 | - bash <(curl -s https://codecov.io/bash) 16 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/Gopkg.lock: -------------------------------------------------------------------------------- 1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. 2 | 3 | 4 | [solve-meta] 5 | analyzer-name = "dep" 6 | analyzer-version = 1 7 | input-imports = [] 8 | solver-name = "gps-cdcl" 9 | solver-version = 1 10 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/Gopkg.toml: -------------------------------------------------------------------------------- 1 | # Gopkg.toml example 2 | # 3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html 4 | # for detailed Gopkg.toml documentation. 5 | # 6 | # required = ["github.com/user/thing/cmd/thing"] 7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] 8 | # 9 | # [[constraint]] 10 | # name = "github.com/user/project" 11 | # version = "1.0.0" 12 | # 13 | # [[constraint]] 14 | # name = "github.com/user/project2" 15 | # branch = "dev" 16 | # source = "github.com/myfork/project2" 17 | # 18 | # [[override]] 19 | # name = "github.com/x/y" 20 | # version = "2.4.0" 21 | # 22 | # [prune] 23 | # non-go = false 24 | # go-tests = true 25 | # unused-packages = true 26 | 27 | ignored = [] 28 | 29 | [prune] 30 | go-tests = true 31 | unused-packages = true 32 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_118.go: -------------------------------------------------------------------------------- 1 | //+build go1.18 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // m escapes into the return value, but the caller of mapiterinit 10 | // doesn't let the return value escape. 11 | //go:noescape 12 | //go:linkname mapiterinit reflect.mapiterinit 13 | func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer, it *hiter) 14 | 15 | func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { 16 | var it hiter 17 | mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj), &it) 18 | return &UnsafeMapIterator{ 19 | hiter: &it, 20 | pKeyRType: type2.pKeyRType, 21 | pElemRType: type2.pElemRType, 22 | } 23 | } -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_above_19.go: -------------------------------------------------------------------------------- 1 | //+build go1.9 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | //go:linkname resolveTypeOff reflect.resolveTypeOff 10 | func resolveTypeOff(rtype unsafe.Pointer, off int32) unsafe.Pointer 11 | 12 | //go:linkname makemap reflect.makemap 13 | func makemap(rtype unsafe.Pointer, cap int) (m unsafe.Pointer) 14 | 15 | func makeMapWithSize(rtype unsafe.Pointer, cap int) unsafe.Pointer { 16 | return makemap(rtype, cap) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/go_below_118.go: -------------------------------------------------------------------------------- 1 | //+build !go1.18 2 | 3 | package reflect2 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | // m escapes into the return value, but the caller of mapiterinit 10 | // doesn't let the return value escape. 11 | //go:noescape 12 | //go:linkname mapiterinit reflect.mapiterinit 13 | func mapiterinit(rtype unsafe.Pointer, m unsafe.Pointer) (val *hiter) 14 | 15 | func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator { 16 | return &UnsafeMapIterator{ 17 | hiter: mapiterinit(type2.rtype, *(*unsafe.Pointer)(obj)), 18 | pKeyRType: type2.pKeyRType, 19 | pElemRType: type2.pElemRType, 20 | } 21 | } -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/reflect2_amd64.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/reflect2_amd64.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/reflect2_kind.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | import ( 4 | "reflect" 5 | "unsafe" 6 | ) 7 | 8 | // DefaultTypeOfKind return the non aliased default type for the kind 9 | func DefaultTypeOfKind(kind reflect.Kind) Type { 10 | return kindTypes[kind] 11 | } 12 | 13 | var kindTypes = map[reflect.Kind]Type{ 14 | reflect.Bool: TypeOf(true), 15 | reflect.Uint8: TypeOf(uint8(0)), 16 | reflect.Int8: TypeOf(int8(0)), 17 | reflect.Uint16: TypeOf(uint16(0)), 18 | reflect.Int16: TypeOf(int16(0)), 19 | reflect.Uint32: TypeOf(uint32(0)), 20 | reflect.Int32: TypeOf(int32(0)), 21 | reflect.Uint64: TypeOf(uint64(0)), 22 | reflect.Int64: TypeOf(int64(0)), 23 | reflect.Uint: TypeOf(uint(0)), 24 | reflect.Int: TypeOf(int(0)), 25 | reflect.Float32: TypeOf(float32(0)), 26 | reflect.Float64: TypeOf(float64(0)), 27 | reflect.Uintptr: TypeOf(uintptr(0)), 28 | reflect.String: TypeOf(""), 29 | reflect.UnsafePointer: TypeOf(unsafe.Pointer(nil)), 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_386.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_386.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_amd64p32.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_arm.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_arm64.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_arm64.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mips64x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_mips64x.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_mipsx.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_mipsx.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_ppc64x.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/relfect2_s390x.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/modern-go/reflect2/relfect2_s390x.s -------------------------------------------------------------------------------- /vendor/github.com/modern-go/reflect2/safe_struct.go: -------------------------------------------------------------------------------- 1 | package reflect2 2 | 3 | type safeStructType struct { 4 | safeType 5 | } 6 | 7 | func (type2 *safeStructType) FieldByName(name string) StructField { 8 | field, found := type2.Type.FieldByName(name) 9 | if !found { 10 | panic("field " + name + " not found") 11 | } 12 | return &safeField{StructField: field} 13 | } 14 | 15 | func (type2 *safeStructType) Field(i int) StructField { 16 | return &safeField{StructField: type2.Type.Field(i)} 17 | } 18 | 19 | func (type2 *safeStructType) FieldByIndex(index []int) StructField { 20 | return &safeField{StructField: type2.Type.FieldByIndex(index)} 21 | } 22 | 23 | func (type2 *safeStructType) FieldByNameFunc(match func(string) bool) StructField { 24 | field, found := type2.Type.FieldByNameFunc(match) 25 | if !found { 26 | panic("field match condition not found in " + type2.Type.String()) 27 | } 28 | return &safeField{StructField: field} 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | tmp 10 | 11 | # Architecture specific extensions/prefixes 12 | *.[568vq] 13 | [568vq].out 14 | 15 | *.cgo1.go 16 | *.cgo2.c 17 | _cgo_defun.c 18 | _cgo_gotypes.go 19 | _cgo_export.* 20 | 21 | _testmain.go 22 | 23 | *.exe 24 | *.test 25 | *.prof 26 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/CNAME: -------------------------------------------------------------------------------- 1 | zerolog.io -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/_config.yml: -------------------------------------------------------------------------------- 1 | remote_theme: rs/gh-readme 2 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/go112.go: -------------------------------------------------------------------------------- 1 | // +build go1.12 2 | 3 | package zerolog 4 | 5 | // Since go 1.12, some auto generated init functions are hidden from 6 | // runtime.Caller. 7 | const contextCallerSkipFrameCount = 2 8 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/internal/cbor/base.go: -------------------------------------------------------------------------------- 1 | package cbor 2 | 3 | // JSONMarshalFunc is used to marshal interface to JSON encoded byte slice. 4 | // Making it package level instead of embedded in Encoder brings 5 | // some extra efforts at importing, but avoids value copy when the functions 6 | // of Encoder being invoked. 7 | // DO REMEMBER to set this variable at importing, or 8 | // you might get a nil pointer dereference panic at runtime. 9 | var JSONMarshalFunc func(v interface{}) ([]byte, error) 10 | 11 | type Encoder struct{} 12 | 13 | // AppendKey adds a key (string) to the binary encoded log message 14 | func (e Encoder) AppendKey(dst []byte, key string) []byte { 15 | if len(dst) < 1 { 16 | dst = e.AppendBeginMarker(dst) 17 | } 18 | return e.AppendString(dst, key) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/internal/json/base.go: -------------------------------------------------------------------------------- 1 | package json 2 | 3 | // JSONMarshalFunc is used to marshal interface to JSON encoded byte slice. 4 | // Making it package level instead of embedded in Encoder brings 5 | // some extra efforts at importing, but avoids value copy when the functions 6 | // of Encoder being invoked. 7 | // DO REMEMBER to set this variable at importing, or 8 | // you might get a nil pointer dereference panic at runtime. 9 | var JSONMarshalFunc func(v interface{}) ([]byte, error) 10 | 11 | type Encoder struct{} 12 | 13 | // AppendKey appends a new key to the output JSON. 14 | func (e Encoder) AppendKey(dst []byte, key string) []byte { 15 | if dst[len(dst)-1] != '{' { 16 | dst = append(dst, ',') 17 | } 18 | return append(e.AppendString(dst, key), ':') 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/not_go112.go: -------------------------------------------------------------------------------- 1 | // +build !go1.12 2 | 3 | package zerolog 4 | 5 | const contextCallerSkipFrameCount = 3 6 | -------------------------------------------------------------------------------- /vendor/github.com/rs/zerolog/pretty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boyter/scc/fa5cd71f5524e88be9e5d67a9c3bd5fd085070e4/vendor/github.com/rs/zerolog/pretty.png -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | # Vim files https://github.com/github/gitignore/blob/master/Global/Vim.gitignore 23 | # swap 24 | [._]*.s[a-w][a-z] 25 | [._]s[a-w][a-z] 26 | # session 27 | Session.vim 28 | # temporary 29 | .netrwhist 30 | *~ 31 | # auto-generated tag files 32 | tags 33 | 34 | *.exe 35 | cobra.test 36 | bin 37 | 38 | .idea/ 39 | *.iml 40 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/.mailmap: -------------------------------------------------------------------------------- 1 | Steve Francia 2 | Bjørn Erik Pedersen 3 | Fabiano Franz 4 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/MAINTAINERS: -------------------------------------------------------------------------------- 1 | maintainers: 2 | - spf13 3 | - johnSchnake 4 | - jpmcb 5 | - marckhouzam 6 | inactive: 7 | - anthonyfok 8 | - bep 9 | - bogem 10 | - broady 11 | - eparis 12 | - jharshman 13 | - wfernandes 14 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/Makefile: -------------------------------------------------------------------------------- 1 | BIN="./bin" 2 | SRC=$(shell find . -name "*.go") 3 | 4 | ifeq (, $(shell which golangci-lint)) 5 | $(warning "could not find golangci-lint in $(PATH), run: curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh") 6 | endif 7 | 8 | .PHONY: fmt lint test install_deps clean 9 | 10 | default: all 11 | 12 | all: fmt test 13 | 14 | fmt: 15 | $(info ******************** checking formatting ********************) 16 | @test -z $(shell gofmt -l $(SRC)) || (gofmt -d $(SRC); exit 1) 17 | 18 | lint: 19 | $(info ******************** running lint tools ********************) 20 | golangci-lint run -v 21 | 22 | test: install_deps 23 | $(info ******************** running tests ********************) 24 | go test -v ./... 25 | 26 | richtest: install_deps 27 | $(info ******************** running tests with kyoh86/richgo ********************) 28 | richgo test -v ./... 29 | 30 | install_deps: 31 | $(info ******************** downloading dependencies ********************) 32 | go get -v ./... 33 | 34 | clean: 35 | rm -rf $(BIN) 36 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/cobra/command_notwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013-2023 The Cobra Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:build !windows 16 | // +build !windows 17 | 18 | package cobra 19 | 20 | var preExecHookFn func(*Command) 21 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.go] 12 | indent_style = tab 13 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/* 2 | 3 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.golangci.yaml: -------------------------------------------------------------------------------- 1 | linters: 2 | disable-all: true 3 | enable: 4 | - nolintlint 5 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/pflag/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: go 4 | 5 | go: 6 | - 1.9.x 7 | - 1.10.x 8 | - 1.11.x 9 | - tip 10 | 11 | matrix: 12 | allow_failures: 13 | - go: tip 14 | 15 | install: 16 | - go get golang.org/x/lint/golint 17 | - export PATH=$GOPATH/bin:$PATH 18 | - go install ./... 19 | 20 | script: 21 | - verify/all.sh -v 22 | - go test ./... 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && gc && !purego 6 | 7 | package blake2b 8 | 9 | import "golang.org/x/sys/cpu" 10 | 11 | func init() { 12 | useAVX2 = cpu.X86.HasAVX2 13 | useAVX = cpu.X86.HasAVX 14 | useSSE4 = cpu.X86.HasSSE41 15 | } 16 | 17 | //go:noescape 18 | func hashBlocksAVX2(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 19 | 20 | //go:noescape 21 | func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 22 | 23 | //go:noescape 24 | func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) 25 | 26 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 27 | switch { 28 | case useAVX2: 29 | hashBlocksAVX2(h, c, flag, blocks) 30 | case useAVX: 31 | hashBlocksAVX(h, c, flag, blocks) 32 | case useSSE4: 33 | hashBlocksSSE4(h, c, flag, blocks) 34 | default: 35 | hashBlocksGeneric(h, c, flag, blocks) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/blake2b_ref.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !amd64 || purego || !gc 6 | 7 | package blake2b 8 | 9 | func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { 10 | hashBlocksGeneric(h, c, flag, blocks) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/crypto/blake2b/register.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package blake2b 6 | 7 | import ( 8 | "crypto" 9 | "hash" 10 | ) 11 | 12 | func init() { 13 | newHash256 := func() hash.Hash { 14 | h, _ := New256(nil) 15 | return h 16 | } 17 | newHash384 := func() hash.Hash { 18 | h, _ := New384(nil) 19 | return h 20 | } 21 | 22 | newHash512 := func() hash.Hash { 23 | h, _ := New512(nil) 24 | return h 25 | } 26 | 27 | crypto.RegisterHash(crypto.BLAKE2b_256, newHash256) 28 | crypto.RegisterHash(crypto.BLAKE2b_384, newHash384) 29 | crypto.RegisterHash(crypto.BLAKE2b_512, newHash512) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | return context.WithCancelCause(parent) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sync/errgroup/pre_go120.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.20 6 | 7 | package errgroup 8 | 9 | import "context" 10 | 11 | func withCancelCause(parent context.Context) (context.Context, func(error)) { 12 | ctx, cancel := context.WithCancel(parent) 13 | return ctx, func(error) { cancel() } 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/asm_darwin_x86_gc.s: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && amd64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_sysctl(SB) 11 | GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 12 | DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) 13 | 14 | TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0 15 | JMP libc_sysctlbyname(SB) 16 | GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8 17 | DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_aix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix 6 | 7 | package cpu 8 | 9 | const ( 10 | // getsystemcfg constants 11 | _SC_IMPL = 2 12 | _IMPL_POWER8 = 0x10000 13 | _IMPL_POWER9 = 0x20000 14 | ) 15 | 16 | func archInit() { 17 | impl := getsystemcfg(_SC_IMPL) 18 | if impl&_IMPL_POWER8 != 0 { 19 | PPC64.IsPOWER8 = true 20 | } 21 | if impl&_IMPL_POWER9 != 0 { 22 | PPC64.IsPOWER8 = true 23 | PPC64.IsPOWER9 = true 24 | } 25 | 26 | Initialized = true 27 | } 28 | 29 | func getsystemcfg(label int) (n uint64) { 30 | r0, _ := callgetsystemcfg(label) 31 | n = uint64(r0) 32 | return 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // func getisar0() uint64 10 | TEXT ·getisar0(SB),NOSPLIT,$0-8 11 | // get Instruction Set Attributes 0 into x0 12 | // mrs x0, ID_AA64ISAR0_EL1 = d5380600 13 | WORD $0xd5380600 14 | MOVD R0, ret+0(FP) 15 | RET 16 | 17 | // func getisar1() uint64 18 | TEXT ·getisar1(SB),NOSPLIT,$0-8 19 | // get Instruction Set Attributes 1 into x0 20 | // mrs x0, ID_AA64ISAR1_EL1 = d5380620 21 | WORD $0xd5380620 22 | MOVD R0, ret+0(FP) 23 | RET 24 | 25 | // func getpfr0() uint64 26 | TEXT ·getpfr0(SB),NOSPLIT,$0-8 27 | // get Processor Feature Register 0 into x0 28 | // mrs x0, ID_AA64PFR0_EL1 = d5380400 29 | WORD $0xd5380400 30 | MOVD R0, ret+0(FP) 31 | RET 32 | 33 | // func getzfr0() uint64 34 | TEXT ·getzfr0(SB),NOSPLIT,$0-8 35 | // get SVE Feature Register 0 into x0 36 | // mrs x0, ID_AA64ZFR0_EL1 = d5380480 37 | WORD $0xd5380480 38 | MOVD R0, ret+0(FP) 39 | RET 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | package cpu 8 | 9 | func getisar0() uint64 10 | func getisar1() uint64 11 | func getpfr0() uint64 12 | func getzfr0() uint64 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | package cpu 8 | 9 | // haveAsmFunctions reports whether the other functions in this file can 10 | // be safely called. 11 | func haveAsmFunctions() bool { return true } 12 | 13 | // The following feature detection functions are defined in cpu_s390x.s. 14 | // They are likely to be expensive to call so the results should be cached. 15 | func stfle() facilityList 16 | func kmQuery() queryResult 17 | func kmcQuery() queryResult 18 | func kmctrQuery() queryResult 19 | func kmaQuery() queryResult 20 | func kimdQuery() queryResult 21 | func klmdQuery() queryResult 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (386 || amd64 || amd64p32) && gc 6 | 7 | package cpu 8 | 9 | // cpuid is implemented in cpu_gc_x86.s for gc compiler 10 | // and in cpu_gccgo.c for gccgo. 11 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 12 | 13 | // xgetbv with ecx = 0 is implemented in cpu_gc_x86.s for gc compiler 14 | // and in cpu_gccgo.c for gccgo. 15 | func xgetbv() (eax, edx uint32) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gc_x86.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (386 || amd64 || amd64p32) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) 10 | TEXT ·cpuid(SB), NOSPLIT, $0-24 11 | MOVL eaxArg+0(FP), AX 12 | MOVL ecxArg+4(FP), CX 13 | CPUID 14 | MOVL AX, eax+8(FP) 15 | MOVL BX, ebx+12(FP) 16 | MOVL CX, ecx+16(FP) 17 | MOVL DX, edx+20(FP) 18 | RET 19 | 20 | // func xgetbv() (eax, edx uint32) 21 | TEXT ·xgetbv(SB), NOSPLIT, $0-8 22 | MOVL $0, CX 23 | XGETBV 24 | MOVL AX, eax+0(FP) 25 | MOVL DX, edx+4(FP) 26 | RET 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo 6 | 7 | package cpu 8 | 9 | func getisar0() uint64 { return 0 } 10 | func getisar1() uint64 { return 0 } 11 | func getpfr0() uint64 { return 0 } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo 6 | 7 | package cpu 8 | 9 | // haveAsmFunctions reports whether the other functions in this file can 10 | // be safely called. 11 | func haveAsmFunctions() bool { return false } 12 | 13 | // TODO(mundaym): the following feature detection functions are currently 14 | // stubs. See https://golang.org/cl/162887 for how to fix this. 15 | // They are likely to be expensive to call so the results should be cached. 16 | func stfle() facilityList { panic("not implemented for gccgo") } 17 | func kmQuery() queryResult { panic("not implemented for gccgo") } 18 | func kmcQuery() queryResult { panic("not implemented for gccgo") } 19 | func kmctrQuery() queryResult { panic("not implemented for gccgo") } 20 | func kmaQuery() queryResult { panic("not implemented for gccgo") } 21 | func kimdQuery() queryResult { panic("not implemented for gccgo") } 22 | func klmdQuery() queryResult { panic("not implemented for gccgo") } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (386 || amd64 || amd64p32) && gccgo 6 | 7 | package cpu 8 | 9 | //extern gccgoGetCpuidCount 10 | func gccgoGetCpuidCount(eaxArg, ecxArg uint32, eax, ebx, ecx, edx *uint32) 11 | 12 | func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32) { 13 | var a, b, c, d uint32 14 | gccgoGetCpuidCount(eaxArg, ecxArg, &a, &b, &c, &d) 15 | return a, b, c, d 16 | } 17 | 18 | //extern gccgoXgetbv 19 | func gccgoXgetbv(eax, edx *uint32) 20 | 21 | func xgetbv() (eax, edx uint32) { 22 | var a, d uint32 23 | gccgoXgetbv(&a, &d) 24 | return a, d 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !386 && !amd64 && !amd64p32 && !arm64 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | if err := readHWCAP(); err != nil { 11 | return 12 | } 13 | doinit() 14 | Initialized = true 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) 6 | 7 | package cpu 8 | 9 | // HWCAP bits. These are exposed by the Linux kernel 5.4. 10 | const ( 11 | // CPU features 12 | hwcap_MIPS_MSA = 1 << 1 13 | ) 14 | 15 | func doinit() { 16 | // HWCAP feature bits 17 | MIPS64X.HasMSA = isSet(hwCap, hwcap_MIPS_MSA) 18 | } 19 | 20 | func isSet(hwc uint, value uint) bool { 21 | return hwc&value != 0 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 6 | 7 | package cpu 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) 6 | 7 | package cpu 8 | 9 | // HWCAP/HWCAP2 bits. These are exposed by the kernel. 10 | const ( 11 | // ISA Level 12 | _PPC_FEATURE2_ARCH_2_07 = 0x80000000 13 | _PPC_FEATURE2_ARCH_3_00 = 0x00800000 14 | 15 | // CPU features 16 | _PPC_FEATURE2_DARN = 0x00200000 17 | _PPC_FEATURE2_SCV = 0x00100000 18 | ) 19 | 20 | func doinit() { 21 | // HWCAP2 feature bits 22 | PPC64.IsPOWER8 = isSet(hwCap2, _PPC_FEATURE2_ARCH_2_07) 23 | PPC64.IsPOWER9 = isSet(hwCap2, _PPC_FEATURE2_ARCH_3_00) 24 | PPC64.HasDARN = isSet(hwCap2, _PPC_FEATURE2_DARN) 25 | PPC64.HasSCV = isSet(hwCap2, _PPC_FEATURE2_SCV) 26 | } 27 | 28 | func isSet(hwc uint, value uint) bool { 29 | return hwc&value != 0 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_linux_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | const ( 8 | // bit mask values from /usr/include/bits/hwcap.h 9 | hwcap_ZARCH = 2 10 | hwcap_STFLE = 4 11 | hwcap_MSA = 8 12 | hwcap_LDISP = 16 13 | hwcap_EIMM = 32 14 | hwcap_DFP = 64 15 | hwcap_ETF3EH = 256 16 | hwcap_VX = 2048 17 | hwcap_VXE = 8192 18 | ) 19 | 20 | func initS390Xbase() { 21 | // test HWCAP bit vector 22 | has := func(featureMask uint) bool { 23 | return hwCap&featureMask == featureMask 24 | } 25 | 26 | // mandatory 27 | S390X.HasZARCH = has(hwcap_ZARCH) 28 | 29 | // optional 30 | S390X.HasSTFLE = has(hwcap_STFLE) 31 | S390X.HasLDISP = has(hwcap_LDISP) 32 | S390X.HasEIMM = has(hwcap_EIMM) 33 | S390X.HasETF3EH = has(hwcap_ETF3EH) 34 | S390X.HasDFP = has(hwcap_DFP) 35 | S390X.HasMSA = has(hwcap_MSA) 36 | S390X.HasVX = has(hwcap_VX) 37 | if S390X.HasVX { 38 | S390X.HasVXE = has(hwcap_VXE) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_loong64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build loong64 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 64 10 | 11 | func initOptions() { 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build mips64 || mips64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "msa", Feature: &MIPS64X.HasMSA}, 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_mipsx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build mips || mipsle 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 32 10 | 11 | func initOptions() {} 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 8 | JMP libc_sysctl(SB) 9 | 10 | GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 11 | DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && arm 6 | 7 | package cpu 8 | 9 | func archInit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && !netbsd && !openbsd && arm64 6 | 7 | package cpu 8 | 9 | func doinit() {} 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && (mips64 || mips64le) 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | Initialized = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !aix && !linux && (ppc64 || ppc64le) 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | PPC64.IsPOWER8 = true 11 | Initialized = true 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux && riscv64 6 | 7 | package cpu 8 | 9 | func archInit() { 10 | Initialized = true 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_other_x86.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 || amd64p32 || (amd64 && (!darwin || !gc)) 6 | 7 | package cpu 8 | 9 | func darwinSupportsAVX512() bool { 10 | panic("only implemented for gc && amd64 && darwin") 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ppc64 || ppc64le 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 128 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "darn", Feature: &PPC64.HasDARN}, 14 | {Name: "scv", Feature: &PPC64.HasSCV}, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 6 | 7 | package cpu 8 | 9 | const cacheLineSize = 64 10 | 11 | func initOptions() { 12 | options = []option{ 13 | {Name: "fastmisaligned", Feature: &RISCV64.HasFastMisaligned}, 14 | {Name: "c", Feature: &RISCV64.HasC}, 15 | {Name: "v", Feature: &RISCV64.HasV}, 16 | {Name: "zba", Feature: &RISCV64.HasZba}, 17 | {Name: "zbb", Feature: &RISCV64.HasZbb}, 18 | {Name: "zbs", Feature: &RISCV64.HasZbs}, 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_wasm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build wasm 6 | 7 | package cpu 8 | 9 | // We're compiling the cpu package for an unknown (software-abstracted) CPU. 10 | // Make CacheLinePad an empty struct and hope that the usual struct alignment 11 | // rules are good enough. 12 | 13 | const cacheLineSize = 0 14 | 15 | func initOptions() {} 16 | 17 | func archInit() {} 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | func archInit() { 8 | doinit() 9 | Initialized = true 10 | } 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/cpu_zos_s390x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | func initS390Xbase() { 8 | // get the facilities list 9 | facilities := stfle() 10 | 11 | // mandatory 12 | S390X.HasZARCH = facilities.Has(zarch) 13 | S390X.HasSTFLE = facilities.Has(stflef) 14 | S390X.HasLDISP = facilities.Has(ldisp) 15 | S390X.HasEIMM = facilities.Has(eimm) 16 | 17 | // optional 18 | S390X.HasETF3EH = facilities.Has(etf3eh) 19 | S390X.HasDFP = facilities.Has(dfp) 20 | S390X.HasMSA = facilities.Has(msa) 21 | S390X.HasVX = facilities.Has(vx) 22 | if S390X.HasVX { 23 | S390X.HasVXE = facilities.Has(vxe) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package cpu 8 | 9 | // IsBigEndian records whether the GOARCH's byte order is big endian. 10 | const IsBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm 6 | 7 | package cpu 8 | 9 | // IsBigEndian records whether the GOARCH's byte order is big endian. 10 | const IsBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/runtime_auxv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package cpu 6 | 7 | // getAuxvFn is non-nil on Go 1.21+ (via runtime_auxv_go121.go init) 8 | // on platforms that use auxv. 9 | var getAuxvFn func() []uintptr 10 | 11 | func getAuxv() []uintptr { 12 | if getAuxvFn == nil { 13 | return nil 14 | } 15 | return getAuxvFn() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.21 6 | 7 | package cpu 8 | 9 | import ( 10 | _ "unsafe" // for linkname 11 | ) 12 | 13 | //go:linkname runtime_getAuxv runtime.getAuxv 14 | func runtime_getAuxv() []uintptr 15 | 16 | func init() { 17 | getAuxvFn = runtime_getAuxv 18 | } 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Recreate a getsystemcfg syscall handler instead of 6 | // using the one provided by x/sys/unix to avoid having 7 | // the dependency between them. (See golang.org/issue/32102) 8 | // Moreover, this file will be used during the building of 9 | // gccgo's libgo and thus must not used a CGo method. 10 | 11 | //go:build aix && gccgo 12 | 13 | package cpu 14 | 15 | import ( 16 | "syscall" 17 | ) 18 | 19 | //extern getsystemcfg 20 | func gccgoGetsystemcfg(label uint32) (r uint64) 21 | 22 | func callgetsystemcfg(label int) (r1 uintptr, e1 syscall.Errno) { 23 | r1 = uintptr(gccgoGetsystemcfg(uint32(label))) 24 | e1 = syscall.GetErrno() 25 | return 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-56 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, Linux 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/auxv_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Auxv() ([][2]uintptr, error) { 12 | return nil, syscall.ENOTSUP 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && go1.24 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | //go:linkname vgetrandom runtime.vgetrandom 12 | //go:noescape 13 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux || !go1.24 6 | 7 | package unix 8 | 9 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { 10 | return -1, false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // AliasType is the type of an alias in AliasMap. 8 | type AliasType int8 9 | 10 | const ( 11 | Deprecated AliasType = iota 12 | Macro 13 | Legacy 14 | 15 | AliasTypeUnknown AliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // CompactCoreInfo is a compact integer with the three core tags encoded. 8 | type CompactCoreInfo uint32 9 | 10 | // GetCompactCore generates a uint32 value that is guaranteed to be unique for 11 | // different language, region, and script values. 12 | func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { 13 | if t.LangID > langNoIndexOffset { 14 | return 0, false 15 | } 16 | cci |= CompactCoreInfo(t.LangID) << (8 + 12) 17 | cci |= CompactCoreInfo(t.ScriptID) << 12 18 | cci |= CompactCoreInfo(t.RegionID) 19 | return cci, true 20 | } 21 | 22 | // Tag generates a tag from c. 23 | func (c CompactCoreInfo) Tag() Tag { 24 | return Tag{ 25 | LangID: Language(c >> 20), 26 | RegionID: Region(c & 0x3ff), 27 | ScriptID: Script(c>>12) & 0xff, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/coverage.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package language 6 | 7 | // BaseLanguages returns the list of all supported base languages. It generates 8 | // the list by traversing the internal structures. 9 | func BaseLanguages() []Language { 10 | base := make([]Language, 0, NumLanguages) 11 | for i := 0; i < langNoIndexOffset; i++ { 12 | // We included "und" already for the value 0. 13 | if i != nonCanonicalUnd { 14 | base = append(base, Language(i)) 15 | } 16 | } 17 | i := langNoIndexOffset 18 | for _, v := range langNoIndex { 19 | for k := 0; k < 8; k++ { 20 | if v&1 == 1 { 21 | base = append(base, Language(i)) 22 | } 23 | v >>= 1 24 | i++ 25 | } 26 | } 27 | return base 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/number/roundingmode_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type RoundingMode"; DO NOT EDIT. 2 | 3 | package number 4 | 5 | import "strconv" 6 | 7 | func _() { 8 | // An "invalid array index" compiler error signifies that the constant values have changed. 9 | // Re-run the stringer command to generate them again. 10 | var x [1]struct{} 11 | _ = x[ToNearestEven-0] 12 | _ = x[ToNearestZero-1] 13 | _ = x[ToNearestAway-2] 14 | _ = x[ToPositiveInf-3] 15 | _ = x[ToNegativeInf-4] 16 | _ = x[ToZero-5] 17 | _ = x[AwayFromZero-6] 18 | _ = x[numModes-7] 19 | } 20 | 21 | const _RoundingMode_name = "ToNearestEvenToNearestZeroToNearestAwayToPositiveInfToNegativeInfToZeroAwayFromZeronumModes" 22 | 23 | var _RoundingMode_index = [...]uint8{0, 13, 26, 39, 52, 65, 71, 83, 91} 24 | 25 | func (i RoundingMode) String() string { 26 | if i >= RoundingMode(len(_RoundingMode_index)-1) { 27 | return "RoundingMode(" + strconv.FormatInt(int64(i), 10) + ")" 28 | } 29 | return _RoundingMode_name[_RoundingMode_index[i]:_RoundingMode_index[i+1]] 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/message/catalog/go19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.9 6 | 7 | package catalog 8 | 9 | import "golang.org/x/text/internal/catmsg" 10 | 11 | // A Message holds a collection of translations for the same phrase that may 12 | // vary based on the values of substitution arguments. 13 | type Message = catmsg.Message 14 | 15 | type firstInSequence = catmsg.FirstOf 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/message/catalog/gopre19.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.9 6 | 7 | package catalog 8 | 9 | import "golang.org/x/text/internal/catmsg" 10 | 11 | // A Message holds a collection of translations for the same phrase that may 12 | // vary based on the values of substitution arguments. 13 | type Message interface { 14 | catmsg.Message 15 | } 16 | 17 | func firstInSequence(m []Message) catmsg.Message { 18 | a := []catmsg.Message{} 19 | for _, m := range m { 20 | a = append(a, m) 21 | } 22 | return catmsg.FirstOf(a) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "1.14.x" 15 | - "tip" 16 | 17 | go_import_path: gopkg.in/yaml.v2 18 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v2/writerc.go: -------------------------------------------------------------------------------- 1 | package yaml 2 | 3 | // Set the writer error and return false. 4 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 5 | emitter.error = yaml_WRITER_ERROR 6 | emitter.problem = problem 7 | return false 8 | } 9 | 10 | // Flush the output buffer. 11 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 12 | if emitter.write_handler == nil { 13 | panic("write handler not set") 14 | } 15 | 16 | // Check if the buffer is empty. 17 | if emitter.buffer_pos == 0 { 18 | return true 19 | } 20 | 21 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 22 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 23 | } 24 | emitter.buffer_pos = 0 25 | return true 26 | } 27 | --------------------------------------------------------------------------------