├── .editorconfig ├── .github └── workflows │ ├── actionlint.yml │ ├── audit.yml │ ├── lint.yml │ ├── rubberstamp.yml │ ├── test-crosscompile.yml │ ├── test-futureproof-dependencies.yml │ ├── test-futureproof-language.yml │ ├── test-futureproof-os.yml │ └── test.yml ├── .gitignore ├── .rubberstamp ├── .tool-versions ├── DEVELOPMENT.md ├── LICENSE.md ├── README.md ├── cmd └── factorio │ └── main.go ├── example ├── README.md ├── cmd │ └── hello │ │ └── main.go └── go.mod ├── factorio.go ├── factorio_test.go ├── go.mod ├── go.sum ├── magefile.go ├── makefile ├── vendor ├── github.com │ ├── BurntSushi │ │ └── toml │ │ │ ├── .gitignore │ │ │ ├── COPYING │ │ │ ├── README.md │ │ │ ├── decode.go │ │ │ ├── deprecated.go │ │ │ ├── doc.go │ │ │ ├── encode.go │ │ │ ├── error.go │ │ │ ├── internal │ │ │ └── tz.go │ │ │ ├── lex.go │ │ │ ├── meta.go │ │ │ ├── parse.go │ │ │ ├── type_fields.go │ │ │ └── type_toml.go │ ├── alexkohler │ │ └── nakedret │ │ │ └── v2 │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── cmd │ │ │ └── nakedret │ │ │ │ └── main.go │ │ │ ├── import.go │ │ │ └── nakedret.go │ ├── chavacava │ │ └── garif │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── constructors.go │ │ │ ├── decorators.go │ │ │ ├── doc.go │ │ │ ├── enums.go │ │ │ ├── io.go │ │ │ └── models.go │ ├── fatih │ │ ├── color │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── color.go │ │ │ ├── color_windows.go │ │ │ └── doc.go │ │ └── structtag │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── tags.go │ ├── hashicorp │ │ └── go-version │ │ │ ├── CHANGELOG.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── constraint.go │ │ │ ├── version.go │ │ │ └── version_collection.go │ ├── kisielk │ │ └── errcheck │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── errcheck │ │ │ ├── analyzer.go │ │ │ ├── embedded_walker.go │ │ │ ├── embedded_walker_121.go │ │ │ ├── embedded_walker_122.go │ │ │ ├── errcheck.go │ │ │ └── excludes.go │ │ │ └── main.go │ ├── magefile │ │ └── mage │ │ │ ├── .gitattributes │ │ │ ├── .gitignore │ │ │ ├── .goreleaser.yml │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── internal │ │ │ └── run.go │ │ │ ├── mage │ │ │ ├── command_string.go │ │ │ ├── magefile_tmpl.go │ │ │ ├── main.go │ │ │ └── template.go │ │ │ ├── magefile.go │ │ │ ├── main.go │ │ │ ├── mg │ │ │ ├── color.go │ │ │ ├── color_string.go │ │ │ ├── deps.go │ │ │ ├── errors.go │ │ │ ├── fn.go │ │ │ └── runtime.go │ │ │ ├── parse │ │ │ └── parse.go │ │ │ └── sh │ │ │ ├── cmd.go │ │ │ └── helpers.go │ ├── mattn │ │ ├── go-colorable │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── 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 │ ├── mcandre │ │ └── mage-extras │ │ │ ├── .editorconfig │ │ │ ├── .gitignore │ │ │ ├── .rubberstamp │ │ │ ├── .tool-versions │ │ │ ├── DEVELOPMENT.md │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── archive.go │ │ │ ├── binaries.go │ │ │ ├── compile.go │ │ │ ├── coverage.go │ │ │ ├── deadcode.go │ │ │ ├── dockerscout.go │ │ │ ├── errcheck.go │ │ │ ├── factorio.go │ │ │ ├── gofmt.go │ │ │ ├── goimports.go │ │ │ ├── golint.go │ │ │ ├── govulncheck.go │ │ │ ├── install.go │ │ │ ├── mageextras.go │ │ │ ├── magefile.go │ │ │ ├── makefile │ │ │ ├── nakedret.go │ │ │ ├── packages.go │ │ │ ├── pathseparator.go │ │ │ ├── revive.go │ │ │ ├── snyk.go │ │ │ ├── sources.go │ │ │ ├── staticcheck.go │ │ │ ├── test.go │ │ │ ├── unmake.go │ │ │ ├── version.go │ │ │ ├── vet.go │ │ │ ├── xgo.go │ │ │ └── yamllint.go │ ├── mgechev │ │ ├── dots │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ └── resolve.go │ │ └── revive │ │ │ ├── .docs-deploy-key.pem.enc │ │ │ ├── .gitignore │ │ │ ├── .goreleaser.yml │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── DEVELOPING.md │ │ │ ├── Dockerfile │ │ │ ├── LICENSE │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── RULES_DESCRIPTIONS.md │ │ │ ├── cli │ │ │ └── main.go │ │ │ ├── config │ │ │ └── config.go │ │ │ ├── defaults.toml │ │ │ ├── formatter │ │ │ ├── checkstyle.go │ │ │ ├── default.go │ │ │ ├── doc.go │ │ │ ├── friendly.go │ │ │ ├── json.go │ │ │ ├── ndjson.go │ │ │ ├── plain.go │ │ │ ├── sarif.go │ │ │ ├── severity.go │ │ │ ├── stylish.go │ │ │ └── unix.go │ │ │ ├── internal │ │ │ ├── astutils │ │ │ │ └── ast_utils.go │ │ │ ├── ifelse │ │ │ │ ├── args.go │ │ │ │ ├── branch.go │ │ │ │ ├── branch_kind.go │ │ │ │ ├── chain.go │ │ │ │ ├── doc.go │ │ │ │ ├── func.go │ │ │ │ ├── rule.go │ │ │ │ └── target.go │ │ │ └── typeparams │ │ │ │ ├── typeparams.go │ │ │ │ ├── typeparams_go117.go │ │ │ │ └── typeparams_go118.go │ │ │ ├── lint │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── failure.go │ │ │ ├── file.go │ │ │ ├── filefilter.go │ │ │ ├── formatter.go │ │ │ ├── linter.go │ │ │ ├── name.go │ │ │ ├── package.go │ │ │ └── rule.go │ │ │ ├── logging │ │ │ └── logger.go │ │ │ ├── main.go │ │ │ ├── renovate.json │ │ │ ├── revive.toml │ │ │ ├── revivelib │ │ │ ├── core.go │ │ │ ├── extra_rule.go │ │ │ └── pattern.go │ │ │ ├── rule │ │ │ ├── add_constant.go │ │ │ ├── argument_limit.go │ │ │ ├── atomic.go │ │ │ ├── banned_characters.go │ │ │ ├── bare_return.go │ │ │ ├── blank_imports.go │ │ │ ├── bool_literal_in_expr.go │ │ │ ├── call_to_gc.go │ │ │ ├── cognitive_complexity.go │ │ │ ├── comment_spacings.go │ │ │ ├── comments_density.go │ │ │ ├── confusing_naming.go │ │ │ ├── confusing_results.go │ │ │ ├── constant_logical_expr.go │ │ │ ├── context_as_argument.go │ │ │ ├── context_keys_type.go │ │ │ ├── cyclomatic.go │ │ │ ├── datarace.go │ │ │ ├── deep_exit.go │ │ │ ├── defer.go │ │ │ ├── doc.go │ │ │ ├── dot_imports.go │ │ │ ├── duplicated_imports.go │ │ │ ├── early_return.go │ │ │ ├── empty_block.go │ │ │ ├── empty_lines.go │ │ │ ├── enforce_map_style.go │ │ │ ├── enforce_repeated_arg_type_style.go │ │ │ ├── enforce_slice_style.go │ │ │ ├── error_naming.go │ │ │ ├── error_return.go │ │ │ ├── error_strings.go │ │ │ ├── errorf.go │ │ │ ├── exported.go │ │ │ ├── file_header.go │ │ │ ├── file_length_limit.go │ │ │ ├── filename_format.go │ │ │ ├── flag_param.go │ │ │ ├── function_length.go │ │ │ ├── function_result_limit.go │ │ │ ├── get_return.go │ │ │ ├── identical_branches.go │ │ │ ├── if_return.go │ │ │ ├── import_alias_naming.go │ │ │ ├── import_shadowing.go │ │ │ ├── imports_blocklist.go │ │ │ ├── increment_decrement.go │ │ │ ├── indent_error_flow.go │ │ │ ├── line_length_limit.go │ │ │ ├── max_control_nesting.go │ │ │ ├── max_public_structs.go │ │ │ ├── modifies_param.go │ │ │ ├── modifies_value_receiver.go │ │ │ ├── nested_structs.go │ │ │ ├── optimize_operands_order.go │ │ │ ├── package_comments.go │ │ │ ├── range.go │ │ │ ├── range_val_address.go │ │ │ ├── range_val_in_closure.go │ │ │ ├── receiver_naming.go │ │ │ ├── redefines_builtin_id.go │ │ │ ├── redundant_build_tag.go │ │ │ ├── redundant_import_alias.go │ │ │ ├── redundant_test_main_exit.go │ │ │ ├── string_format.go │ │ │ ├── string_of_int.go │ │ │ ├── struct_tag.go │ │ │ ├── superfluous_else.go │ │ │ ├── time_equal.go │ │ │ ├── time_naming.go │ │ │ ├── unchecked_type_assertion.go │ │ │ ├── unconditional_recursion.go │ │ │ ├── unexported_naming.go │ │ │ ├── unexported_return.go │ │ │ ├── unhandled_error.go │ │ │ ├── unnecessary_stmt.go │ │ │ ├── unreachable_code.go │ │ │ ├── unused_param.go │ │ │ ├── unused_receiver.go │ │ │ ├── use_any.go │ │ │ ├── use_errors_new.go │ │ │ ├── useless_break.go │ │ │ ├── utils.go │ │ │ ├── var_declarations.go │ │ │ ├── var_naming.go │ │ │ └── waitgroup_by_value.go │ │ │ └── untyped.toml │ ├── olekukonko │ │ └── tablewriter │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── csv.go │ │ │ ├── table.go │ │ │ ├── table_with_color.go │ │ │ ├── util.go │ │ │ └── wrap.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 │ └── spf13 │ │ └── afero │ │ ├── .editorconfig │ │ ├── .gitignore │ │ ├── .golangci.yaml │ │ ├── LICENSE.txt │ │ ├── README.md │ │ ├── afero.go │ │ ├── appveyor.yml │ │ ├── basepath.go │ │ ├── cacheOnReadFs.go │ │ ├── const_bsds.go │ │ ├── const_win_unix.go │ │ ├── copyOnWriteFs.go │ │ ├── httpFs.go │ │ ├── internal │ │ └── common │ │ │ └── adapters.go │ │ ├── iofs.go │ │ ├── ioutil.go │ │ ├── lstater.go │ │ ├── match.go │ │ ├── mem │ │ ├── dir.go │ │ ├── dirmap.go │ │ └── file.go │ │ ├── memmap.go │ │ ├── os.go │ │ ├── path.go │ │ ├── readonlyfs.go │ │ ├── regexpfs.go │ │ ├── symlink.go │ │ ├── unionFile.go │ │ └── util.go ├── golang.org │ └── x │ │ ├── exp │ │ └── typeparams │ │ │ ├── LICENSE │ │ │ ├── common.go │ │ │ ├── normalize.go │ │ │ ├── termlist.go │ │ │ ├── typeparams_go117.go │ │ │ ├── typeparams_go118.go │ │ │ └── typeterm.go │ │ ├── mod │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── internal │ │ │ └── lazyregexp │ │ │ │ └── lazyre.go │ │ ├── modfile │ │ │ ├── print.go │ │ │ ├── read.go │ │ │ ├── rule.go │ │ │ └── work.go │ │ ├── module │ │ │ ├── module.go │ │ │ └── pseudo.go │ │ └── semver │ │ │ └── semver.go │ │ ├── sync │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── errgroup │ │ │ └── errgroup.go │ │ ├── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── 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 │ │ └── windows │ │ │ ├── aliases.go │ │ │ ├── dll_windows.go │ │ │ ├── env_windows.go │ │ │ ├── eventlog.go │ │ │ ├── exec_windows.go │ │ │ ├── memory_windows.go │ │ │ ├── mkerrors.bash │ │ │ ├── mkknownfolderids.bash │ │ │ ├── mksyscall.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── security_windows.go │ │ │ ├── service.go │ │ │ ├── setupapi_windows.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_windows.go │ │ │ ├── types_windows.go │ │ │ ├── types_windows_386.go │ │ │ ├── types_windows_amd64.go │ │ │ ├── types_windows_arm.go │ │ │ ├── types_windows_arm64.go │ │ │ ├── zerrors_windows.go │ │ │ ├── zknownfolderids_windows.go │ │ │ └── zsyscall_windows.go │ │ ├── text │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── runes │ │ │ ├── cond.go │ │ │ └── runes.go │ │ ├── transform │ │ │ └── transform.go │ │ └── unicode │ │ │ └── norm │ │ │ ├── composition.go │ │ │ ├── forminfo.go │ │ │ ├── input.go │ │ │ ├── iter.go │ │ │ ├── normalize.go │ │ │ ├── readwriter.go │ │ │ ├── tables10.0.0.go │ │ │ ├── tables11.0.0.go │ │ │ ├── tables12.0.0.go │ │ │ ├── tables13.0.0.go │ │ │ ├── tables15.0.0.go │ │ │ ├── tables9.0.0.go │ │ │ ├── transform.go │ │ │ └── trie.go │ │ └── tools │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── go │ │ ├── analysis │ │ │ ├── analysis.go │ │ │ ├── checker │ │ │ │ ├── checker.go │ │ │ │ ├── iter_go122.go │ │ │ │ ├── iter_go123.go │ │ │ │ └── print.go │ │ │ ├── diagnostic.go │ │ │ ├── doc.go │ │ │ ├── internal │ │ │ │ ├── analysisflags │ │ │ │ │ ├── flags.go │ │ │ │ │ ├── help.go │ │ │ │ │ └── url.go │ │ │ │ ├── checker │ │ │ │ │ └── checker.go │ │ │ │ └── internal.go │ │ │ ├── passes │ │ │ │ └── inspect │ │ │ │ │ └── inspect.go │ │ │ ├── singlechecker │ │ │ │ └── singlechecker.go │ │ │ ├── unitchecker │ │ │ │ └── unitchecker.go │ │ │ └── validate.go │ │ ├── ast │ │ │ ├── astutil │ │ │ │ ├── enclosing.go │ │ │ │ ├── imports.go │ │ │ │ ├── rewrite.go │ │ │ │ └── util.go │ │ │ └── inspector │ │ │ │ ├── inspector.go │ │ │ │ ├── iter.go │ │ │ │ ├── typeof.go │ │ │ │ └── walk.go │ │ ├── buildutil │ │ │ ├── allpackages.go │ │ │ ├── fakecontext.go │ │ │ ├── overlay.go │ │ │ ├── tags.go │ │ │ └── util.go │ │ ├── gcexportdata │ │ │ ├── gcexportdata.go │ │ │ └── importer.go │ │ ├── internal │ │ │ └── cgo │ │ │ │ ├── cgo.go │ │ │ │ └── cgo_pkgconfig.go │ │ ├── loader │ │ │ ├── doc.go │ │ │ ├── loader.go │ │ │ └── util.go │ │ ├── packages │ │ │ ├── doc.go │ │ │ ├── external.go │ │ │ ├── golist.go │ │ │ ├── golist_overlay.go │ │ │ ├── loadmode_string.go │ │ │ ├── packages.go │ │ │ └── visit.go │ │ └── types │ │ │ ├── objectpath │ │ │ └── objectpath.go │ │ │ └── typeutil │ │ │ ├── callee.go │ │ │ ├── imports.go │ │ │ ├── map.go │ │ │ ├── methodsetcache.go │ │ │ └── ui.go │ │ └── internal │ │ ├── aliases │ │ ├── aliases.go │ │ └── aliases_go122.go │ │ ├── analysisinternal │ │ ├── analysis.go │ │ └── extractdoc.go │ │ ├── astutil │ │ ├── cursor │ │ │ ├── cursor.go │ │ │ └── hooks.go │ │ └── edge │ │ │ └── edge.go │ │ ├── diff │ │ ├── diff.go │ │ ├── lcs │ │ │ ├── common.go │ │ │ ├── doc.go │ │ │ ├── git.sh │ │ │ ├── labels.go │ │ │ ├── old.go │ │ │ └── sequence.go │ │ ├── merge.go │ │ ├── ndiff.go │ │ └── unified.go │ │ ├── event │ │ ├── core │ │ │ ├── event.go │ │ │ ├── export.go │ │ │ └── fast.go │ │ ├── doc.go │ │ ├── event.go │ │ ├── keys │ │ │ ├── keys.go │ │ │ ├── standard.go │ │ │ └── util.go │ │ └── label │ │ │ └── label.go │ │ ├── facts │ │ ├── facts.go │ │ └── imports.go │ │ ├── gcimporter │ │ ├── bimport.go │ │ ├── exportdata.go │ │ ├── gcimporter.go │ │ ├── iexport.go │ │ ├── iimport.go │ │ ├── iimport_go122.go │ │ ├── predeclared.go │ │ ├── support.go │ │ └── ureader_yes.go │ │ ├── gocommand │ │ ├── invoke.go │ │ ├── invoke_notunix.go │ │ ├── invoke_unix.go │ │ ├── vendor.go │ │ └── version.go │ │ ├── packagesinternal │ │ └── packages.go │ │ ├── pkgbits │ │ ├── codes.go │ │ ├── decoder.go │ │ ├── doc.go │ │ ├── encoder.go │ │ ├── flags.go │ │ ├── reloc.go │ │ ├── support.go │ │ ├── sync.go │ │ ├── syncmarker_string.go │ │ └── version.go │ │ ├── stdlib │ │ ├── deps.go │ │ ├── import.go │ │ ├── manifest.go │ │ └── stdlib.go │ │ ├── typeparams │ │ ├── common.go │ │ ├── coretype.go │ │ ├── free.go │ │ ├── normalize.go │ │ ├── termlist.go │ │ └── typeterm.go │ │ ├── typesinternal │ │ ├── classify_call.go │ │ ├── element.go │ │ ├── errorcode.go │ │ ├── errorcode_string.go │ │ ├── qualifier.go │ │ ├── recv.go │ │ ├── toonew.go │ │ ├── types.go │ │ ├── varkind.go │ │ └── zerovalue.go │ │ └── versions │ │ ├── features.go │ │ ├── gover.go │ │ ├── types.go │ │ └── versions.go ├── honnef.co │ └── go │ │ └── tools │ │ ├── LICENSE │ │ ├── LICENSE-THIRD-PARTY │ │ ├── analysis │ │ ├── callcheck │ │ │ └── callcheck.go │ │ ├── code │ │ │ ├── code.go │ │ │ └── visit.go │ │ ├── edit │ │ │ └── edit.go │ │ ├── facts │ │ │ ├── deprecated │ │ │ │ └── deprecated.go │ │ │ ├── directives │ │ │ │ └── directives.go │ │ │ ├── generated │ │ │ │ └── generated.go │ │ │ ├── nilness │ │ │ │ └── nilness.go │ │ │ ├── purity │ │ │ │ └── purity.go │ │ │ ├── tokenfile │ │ │ │ └── token.go │ │ │ └── typedness │ │ │ │ └── typedness.go │ │ ├── lint │ │ │ └── lint.go │ │ └── report │ │ │ └── report.go │ │ ├── cmd │ │ └── staticcheck │ │ │ ├── README.md │ │ │ └── staticcheck.go │ │ ├── config │ │ ├── config.go │ │ └── example.conf │ │ ├── go │ │ ├── ast │ │ │ └── astutil │ │ │ │ ├── upstream.go │ │ │ │ └── util.go │ │ ├── buildid │ │ │ ├── UPSTREAM │ │ │ ├── buildid.go │ │ │ └── note.go │ │ ├── ir │ │ │ ├── LICENSE │ │ │ ├── UPSTREAM │ │ │ ├── blockopt.go │ │ │ ├── builder.go │ │ │ ├── const.go │ │ │ ├── create.go │ │ │ ├── doc.go │ │ │ ├── dom.go │ │ │ ├── emit.go │ │ │ ├── exits.go │ │ │ ├── func.go │ │ │ ├── html.go │ │ │ ├── irutil │ │ │ │ ├── load.go │ │ │ │ ├── loops.go │ │ │ │ ├── stub.go │ │ │ │ ├── switch.go │ │ │ │ ├── terminates.go │ │ │ │ ├── util.go │ │ │ │ └── visit.go │ │ │ ├── lift.go │ │ │ ├── lvalue.go │ │ │ ├── methods.go │ │ │ ├── mode.go │ │ │ ├── print.go │ │ │ ├── sanity.go │ │ │ ├── source.go │ │ │ ├── ssa.go │ │ │ ├── util.go │ │ │ ├── wrappers.go │ │ │ └── write.go │ │ ├── loader │ │ │ ├── hash.go │ │ │ └── loader.go │ │ └── types │ │ │ └── typeutil │ │ │ ├── ext.go │ │ │ ├── typeparams.go │ │ │ ├── upstream.go │ │ │ └── util.go │ │ ├── internal │ │ ├── passes │ │ │ └── buildir │ │ │ │ └── buildir.go │ │ ├── renameio │ │ │ ├── UPSTREAM │ │ │ └── renameio.go │ │ ├── robustio │ │ │ ├── UPSTREAM │ │ │ ├── robustio.go │ │ │ ├── robustio_darwin.go │ │ │ ├── robustio_flaky.go │ │ │ ├── robustio_other.go │ │ │ └── robustio_windows.go │ │ ├── sharedcheck │ │ │ └── lint.go │ │ └── sync │ │ │ └── sync.go │ │ ├── knowledge │ │ ├── arg.go │ │ ├── deprecated.go │ │ ├── doc.go │ │ ├── signatures.go │ │ └── targets.go │ │ ├── lintcmd │ │ ├── cache │ │ │ ├── UPSTREAM │ │ │ ├── cache.go │ │ │ ├── default.go │ │ │ └── hash.go │ │ ├── cmd.go │ │ ├── config.go │ │ ├── directives.go │ │ ├── format.go │ │ ├── lint.go │ │ ├── runner │ │ │ ├── runner.go │ │ │ └── stats.go │ │ ├── sarif.go │ │ ├── stats.go │ │ ├── stats_bsd.go │ │ ├── stats_posix.go │ │ └── version │ │ │ ├── buildinfo.go │ │ │ └── version.go │ │ ├── pattern │ │ ├── convert.go │ │ ├── doc.go │ │ ├── lexer.go │ │ ├── match.go │ │ ├── parser.go │ │ └── pattern.go │ │ ├── printf │ │ ├── fuzz.go │ │ └── printf.go │ │ ├── quickfix │ │ ├── analysis.go │ │ ├── doc.go │ │ ├── qf1001 │ │ │ └── qf1001.go │ │ ├── qf1002 │ │ │ └── qf1002.go │ │ ├── qf1003 │ │ │ └── qf1003.go │ │ ├── qf1004 │ │ │ └── qf1004.go │ │ ├── qf1005 │ │ │ └── qf1005.go │ │ ├── qf1006 │ │ │ └── qf1006.go │ │ ├── qf1007 │ │ │ └── qf1007.go │ │ ├── qf1008 │ │ │ └── qf1008.go │ │ ├── qf1009 │ │ │ └── qf1009.go │ │ ├── qf1010 │ │ │ └── qf1010.go │ │ ├── qf1011 │ │ │ └── qf1011.go │ │ └── qf1012 │ │ │ └── qf1012.go │ │ ├── sarif │ │ └── sarif.go │ │ ├── simple │ │ ├── analysis.go │ │ ├── doc.go │ │ ├── s1000 │ │ │ └── s1000.go │ │ ├── s1001 │ │ │ └── s1001.go │ │ ├── s1002 │ │ │ └── s1002.go │ │ ├── s1003 │ │ │ └── s1003.go │ │ ├── s1004 │ │ │ └── s1004.go │ │ ├── s1005 │ │ │ └── s1005.go │ │ ├── s1006 │ │ │ └── s1006.go │ │ ├── s1007 │ │ │ └── s1007.go │ │ ├── s1008 │ │ │ └── s1008.go │ │ ├── s1009 │ │ │ └── s1009.go │ │ ├── s1010 │ │ │ └── s1010.go │ │ ├── s1011 │ │ │ └── s1011.go │ │ ├── s1012 │ │ │ └── s1012.go │ │ ├── s1016 │ │ │ └── s1016.go │ │ ├── s1017 │ │ │ └── s1017.go │ │ ├── s1018 │ │ │ └── s1018.go │ │ ├── s1019 │ │ │ └── s1019.go │ │ ├── s1020 │ │ │ └── s1020.go │ │ ├── s1021 │ │ │ └── s1021.go │ │ ├── s1023 │ │ │ └── s1023.go │ │ ├── s1024 │ │ │ └── s1024.go │ │ ├── s1025 │ │ │ └── s1025.go │ │ ├── s1028 │ │ │ └── s1028.go │ │ ├── s1029 │ │ │ └── s1029.go │ │ ├── s1030 │ │ │ └── s1030.go │ │ ├── s1031 │ │ │ └── s1031.go │ │ ├── s1032 │ │ │ └── s1032.go │ │ ├── s1033 │ │ │ └── s1033.go │ │ ├── s1034 │ │ │ └── s1034.go │ │ ├── s1035 │ │ │ └── s1035.go │ │ ├── s1036 │ │ │ └── s1036.go │ │ ├── s1037 │ │ │ └── s1037.go │ │ ├── s1038 │ │ │ └── s1038.go │ │ ├── s1039 │ │ │ └── s1039.go │ │ └── s1040 │ │ │ └── s1040.go │ │ ├── staticcheck │ │ ├── analysis.go │ │ ├── doc.go │ │ ├── fakejson │ │ │ └── encode.go │ │ ├── fakereflect │ │ │ └── fakereflect.go │ │ ├── fakexml │ │ │ ├── marshal.go │ │ │ ├── typeinfo.go │ │ │ └── xml.go │ │ ├── sa1000 │ │ │ └── sa1000.go │ │ ├── sa1001 │ │ │ └── sa1001.go │ │ ├── sa1002 │ │ │ └── sa1002.go │ │ ├── sa1003 │ │ │ └── sa1003.go │ │ ├── sa1004 │ │ │ └── sa1004.go │ │ ├── sa1005 │ │ │ └── sa1005.go │ │ ├── sa1006 │ │ │ └── sa1006.go │ │ ├── sa1007 │ │ │ └── sa1007.go │ │ ├── sa1008 │ │ │ └── sa1008.go │ │ ├── sa1010 │ │ │ └── sa1010.go │ │ ├── sa1011 │ │ │ └── sa1011.go │ │ ├── sa1012 │ │ │ └── sa1012.go │ │ ├── sa1013 │ │ │ └── sa1013.go │ │ ├── sa1014 │ │ │ └── sa1014.go │ │ ├── sa1015 │ │ │ └── sa1015.go │ │ ├── sa1016 │ │ │ └── sa1016.go │ │ ├── sa1017 │ │ │ └── sa1017.go │ │ ├── sa1018 │ │ │ └── sa1018.go │ │ ├── sa1019 │ │ │ └── sa1019.go │ │ ├── sa1020 │ │ │ └── sa1020.go │ │ ├── sa1021 │ │ │ └── sa1021.go │ │ ├── sa1023 │ │ │ └── sa1023.go │ │ ├── sa1024 │ │ │ └── sa1024.go │ │ ├── sa1025 │ │ │ └── sa1025.go │ │ ├── sa1026 │ │ │ └── sa1026.go │ │ ├── sa1027 │ │ │ └── sa1027.go │ │ ├── sa1028 │ │ │ └── sa1028.go │ │ ├── sa1029 │ │ │ └── sa1029.go │ │ ├── sa1030 │ │ │ └── sa1030.go │ │ ├── sa1031 │ │ │ └── sa1031.go │ │ ├── sa1032 │ │ │ └── sa1032.go │ │ ├── sa2000 │ │ │ └── sa2000.go │ │ ├── sa2001 │ │ │ └── sa2001.go │ │ ├── sa2002 │ │ │ └── sa2002.go │ │ ├── sa2003 │ │ │ └── sa2003.go │ │ ├── sa3000 │ │ │ └── sa3000.go │ │ ├── sa3001 │ │ │ └── sa3001.go │ │ ├── sa4000 │ │ │ └── sa4000.go │ │ ├── sa4001 │ │ │ └── sa4001.go │ │ ├── sa4003 │ │ │ └── sa4003.go │ │ ├── sa4004 │ │ │ └── sa4004.go │ │ ├── sa4005 │ │ │ └── sa4005.go │ │ ├── sa4006 │ │ │ └── sa4006.go │ │ ├── sa4008 │ │ │ └── sa4008.go │ │ ├── sa4009 │ │ │ └── sa4009.go │ │ ├── sa4010 │ │ │ └── sa4010.go │ │ ├── sa4011 │ │ │ └── sa4011.go │ │ ├── sa4012 │ │ │ └── sa4012.go │ │ ├── sa4013 │ │ │ └── sa4013.go │ │ ├── sa4014 │ │ │ └── sa4014.go │ │ ├── sa4015 │ │ │ └── sa4015.go │ │ ├── sa4016 │ │ │ └── sa4016.go │ │ ├── sa4017 │ │ │ └── sa4017.go │ │ ├── sa4018 │ │ │ └── sa4018.go │ │ ├── sa4019 │ │ │ └── sa4019.go │ │ ├── sa4020 │ │ │ └── sa4020.go │ │ ├── sa4021 │ │ │ └── sa4021.go │ │ ├── sa4022 │ │ │ └── sa4022.go │ │ ├── sa4023 │ │ │ └── sa4023.go │ │ ├── sa4024 │ │ │ └── sa4024.go │ │ ├── sa4025 │ │ │ └── sa4025.go │ │ ├── sa4026 │ │ │ └── sa4026.go │ │ ├── sa4027 │ │ │ └── sa4027.go │ │ ├── sa4028 │ │ │ └── sa4028.go │ │ ├── sa4029 │ │ │ └── sa4029.go │ │ ├── sa4030 │ │ │ └── sa4030.go │ │ ├── sa4031 │ │ │ └── sa4031.go │ │ ├── sa4032 │ │ │ └── sa4032.go │ │ ├── sa5000 │ │ │ └── sa5000.go │ │ ├── sa5001 │ │ │ └── sa5001.go │ │ ├── sa5002 │ │ │ └── sa5002.go │ │ ├── sa5003 │ │ │ └── sa5003.go │ │ ├── sa5004 │ │ │ └── sa5004.go │ │ ├── sa5005 │ │ │ └── sa5005.go │ │ ├── sa5007 │ │ │ └── sa5007.go │ │ ├── sa5008 │ │ │ ├── sa5008.go │ │ │ └── structtag.go │ │ ├── sa5009 │ │ │ └── sa5009.go │ │ ├── sa5010 │ │ │ └── sa5010.go │ │ ├── sa5011 │ │ │ └── sa5011.go │ │ ├── sa5012 │ │ │ └── sa5012.go │ │ ├── sa6000 │ │ │ └── sa6000.go │ │ ├── sa6001 │ │ │ └── sa6001.go │ │ ├── sa6002 │ │ │ └── sa6002.go │ │ ├── sa6003 │ │ │ └── sa6003.go │ │ ├── sa6005 │ │ │ └── sa6005.go │ │ ├── sa6006 │ │ │ └── sa6006.go │ │ ├── sa9001 │ │ │ └── sa9001.go │ │ ├── sa9002 │ │ │ └── sa9002.go │ │ ├── sa9003 │ │ │ └── sa9003.go │ │ ├── sa9004 │ │ │ └── sa9004.go │ │ ├── sa9005 │ │ │ └── sa9005.go │ │ ├── sa9006 │ │ │ └── sa9006.go │ │ ├── sa9007 │ │ │ └── sa9007.go │ │ ├── sa9008 │ │ │ └── sa9008.go │ │ └── sa9009 │ │ │ └── sa9009.go │ │ ├── stylecheck │ │ ├── analysis.go │ │ ├── doc.go │ │ ├── st1000 │ │ │ └── st1000.go │ │ ├── st1001 │ │ │ └── st1001.go │ │ ├── st1003 │ │ │ └── st1003.go │ │ ├── st1005 │ │ │ └── st1005.go │ │ ├── st1006 │ │ │ └── st1006.go │ │ ├── st1008 │ │ │ └── st1008.go │ │ ├── st1011 │ │ │ └── st1011.go │ │ ├── st1012 │ │ │ └── st1012.go │ │ ├── st1013 │ │ │ └── st1013.go │ │ ├── st1015 │ │ │ └── st1015.go │ │ ├── st1016 │ │ │ └── st1016.go │ │ ├── st1017 │ │ │ └── st1017.go │ │ ├── st1018 │ │ │ └── st1018.go │ │ ├── st1019 │ │ │ └── st1019.go │ │ ├── st1020 │ │ │ └── st1020.go │ │ ├── st1021 │ │ │ └── st1021.go │ │ ├── st1022 │ │ │ └── st1022.go │ │ └── st1023 │ │ │ └── st1023.go │ │ └── unused │ │ ├── implements.go │ │ ├── runtime.go │ │ ├── serialize.go │ │ └── unused.go └── modules.txt └── version.go /.github/workflows/actionlint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Actionlint" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | jobs: 8 | Actionlint: 9 | runs-on: "ubuntu-24.04" 10 | steps: 11 | - uses: "actions/checkout@v4" 12 | - uses: "raven-actions/actionlint@v2" 13 | -------------------------------------------------------------------------------- /.github/workflows/audit.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Audit" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | schedule: 7 | - cron: "0 0 * * 1" 8 | workflow_dispatch: 9 | jobs: 10 | Audit: 11 | runs-on: "ubuntu-24.04" 12 | env: 13 | SNYK_TOKEN: "${{ secrets.SNYK_TOKEN }}" 14 | steps: 15 | - uses: "actions/checkout@v4" 16 | - uses: "actions/setup-go@v5" 17 | with: 18 | go-version: "1.24.2" 19 | - name: "provision go tools" 20 | run: "make go" 21 | - name: "install snyk" 22 | run: | 23 | sudo curl -Lo /bin/snyk https://downloads.snyk.io/cli/stable/snyk-linux 24 | sudo chmod a+x /bin/snyk 25 | - run: "mage audit" 26 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Lint" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | jobs: 8 | Lint: 9 | runs-on: "ubuntu-24.04" 10 | steps: 11 | - uses: "actions/checkout@v4" 12 | - uses: actions/setup-go@v5 13 | with: 14 | go-version: "1.24.2" 15 | - uses: "dtolnay/rust-toolchain@stable" 16 | with: 17 | toolchain: "1.86.0" 18 | - name: "provision dev tools" 19 | run: "make -j 4" 20 | - run: "mage lint" 21 | -------------------------------------------------------------------------------- /.github/workflows/rubberstamp.yml: -------------------------------------------------------------------------------- 1 | --- 2 | # 3 | # Rubberstamp v0.0.2 4 | # https://github.com/mcandre/rubberstamp 5 | # 6 | name: "Rubberstamp" 7 | on: # yamllint disable-line rule:truthy 8 | # POSIX cron format 9 | # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html 10 | schedule: 11 | # Once every 5 minutes 12 | # - cron: "*/5 * * * *" 13 | # Once a month 14 | - cron: "0 0 1 * *" 15 | workflow_dispatch: 16 | jobs: 17 | Audit: 18 | runs-on: "ubuntu-24.04" 19 | env: 20 | RUBBERSTAMP_GH_REPO: "${{ github.repository }}" 21 | SSH_KEY: "${{ secrets.SSH_KEY }}" 22 | steps: 23 | - uses: "actions/checkout@v4" 24 | - name: "provision git" 25 | run: | 26 | sudo apt-get update 27 | sudo apt-get install -y git 28 | git config --global user.email 'rubberstamp@rubberstamp.test' 29 | git config --global user.name 'Rubberstamp' 30 | git config --global core.sshCommand 'ssh -i /tmp/key' 31 | echo "$SSH_KEY" >/tmp/key 32 | chmod 0600 /tmp/key 33 | git remote set-url origin "git@github.com:${RUBBERSTAMP_GH_REPO}.git" 34 | - name: "stamp" 35 | run: | 36 | date -u >.rubberstamp 37 | git add .rubberstamp 38 | git commit -m 'rubberstamp' 39 | git push 40 | -------------------------------------------------------------------------------- /.github/workflows/test-crosscompile.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Test-Crosscompile" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | jobs: 8 | Test-Crosscompile: 9 | runs-on: "ubuntu-24.04" 10 | steps: 11 | - uses: "actions/checkout@v4" 12 | - uses: "actions/setup-go@v5" 13 | with: 14 | go-version: "1.24.2" 15 | - name: "provision go tools" 16 | run: "make -j go" 17 | - run: "mage port" 18 | -------------------------------------------------------------------------------- /.github/workflows/test-futureproof-dependencies.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Test-Futureproof-Dependencies" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | # POSIX cron format 7 | # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html 8 | schedule: 9 | # Once every 5 minutes 10 | # - cron: "*/5 * * * *" 11 | # Once a day 12 | - cron: "0 0 * * *" 13 | workflow_dispatch: 14 | jobs: 15 | Test-Futureproof-Dependencies: 16 | runs-on: "ubuntu-24.04" 17 | steps: 18 | - uses: "actions/checkout@v4" 19 | - uses: "actions/setup-go@v5" 20 | with: 21 | go-version: "1.24.2" 22 | - run: | 23 | go get -u all 24 | sh -c "go mod download && go mod vendor && go mod tidy" || echo 'go mod is silly' 25 | sh -c "go mod download && go mod vendor && go mod tidy" 26 | go test 27 | -------------------------------------------------------------------------------- /.github/workflows/test-futureproof-language.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Test-Futureproof-Language" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | # POSIX cron format 7 | # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html 8 | schedule: 9 | # Once every 5 minutes 10 | # - cron: "*/5 * * * *" 11 | # Once a day 12 | - cron: "0 0 * * *" 13 | workflow_dispatch: 14 | jobs: 15 | Test-Futureproof-Language: 16 | runs-on: "ubuntu-24.04" 17 | steps: 18 | - uses: "actions/checkout@v4" 19 | - uses: "actions/setup-go@v5" 20 | with: 21 | go-version: "stable" 22 | - run: "go test" 23 | -------------------------------------------------------------------------------- /.github/workflows/test-futureproof-os.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Test-Futureproof-OS" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | # POSIX cron format 7 | # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html 8 | schedule: 9 | # Once every 5 minutes 10 | # - cron: "*/5 * * * *" 11 | # Once a day 12 | - cron: "0 0 * * *" 13 | workflow_dispatch: 14 | jobs: 15 | Test-Futureproof-OS: 16 | runs-on: "ubuntu-latest" 17 | steps: 18 | - uses: "actions/checkout@v4" 19 | - uses: "actions/setup-go@v5" 20 | with: 21 | go-version: "1.24.2" 22 | - run: "go test" 23 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Test" 3 | on: # yamllint disable-line rule:truthy 4 | push: 5 | pull_request: 6 | workflow_dispatch: 7 | jobs: 8 | Test: 9 | runs-on: "ubuntu-24.04" 10 | steps: 11 | - uses: "actions/checkout@v4" 12 | - uses: "actions/setup-go@v5" 13 | with: 14 | go-version: "1.24.2" 15 | - run: "go test" 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | # Created by https://www.toptal.com/developers/gitignore/api/go 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=go 4 | 5 | ### Go ### 6 | # Binaries for programs and plugins 7 | *.exe 8 | *.exe~ 9 | *.dll 10 | *.so 11 | *.dylib 12 | 13 | # Test binary, built with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | 19 | # Dependency directories (remove the comment below to include it) 20 | # vendor/ 21 | 22 | ### Go Patch ### 23 | # /vendor/ 24 | /Godeps/ 25 | 26 | # End of https://www.toptal.com/developers/gitignore/api/go 27 | -------------------------------------------------------------------------------- /.rubberstamp: -------------------------------------------------------------------------------- 1 | Sun Jun 1 00:28:19 UTC 2025 2 | -------------------------------------------------------------------------------- /.tool-versions: -------------------------------------------------------------------------------- 1 | golang 1.24.2 2 | rust 1.86.0 3 | -------------------------------------------------------------------------------- /cmd/factorio/main.go: -------------------------------------------------------------------------------- 1 | // Package main implements a tool for automating Go cross-compilation. 2 | package main 3 | 4 | import ( 5 | "github.com/mcandre/factorio" 6 | 7 | "flag" 8 | "fmt" 9 | "log" 10 | "os" 11 | ) 12 | 13 | var flagVersion = flag.Bool("version", false, "show version") 14 | var flagHelp = flag.Bool("help", false, "show usage menu") 15 | 16 | func usage() { 17 | program, err := os.Executable() 18 | 19 | if err != nil { 20 | fmt.Fprint(os.Stderr, err) 21 | os.Exit(1) 22 | } 23 | 24 | fmt.Printf("Usage: %v [OPTION] [-- ]\n", program) 25 | flag.PrintDefaults() 26 | } 27 | 28 | func main() { 29 | flag.Parse() 30 | 31 | switch { 32 | case *flagVersion: 33 | fmt.Println(factorio.Version) 34 | os.Exit(0) 35 | case *flagHelp: 36 | usage() 37 | os.Exit(0) 38 | } 39 | 40 | args := flag.Args() 41 | 42 | if err := factorio.Port(args); err != nil { 43 | log.Fatal(err) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # DEMO APPS 2 | 3 | # EXAMPLES 4 | 5 | ```console 6 | $ hello 7 | Hello World! 8 | ``` 9 | 10 | # REQUIREMENTS 11 | 12 | * [Go](https://golang.org/) 1.24.1+ 13 | 14 | ## Recommended 15 | 16 | * POSIX compatible [tar](https://pubs.opengroup.org/onlinepubs/7908799/xcu/tar.html) 17 | 18 | # BUILD & INSTALL 19 | 20 | ```console 21 | $ go install ./... 22 | ``` 23 | 24 | # UNINSTALL 25 | 26 | ```console 27 | $ rm "${GOPATH}/bin/hello" 28 | ``` 29 | 30 | # PORT 31 | 32 | ```console 33 | $ FACTORIO_BANNER=hello-0.0.1 factorio 34 | $ sh -c "cd bin && tar czvf hello-0.0.1.tgz hello-0.0.1" 35 | ``` 36 | 37 | # CLEAN 38 | 39 | ```console 40 | $ rm -rf bin 41 | ``` 42 | -------------------------------------------------------------------------------- /example/cmd/hello/main.go: -------------------------------------------------------------------------------- 1 | // Package main implements a Hello World application. 2 | package main 3 | 4 | import ( 5 | "fmt" 6 | ) 7 | 8 | func main() { 9 | fmt.Println("Hello World!") 10 | } 11 | -------------------------------------------------------------------------------- /example/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mcandre/factorio/example 2 | 3 | go 1.24 4 | -------------------------------------------------------------------------------- /factorio_test.go: -------------------------------------------------------------------------------- 1 | package factorio_test 2 | 3 | import ( 4 | "github.com/mcandre/factorio" 5 | 6 | "testing" 7 | ) 8 | 9 | func TestPlatformMarshalingSymmetric(t *testing.T) { 10 | platformString := "linux/riscv64" 11 | platform, err := factorio.ParsePlatform(platformString) 12 | 13 | if err != nil { 14 | t.Error(err) 15 | } 16 | 17 | platformString2 := platform.String() 18 | 19 | if platformString2 != platformString { 20 | t.Errorf("expected symmetric marshaling for platform %v", platformString) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | .POSIX: 2 | .SILENT: 3 | .PHONY: \ 4 | all \ 5 | go \ 6 | rust 7 | 8 | all: go rust 9 | 10 | go: 11 | go install golang.org/x/tools/cmd/deadcode@latest 12 | go install golang.org/x/tools/cmd/goimports@latest 13 | go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest 14 | go install golang.org/x/vuln/cmd/govulncheck@latest 15 | go install tool 16 | go mod tidy 17 | 18 | rust: 19 | cargo install --force unmake@0.0.17 20 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/.gitignore: -------------------------------------------------------------------------------- 1 | /toml.test 2 | /toml-test 3 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/COPYING: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 TOML authors 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/deprecated.go: -------------------------------------------------------------------------------- 1 | package toml 2 | 3 | import ( 4 | "encoding" 5 | "io" 6 | ) 7 | 8 | // TextMarshaler is an alias for encoding.TextMarshaler. 9 | // 10 | // Deprecated: use encoding.TextMarshaler 11 | type TextMarshaler encoding.TextMarshaler 12 | 13 | // TextUnmarshaler is an alias for encoding.TextUnmarshaler. 14 | // 15 | // Deprecated: use encoding.TextUnmarshaler 16 | type TextUnmarshaler encoding.TextUnmarshaler 17 | 18 | // DecodeReader is an alias for NewDecoder(r).Decode(v). 19 | // 20 | // Deprecated: use NewDecoder(reader).Decode(&value). 21 | func DecodeReader(r io.Reader, v any) (MetaData, error) { return NewDecoder(r).Decode(v) } 22 | 23 | // PrimitiveDecode is an alias for MetaData.PrimitiveDecode(). 24 | // 25 | // Deprecated: use MetaData.PrimitiveDecode. 26 | func PrimitiveDecode(primValue Primitive, v any) error { 27 | md := MetaData{decoded: make(map[string]struct{})} 28 | return md.unify(primValue.undecoded, rvalue(v)) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/BurntSushi/toml/doc.go: -------------------------------------------------------------------------------- 1 | // Package toml implements decoding and encoding of TOML files. 2 | // 3 | // This package supports TOML v1.0.0, as specified at https://toml.io 4 | // 5 | // The github.com/BurntSushi/toml/cmd/tomlv package implements a TOML validator, 6 | // and can be used to verify if TOML document is valid. It can also be used to 7 | // print the type of each key. 8 | package toml 9 | -------------------------------------------------------------------------------- /vendor/github.com/alexkohler/nakedret/v2/.gitignore: -------------------------------------------------------------------------------- 1 | # editor specific 2 | .vscode 3 | 4 | # binary 5 | /nakedret 6 | 7 | # usage video for docs 8 | .github/images 9 | -------------------------------------------------------------------------------- /vendor/github.com/alexkohler/nakedret/v2/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alex Kohler 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/chavacava/garif/.gitignore: -------------------------------------------------------------------------------- 1 | *.test 2 | *.out 3 | .devcontainer/ -------------------------------------------------------------------------------- /vendor/github.com/chavacava/garif/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Salvador Cavadini 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/chavacava/garif/doc.go: -------------------------------------------------------------------------------- 1 | // Package garif defines all the GO structures required to model a SARIF log file. 2 | // These structures were created using the JSON-schema sarif-schema-2.1.0.json of SARIF logfiles 3 | // available at https://github.com/oasis-tcs/sarif-spec/tree/master/Schemata. 4 | // 5 | // The package provides constructors for all structures (see constructors.go) These constructors 6 | // ensure that the returned structure instantiation is valid with respect to the JSON schema and 7 | // should be used in place of plain structure instantiation. 8 | // The root structure is LogFile. 9 | // 10 | // The package provides utility decorators for the most commonly used structures (see decorators.go) 11 | package garif 12 | -------------------------------------------------------------------------------- /vendor/github.com/chavacava/garif/enums.go: -------------------------------------------------------------------------------- 1 | package garif 2 | 3 | type ResultKind string 4 | 5 | // declare JSON values 6 | const ( 7 | _pass ResultKind = "pass" 8 | _open ResultKind = "open" 9 | _informational ResultKind = "informational" 10 | _notApplicable ResultKind = "notApplicable" 11 | _review ResultKind = "review" 12 | _fail ResultKind = "fail" 13 | ) 14 | 15 | // create public visible constants with a namespace as enums 16 | const ( 17 | ResultKind_Pass ResultKind = _pass 18 | ResultKind_Open ResultKind = _open 19 | ResultKind_Informational ResultKind = _informational 20 | ResultKind_NotApplicable ResultKind = _notApplicable 21 | ResultKind_Review ResultKind = _review 22 | ResultKind_Fail ResultKind = _fail 23 | ) 24 | 25 | type ResultLevel string 26 | 27 | // declare JSON values 28 | const ( 29 | _warning ResultLevel = "warning" 30 | _error ResultLevel = "error" 31 | _note ResultLevel = "note" 32 | _none ResultLevel = "none" 33 | ) 34 | 35 | // create public visible constants with a namespace as enums 36 | const ( 37 | ResultLevel_Warning ResultLevel = _warning 38 | ResultLevel_Error ResultLevel = _error 39 | ResultLevel_Note ResultLevel = _note 40 | ResultLevel_None ResultLevel = _none 41 | ) 42 | -------------------------------------------------------------------------------- /vendor/github.com/chavacava/garif/io.go: -------------------------------------------------------------------------------- 1 | package garif 2 | 3 | import ( 4 | "encoding/json" 5 | "io" 6 | ) 7 | 8 | // Write writes the JSON 9 | func (l *LogFile) Write(w io.Writer) error { 10 | marshal, err := json.Marshal(l) 11 | if err != nil { 12 | return err 13 | } 14 | _, err = w.Write(marshal) 15 | return err 16 | } 17 | 18 | // PrettyWrite writes indented JSON 19 | func (l *LogFile) PrettyWrite(w io.Writer) error { 20 | marshal, err := json.MarshalIndent(l, "", " ") 21 | if err != nil { 22 | return err 23 | } 24 | _, err = w.Write(marshal) 25 | return err 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/color/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Fatih Arslan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/color/color_windows.go: -------------------------------------------------------------------------------- 1 | package color 2 | 3 | import ( 4 | "os" 5 | 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | func init() { 10 | // Opt-in for ansi color support for current process. 11 | // https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences 12 | var outMode uint32 13 | out := windows.Handle(os.Stdout.Fd()) 14 | if err := windows.GetConsoleMode(out, &outMode); err != nil { 15 | return 16 | } 17 | outMode |= windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING 18 | _ = windows.SetConsoleMode(out, outMode) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/hashicorp/go-version/version_collection.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) HashiCorp, Inc. 2 | // SPDX-License-Identifier: MPL-2.0 3 | 4 | package version 5 | 6 | // Collection is a type that implements the sort.Interface interface 7 | // so that versions can be sorted. 8 | type Collection []*Version 9 | 10 | func (v Collection) Len() int { 11 | return len(v) 12 | } 13 | 14 | func (v Collection) Less(i, j int) bool { 15 | return v[i].LessThan(v[j]) 16 | } 17 | 18 | func (v Collection) Swap(i, j int) { 19 | v[i], v[j] = v[j], v[i] 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/errcheck/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Kamil Kisiel 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/errcheck/errcheck/embedded_walker_121.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.22 2 | // +build !go1.22 3 | 4 | package errcheck 5 | 6 | import "go/types" 7 | 8 | func maybeUnalias(t types.Type) types.Type { 9 | return t 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/kisielk/errcheck/errcheck/embedded_walker_122.go: -------------------------------------------------------------------------------- 1 | //go:build go1.22 2 | // +build go1.22 3 | 4 | package errcheck 5 | 6 | import "go/types" 7 | 8 | func maybeUnalias(t types.Type) types.Type { 9 | return types.Unalias(t) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/.gitattributes: -------------------------------------------------------------------------------- 1 | site/* linguist-documentation 2 | vendor/* linguist-vendored -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/.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 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | 13 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 14 | .glide/ 15 | 16 | # Magefile output 17 | mage_output_file.go 18 | 19 | # VScode 20 | .vscode 21 | 22 | # stupid osx 23 | .DS_Store 24 | 25 | # Goland 26 | .idea 27 | *.iml 28 | 29 | # Vim 30 | *.sw[op] 31 | Session.vim 32 | *~ 33 | 34 | # GNU Screen 35 | .screenrc 36 | 37 | # Hugo build lock 38 | .hugo_build.lock 39 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/.goreleaser.yml: -------------------------------------------------------------------------------- 1 | project_name: mage 2 | release: 3 | github: 4 | owner: magefile 5 | name: mage 6 | draft: true 7 | build: 8 | binary: mage 9 | main: . 10 | ldflags: -s -w -X github.com/magefile/mage/mage.timestamp={{.Date}} -X github.com/magefile/mage/mage.commitHash={{.Commit}} -X github.com/magefile/mage/mage.gitTag={{.Version}} 11 | goos: 12 | - darwin 13 | - linux 14 | - windows 15 | - freebsd 16 | - netbsd 17 | - openbsd 18 | - dragonfly 19 | goarch: 20 | - amd64 21 | - arm 22 | - arm64 23 | ignore: 24 | - goos: openbsd 25 | goarch: arm 26 | goarm: 6 27 | env: 28 | - CGO_ENABLED=0 29 | archives: 30 | - 31 | name_template: "{{.Binary}}_{{.Version}}_{{.Os}}-{{.Arch}}" 32 | replacements: 33 | amd64: 64bit 34 | 386: 32bit 35 | arm: ARM 36 | arm64: ARM64 37 | darwin: macOS 38 | linux: Linux 39 | windows: Windows 40 | openbsd: OpenBSD 41 | netbsd: NetBSD 42 | freebsd: FreeBSD 43 | dragonfly: DragonFlyBSD 44 | format: tar.gz 45 | format_overrides: 46 | - goos: windows 47 | format: zip 48 | files: 49 | - LICENSE 50 | snapshot: 51 | name_template: SNAPSHOT-{{ .Commit }} 52 | checksum: 53 | name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' 54 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/mage/command_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Command"; DO NOT EDIT. 2 | 3 | package mage 4 | 5 | import "strconv" 6 | 7 | const _Command_name = "NoneVersionInitCleanCompileStatic" 8 | 9 | var _Command_index = [...]uint8{0, 4, 11, 15, 20, 33} 10 | 11 | func (i Command) String() string { 12 | if i < 0 || i >= Command(len(_Command_index)-1) { 13 | return "Command(" + strconv.FormatInt(int64(i), 10) + ")" 14 | } 15 | return _Command_name[_Command_index[i]:_Command_index[i+1]] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/mage/magefile_tmpl.go: -------------------------------------------------------------------------------- 1 | package mage 2 | 3 | var mageTpl = `//go:build mage 4 | // +build mage 5 | 6 | package main 7 | 8 | import ( 9 | "fmt" 10 | "os" 11 | "os/exec" 12 | 13 | "github.com/magefile/mage/mg" // mg contains helpful utility functions, like Deps 14 | ) 15 | 16 | // Default target to run when none is specified 17 | // If not set, running mage will list available targets 18 | // var Default = Build 19 | 20 | // A build step that requires additional params, or platform specific steps for example 21 | func Build() error { 22 | mg.Deps(InstallDeps) 23 | fmt.Println("Building...") 24 | cmd := exec.Command("go", "build", "-o", "MyApp", ".") 25 | return cmd.Run() 26 | } 27 | 28 | // A custom install step if you need your bin someplace other than go/bin 29 | func Install() error { 30 | mg.Deps(Build) 31 | fmt.Println("Installing...") 32 | return os.Rename("./MyApp", "/usr/bin/MyApp") 33 | } 34 | 35 | // Manage your deps, or running package managers. 36 | func InstallDeps() error { 37 | fmt.Println("Installing Deps...") 38 | cmd := exec.Command("go", "get", "github.com/stretchr/piglatin") 39 | return cmd.Run() 40 | } 41 | 42 | // Clean up after yourself 43 | func Clean() { 44 | fmt.Println("Cleaning...") 45 | os.RemoveAll("MyApp") 46 | } 47 | ` 48 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/magefile/mage/mage" 7 | ) 8 | 9 | func main() { 10 | os.Exit(mage.Main()) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/mg/color_string.go: -------------------------------------------------------------------------------- 1 | // Code generated by "stringer -type=Color"; DO NOT EDIT. 2 | 3 | package mg 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[Black-0] 12 | _ = x[Red-1] 13 | _ = x[Green-2] 14 | _ = x[Yellow-3] 15 | _ = x[Blue-4] 16 | _ = x[Magenta-5] 17 | _ = x[Cyan-6] 18 | _ = x[White-7] 19 | _ = x[BrightBlack-8] 20 | _ = x[BrightRed-9] 21 | _ = x[BrightGreen-10] 22 | _ = x[BrightYellow-11] 23 | _ = x[BrightBlue-12] 24 | _ = x[BrightMagenta-13] 25 | _ = x[BrightCyan-14] 26 | _ = x[BrightWhite-15] 27 | } 28 | 29 | const _Color_name = "BlackRedGreenYellowBlueMagentaCyanWhiteBrightBlackBrightRedBrightGreenBrightYellowBrightBlueBrightMagentaBrightCyanBrightWhite" 30 | 31 | var _Color_index = [...]uint8{0, 5, 8, 13, 19, 23, 30, 34, 39, 50, 59, 70, 82, 92, 105, 115, 126} 32 | 33 | func (i Color) String() string { 34 | if i < 0 || i >= Color(len(_Color_index)-1) { 35 | return "Color(" + strconv.FormatInt(int64(i), 10) + ")" 36 | } 37 | return _Color_name[_Color_index[i]:_Color_index[i+1]] 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/mg/errors.go: -------------------------------------------------------------------------------- 1 | package mg 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | type fatalErr struct { 9 | code int 10 | error 11 | } 12 | 13 | func (f fatalErr) ExitStatus() int { 14 | return f.code 15 | } 16 | 17 | type exitStatus interface { 18 | ExitStatus() int 19 | } 20 | 21 | // Fatal returns an error that will cause mage to print out the 22 | // given args and exit with the given exit code. 23 | func Fatal(code int, args ...interface{}) error { 24 | return fatalErr{ 25 | code: code, 26 | error: errors.New(fmt.Sprint(args...)), 27 | } 28 | } 29 | 30 | // Fatalf returns an error that will cause mage to print out the 31 | // given message and exit with the given exit code. 32 | func Fatalf(code int, format string, args ...interface{}) error { 33 | return fatalErr{ 34 | code: code, 35 | error: fmt.Errorf(format, args...), 36 | } 37 | } 38 | 39 | // ExitStatus queries the error for an exit status. If the error is nil, it 40 | // returns 0. If the error does not implement ExitStatus() int, it returns 1. 41 | // Otherwise it retiurns the value from ExitStatus(). 42 | func ExitStatus(err error) int { 43 | if err == nil { 44 | return 0 45 | } 46 | exit, ok := err.(exitStatus) 47 | if !ok { 48 | return 1 49 | } 50 | return exit.ExitStatus() 51 | } 52 | -------------------------------------------------------------------------------- /vendor/github.com/magefile/mage/sh/helpers.go: -------------------------------------------------------------------------------- 1 | package sh 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | ) 8 | 9 | // Rm removes the given file or directory even if non-empty. It will not return 10 | // an error if the target doesn't exist, only if the target cannot be removed. 11 | func Rm(path string) error { 12 | err := os.RemoveAll(path) 13 | if err == nil || os.IsNotExist(err) { 14 | return nil 15 | } 16 | return fmt.Errorf(`failed to remove %s: %v`, path, err) 17 | } 18 | 19 | // Copy robustly copies the source file to the destination, overwriting the destination if necessary. 20 | func Copy(dst string, src string) error { 21 | from, err := os.Open(src) 22 | if err != nil { 23 | return fmt.Errorf(`can't copy %s: %v`, src, err) 24 | } 25 | defer from.Close() 26 | finfo, err := from.Stat() 27 | if err != nil { 28 | return fmt.Errorf(`can't stat %s: %v`, src, err) 29 | } 30 | to, err := os.OpenFile(dst, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, finfo.Mode()) 31 | if err != nil { 32 | return fmt.Errorf(`can't copy to %s: %v`, dst, err) 33 | } 34 | defer to.Close() 35 | _, err = io.Copy(to, from) 36 | if err != nil { 37 | return fmt.Errorf(`error copying %s to %s: %v`, src, dst, err) 38 | } 39 | return nil 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 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/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-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // NonColorable holds writer but removes escape sequence. 9 | type NonColorable struct { 10 | out io.Writer 11 | } 12 | 13 | // NewNonColorable returns new instance of Writer which removes escape sequence from Writer. 14 | func NewNonColorable(w io.Writer) io.Writer { 15 | return &NonColorable{out: w} 16 | } 17 | 18 | // Write writes data on console 19 | func (w *NonColorable) Write(data []byte) (n int, err error) { 20 | er := bytes.NewReader(data) 21 | var plaintext bytes.Buffer 22 | loop: 23 | for { 24 | c1, err := er.ReadByte() 25 | if err != nil { 26 | plaintext.WriteTo(w.out) 27 | break loop 28 | } 29 | if c1 != 0x1b { 30 | plaintext.WriteByte(c1) 31 | continue 32 | } 33 | _, err = plaintext.WriteTo(w.out) 34 | if err != nil { 35 | break loop 36 | } 37 | c2, err := er.ReadByte() 38 | if err != nil { 39 | break loop 40 | } 41 | if c2 != 0x5b { 42 | continue 43 | } 44 | 45 | for { 46 | c, err := er.ReadByte() 47 | if err != nil { 48 | break loop 49 | } 50 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 51 | break 52 | } 53 | } 54 | } 55 | 56 | return len(data), nil 57 | } 58 | -------------------------------------------------------------------------------- /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/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /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 && !tinygo 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build (appengine || js || nacl || tinygo || wasm) && !windows 2 | // +build appengine js nacl tinygo wasm 3 | // +build !windows 4 | 5 | package isatty 6 | 7 | // IsTerminal returns true if the file descriptor is terminal which 8 | // is always false on js and appengine classic which is a sandboxed PaaS. 9 | func IsTerminal(fd uintptr) bool { 10 | return false 11 | } 12 | 13 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 14 | // terminal. This is also always false on this environment. 15 | func IsCygwinTerminal(fd uintptr) bool { 16 | return false 17 | } 18 | -------------------------------------------------------------------------------- /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 && !tinygo 2 | // +build linux aix zos 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 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/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/mcandre/mage-extras/.gitignore: -------------------------------------------------------------------------------- 1 | cover.html 2 | # Created by https://www.gitignore.io/api/go 3 | 4 | ### Go ### 5 | # Binaries for programs and plugins 6 | *.exe 7 | *.exe~ 8 | *.dll 9 | *.so 10 | *.dylib 11 | 12 | # Test binary, build with `go test -c` 13 | *.test 14 | 15 | # Output of the go coverage tool, specifically when used with LiteIDE 16 | *.out 17 | 18 | 19 | # End of https://www.gitignore.io/api/go 20 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/.rubberstamp: -------------------------------------------------------------------------------- 1 | Sat Mar 1 00:06:47 UTC 2025 2 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/.tool-versions: -------------------------------------------------------------------------------- 1 | golang 1.24.0 2 | rust 1.75.0 3 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/archive.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | ) 8 | 9 | // Archive compresses build artifacts. 10 | func Archive(portBasename string, artifactsPath string) error { 11 | archiveFilename := fmt.Sprintf("%s.tgz", portBasename) 12 | cmd := exec.Command("tar") 13 | cmd.Args = append(cmd.Args, "czf", archiveFilename, portBasename) 14 | cmd.Dir = artifactsPath 15 | cmd.Stdout = os.Stdout 16 | cmd.Stderr = os.Stderr 17 | return cmd.Run() 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/binaries.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/user" 6 | "path" 7 | ) 8 | 9 | // LoadedGoBinariesPath denotes the path to the Go binaries directory. 10 | // Populated with LoadGoBinariesPath(). 11 | var LoadedGoBinariesPath = "" 12 | 13 | // LoadGoBinariesPath populates LoadedGoBinariesPath. 14 | func LoadGoBinariesPath() error { 15 | goPath := os.Getenv("GOPATH") 16 | 17 | if goPath == "" { 18 | user, err := user.Current() 19 | 20 | if err != nil { 21 | return err 22 | } 23 | 24 | goPath = path.Join(user.HomeDir, "go") 25 | } 26 | 27 | LoadedGoBinariesPath = path.Join(goPath, "bin") 28 | 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/compile.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Compile runs go build recursively. 9 | func Compile(args ...string) error { 10 | cmd := exec.Command("go", "build") 11 | cmd.Args = append(cmd.Args, "build") 12 | cmd.Args = append(cmd.Args, args...) 13 | cmd.Args = append(cmd.Args, AllPackagesPath) 14 | cmd.Stdout = os.Stdout 15 | cmd.Stderr = os.Stderr 16 | return cmd.Run() 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/coverage.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | ) 8 | 9 | // CoverageHTML generates HTML formatted coverage data. 10 | func CoverageHTML(htmlFilename string, profileFilename string) error { 11 | cmd := exec.Command( 12 | "go", 13 | "tool", 14 | "cover", 15 | fmt.Sprintf("-html=%s", profileFilename), 16 | "-o", 17 | htmlFilename, 18 | ) 19 | cmd.Stdin = os.Stdin 20 | cmd.Stderr = os.Stderr 21 | return cmd.Run() 22 | } 23 | 24 | // CoverageProfile generates raw coverage data. 25 | func CoverageProfile(profileFilename string) error { 26 | cmd := exec.Command( 27 | "go", 28 | "test", 29 | fmt.Sprintf("-coverprofile=%s", profileFilename), 30 | ) 31 | cmd.Stdin = os.Stdin 32 | cmd.Stdout = os.Stdout 33 | return cmd.Run() 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/deadcode.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Deadcode runs deadcode. 9 | func Deadcode(args ...string) error { 10 | cmd := exec.Command("deadcode") 11 | cmd.Args = append(cmd.Args, args...) 12 | cmd.Stdout = os.Stdout 13 | cmd.Stderr = os.Stderr 14 | return cmd.Run() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/dockerscout.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // DockerScout executes a docker security audit. 9 | func DockerScout(args ...string) error { 10 | cmd := exec.Command("docker") 11 | cmd.Args = append(cmd.Args, "scout") 12 | cmd.Args = append(cmd.Args, "cves") 13 | cmd.Args = append(cmd.Args, args...) 14 | cmd.Stdout = os.Stdout 15 | cmd.Stderr = os.Stderr 16 | return cmd.Run() 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/errcheck.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Errcheck runs errcheck. 9 | func Errcheck(args ...string) error { 10 | cmd := exec.Command("errcheck") 11 | cmd.Args = append(cmd.Args, args...) 12 | cmd.Stdout = os.Stdout 13 | cmd.Stderr = os.Stderr 14 | return cmd.Run() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/factorio.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | ) 8 | 9 | // Factorio cross-compiles Go binaries for a multitude of platforms. 10 | func Factorio(banner string, args ...string) error { 11 | cmd := exec.Command("factorio") 12 | cmd.Args = append(cmd.Args, args...) 13 | cmd.Env = os.Environ() 14 | cmd.Env = append(cmd.Env, fmt.Sprintf("FACTORIO_BANNER=%s", banner)) 15 | cmd.Stdout = os.Stdout 16 | cmd.Stderr = os.Stderr 17 | return cmd.Run() 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/gofmt.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | 7 | "github.com/magefile/mage/mg" 8 | ) 9 | 10 | // GoFmt runs gofmt. 11 | func GoFmt(args ...string) error { 12 | mg.Deps(CollectGoFiles) 13 | 14 | for pth := range CollectedGoFiles { 15 | cmd := exec.Command("gofmt") 16 | cmd.Args = append(cmd.Args, args...) 17 | cmd.Args = append(cmd.Args, pth) 18 | cmd.Stdout = os.Stdout 19 | cmd.Stderr = os.Stderr 20 | 21 | if err := cmd.Run(); err != nil { 22 | return err 23 | } 24 | } 25 | 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/goimports.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | 7 | "github.com/magefile/mage/mg" 8 | ) 9 | 10 | // GoImports runs goimports. 11 | func GoImports(args ...string) error { 12 | mg.Deps(CollectGoFiles) 13 | 14 | for pth := range CollectedGoFiles { 15 | cmd := exec.Command("goimports") 16 | cmd.Args = append(cmd.Args, args...) 17 | cmd.Args = append(cmd.Args, pth) 18 | cmd.Stdout = os.Stdout 19 | cmd.Stderr = os.Stderr 20 | 21 | if err := cmd.Run(); err != nil { 22 | return err 23 | } 24 | } 25 | 26 | return nil 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/golint.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | 7 | "github.com/magefile/mage/mg" 8 | ) 9 | 10 | // GoLint runs golint. 11 | func GoLint(args ...string) error { 12 | mg.Deps(CollectGoFiles) 13 | 14 | cmdName := "golint" 15 | 16 | for pth := range CollectedGoFiles { 17 | cmdParameters := []string{cmdName} 18 | cmdParameters = append(cmdParameters, args...) 19 | cmdParameters = append(cmdParameters, pth) 20 | 21 | cmd := exec.Command(cmdName) 22 | cmd.Args = cmdParameters 23 | cmd.Stdout = os.Stdout 24 | cmd.Stderr = os.Stderr 25 | 26 | if err := cmd.Run(); err != nil { 27 | return err 28 | } 29 | } 30 | 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/govulncheck.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Govulncheck runs govulncheck. 9 | func Govulncheck(args ...string) error { 10 | cmd := exec.Command("govulncheck") 11 | cmd.Args = append(cmd.Args, args...) 12 | cmd.Stdout = os.Stdout 13 | cmd.Stderr = os.Stderr 14 | return cmd.Run() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/install.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | "path" 7 | 8 | "github.com/magefile/mage/mg" 9 | ) 10 | 11 | // Install builds and installs Go applications. 12 | func Install(args ...string) error { 13 | cmd := exec.Command("go") 14 | cmd.Args = append(cmd.Args, "install") 15 | cmd.Args = append(cmd.Args, args...) 16 | cmd.Args = append(cmd.Args, AllPackagesPath) 17 | cmd.Stdout = os.Stdout 18 | cmd.Stderr = os.Stderr 19 | return cmd.Run() 20 | } 21 | 22 | // Uninstall deletes installed Go applications. 23 | func Uninstall(applications ...string) error { 24 | mg.Deps(LoadGoBinariesPath) 25 | 26 | for _, application := range applications { 27 | if err := os.RemoveAll(path.Join(LoadedGoBinariesPath, application)); err != nil { 28 | return err 29 | } 30 | } 31 | 32 | return nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/mageextras.go: -------------------------------------------------------------------------------- 1 | // Package mageextras provides premade tasks for common mage workflows. 2 | package mageextras 3 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/makefile: -------------------------------------------------------------------------------- 1 | .POSIX: 2 | .SILENT: 3 | .PHONY: \ 4 | all \ 5 | go \ 6 | rust 7 | 8 | all: go rust 9 | 10 | go: 11 | go install golang.org/x/tools/cmd/goimports@latest 12 | go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest 13 | go install golang.org/x/vuln/cmd/govulncheck@latest 14 | go mod tidy 15 | go install tool 16 | 17 | rust: 18 | cargo install --force unmake@0.0.17 19 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/nakedret.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Nakedret runs nakedret. 9 | func Nakedret(args ...string) error { 10 | cmd := exec.Command("nakedret") 11 | cmd.Args = append(cmd.Args, args...) 12 | cmd.Args = append(cmd.Args, "./...") 13 | cmd.Stdout = os.Stdout 14 | cmd.Stderr = os.Stderr 15 | return cmd.Run() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/packages.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // AllPackagesPath denotes all Go packages in a project. 8 | var AllPackagesPath = strings.Join([]string{".", "..."}, PathSeparatorString) 9 | 10 | // AllCommandsPath denotes all Go application packages in this project. 11 | var AllCommandsPath = strings.Join([]string{".", "cmd", "..."}, PathSeparatorString) 12 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/pathseparator.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | ) 6 | 7 | // PathSeparatorString models the os.PathSeparator as a string. 8 | var PathSeparatorString = string(os.PathSeparator) 9 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/revive.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Revive runs revive. 9 | func Revive(args ...string) error { 10 | cmd := exec.Command("revive") 11 | cmd.Args = append(cmd.Args, "-exclude", "vendor/...") 12 | cmd.Args = append(cmd.Args, args...) 13 | cmd.Args = append(cmd.Args, "./...") 14 | cmd.Stdout = os.Stdout 15 | cmd.Stderr = os.Stderr 16 | return cmd.Run() 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/snyk.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // SnykTest executes a snyk security audit. 9 | func SnykTest(args ...string) error { 10 | cmd := exec.Command("snyk") 11 | cmd.Args = append(cmd.Args, "test") 12 | cmd.Args = append(cmd.Args, args...) 13 | cmd.Stdout = os.Stdout 14 | cmd.Stderr = os.Stderr 15 | return cmd.Run() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/staticcheck.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Staticcheck runs staticcheck. 9 | func Staticcheck(args ...string) error { 10 | cmd := exec.Command("staticcheck") 11 | cmd.Args = append(cmd.Args, args...) 12 | cmd.Stdout = os.Stdout 13 | cmd.Stderr = os.Stderr 14 | return cmd.Run() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/test.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // UnitTest executes the Go unit test suite. 9 | func UnitTest(args ...string) error { 10 | cmd := exec.Command("go") 11 | cmd.Args = append(cmd.Args, "test") 12 | cmd.Args = append(cmd.Args, args...) 13 | cmd.Stdout = os.Stdout 14 | cmd.Stderr = os.Stderr 15 | return cmd.Run() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/unmake.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Unmake runs unmake. 9 | func Unmake(args ...string) error { 10 | cmd := exec.Command("unmake") 11 | cmd.Args = append(cmd.Args, args...) 12 | cmd.Stdout = os.Stdout 13 | cmd.Stderr = os.Stderr 14 | return cmd.Run() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/version.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | // Version is semver. 4 | var Version = "0.0.23" 5 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/vet.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "os/exec" 7 | ) 8 | 9 | // GoVetShadow runs go vet against all Go packages in a project, 10 | // with variable shadow checking enabled. 11 | // 12 | // Depends on golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow 13 | func GoVetShadow() error { 14 | shadowPath, err := exec.LookPath("shadow") 15 | 16 | if err != nil { 17 | return err 18 | } 19 | 20 | return GoVet(fmt.Sprintf("-vettool=%s", shadowPath)) 21 | } 22 | 23 | // GoVet runs go vet against all Go packages in a project. 24 | func GoVet(args ...string) error { 25 | cmd := exec.Command("go") 26 | cmd.Args = append(cmd.Args, "vet") 27 | cmd.Args = append(cmd.Args, args...) 28 | cmd.Args = append(cmd.Args, AllPackagesPath) 29 | cmd.Stdout = os.Stdout 30 | cmd.Stderr = os.Stderr 31 | return cmd.Run() 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/xgo.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Xgo cross-compiles (c)Go binaries with additional targets enabled. 9 | func Xgo(outputPath string, args ...string) error { 10 | if err := os.MkdirAll(outputPath, os.ModeDir|0775); err != nil { 11 | return err 12 | } 13 | 14 | var xgoParts []string 15 | xgoParts = append(xgoParts, "-dest") 16 | xgoParts = append(xgoParts, outputPath) 17 | xgoParts = append(xgoParts, args...) 18 | 19 | cmd := exec.Command( 20 | "xgo", 21 | xgoParts..., 22 | ) 23 | cmd.Stdout = os.Stdout 24 | cmd.Stderr = os.Stderr 25 | return cmd.Run() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/mcandre/mage-extras/yamllint.go: -------------------------------------------------------------------------------- 1 | package mageextras 2 | 3 | import ( 4 | "os" 5 | "os/exec" 6 | ) 7 | 8 | // Yamllint runs yamllint. 9 | func Yamllint(args ...string) error { 10 | cmd := exec.Command("yamllint") 11 | cmd.Args = append(cmd.Args, args...) 12 | cmd.Stdout = os.Stdout 13 | cmd.Stderr = os.Stderr 14 | return cmd.Run() 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/dots/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: master 3 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/dots/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Minko Gechev 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/mgechev/revive/.docs-deploy-key.pem.enc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mcandre/factorio/835d66b61dc63d563b32e06f4807234f3bbbddab/vendor/github.com/mgechev/revive/.docs-deploy-key.pem.enc -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/.gitignore: -------------------------------------------------------------------------------- 1 | golinter 2 | revive 3 | vendor 4 | *.swp 5 | dist/ 6 | *.log 7 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/.goreleaser.yml: -------------------------------------------------------------------------------- 1 | # This is an example goreleaser.yaml file with some sane defaults. 2 | # Make sure to check the documentation at http://goreleaser.com 3 | --- 4 | version: 2 5 | archives: 6 | - id: revive 7 | name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' 8 | before: 9 | hooks: 10 | - "go mod download" 11 | - "go generate ./..." 12 | builds: 13 | - 14 | env: 15 | - CGO_ENABLED=0 16 | - BUILDER=GoReleaser 17 | goos: 18 | - linux 19 | - darwin 20 | - windows 21 | 22 | changelog: 23 | filters: 24 | exclude: 25 | - "^docs:" 26 | - "^test:" 27 | sort: asc 28 | checksum: 29 | name_template: checksums.txt 30 | snapshot: 31 | version_template: "{{ .Tag }}-next" 32 | project_name: revive 33 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=$BUILDPLATFORM golang:1.24 AS build 2 | 3 | ARG VERSION 4 | ARG REVISION 5 | ARG BUILDTIME 6 | ARG BUILDER 7 | 8 | ARG TARGETOS 9 | ARG TARGETARCH 10 | 11 | ENV CGO_ENABLED=0 12 | 13 | WORKDIR /src 14 | COPY . . 15 | 16 | RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build \ 17 | -ldflags "-X github.com/mgechev/revive/cli.version=${VERSION} -X github.com/mgechev/revive/cli.commit=${REVISION} -X github.com/mgechev/revive/cli.date=${BUILDTIME} -X github.com/mgechev/revive/cli.builtBy=${BUILDER}" 18 | 19 | FROM scratch 20 | 21 | COPY --from=build /src/revive /revive 22 | 23 | ENTRYPOINT ["/revive"] -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Minko Gechev 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/mgechev/revive/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: test lint 2 | 3 | export GO111MODULE=on 4 | 5 | GIT_COMMIT ?= $(shell git rev-parse --verify HEAD) 6 | GIT_VERSION ?= $(shell git describe --tags --always --dirty="-dev") 7 | DATE ?= $(shell date -u '+%Y-%m-%d %H:%M UTC') 8 | BUILDER ?= Makefile 9 | VERSION_FLAGS := -X "github.com/mgechev/revive/cli.version=$(GIT_VERSION)" -X "github.com/mgechev/revive/cli.date=$(DATE)" -X "github.com/mgechev/revive/cli.commit=$(GIT_COMMIT)" -X "github.com/mgechev/revive/cli.builtBy=$(BUILDER)" 10 | 11 | all: test lint build 12 | 13 | install: 14 | @go mod vendor 15 | 16 | build: 17 | @go build -ldflags='$(VERSION_FLAGS)' 18 | 19 | lint: 20 | revive --config revive.toml ./... 21 | 22 | test: 23 | @go test -v -race ./... 24 | 25 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/defaults.toml: -------------------------------------------------------------------------------- 1 | ignoreGeneratedHeader = false 2 | severity = "warning" 3 | confidence = 0.8 4 | errorCode = 0 5 | warningCode = 0 6 | 7 | [rule.blank-imports] 8 | [rule.context-as-argument] 9 | [rule.context-keys-type] 10 | [rule.dot-imports] 11 | [rule.empty-block] 12 | [rule.error-naming] 13 | [rule.error-return] 14 | [rule.error-strings] 15 | [rule.errorf] 16 | [rule.exported] 17 | [rule.increment-decrement] 18 | [rule.indent-error-flow] 19 | [rule.package-comments] 20 | [rule.range] 21 | [rule.receiver-naming] 22 | [rule.redefines-builtin-id] 23 | [rule.superfluous-else] 24 | [rule.time-naming] 25 | [rule.unexported-return] 26 | [rule.unreachable-code] 27 | [rule.unused-parameter] 28 | [rule.var-declaration] 29 | [rule.var-naming] 30 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/formatter/default.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | 7 | "github.com/mgechev/revive/lint" 8 | ) 9 | 10 | // Default is an implementation of the Formatter interface 11 | // which formats the errors to text. 12 | type Default struct { 13 | Metadata lint.FormatterMetadata 14 | } 15 | 16 | // Name returns the name of the formatter 17 | func (*Default) Name() string { 18 | return "default" 19 | } 20 | 21 | // Format formats the failures gotten from the lint. 22 | func (*Default) Format(failures <-chan lint.Failure, _ lint.Config) (string, error) { 23 | var buf bytes.Buffer 24 | for failure := range failures { 25 | fmt.Fprintf(&buf, "%v: %s\n", failure.Position.Start, failure.Failure) 26 | } 27 | return buf.String(), nil 28 | } 29 | 30 | func ruleDescriptionURL(ruleName string) string { 31 | return "https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#" + ruleName 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/formatter/doc.go: -------------------------------------------------------------------------------- 1 | // Package formatter implements the linter output formatters. 2 | package formatter 3 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/formatter/json.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/mgechev/revive/lint" 7 | ) 8 | 9 | // JSON is an implementation of the Formatter interface 10 | // which formats the errors to JSON. 11 | type JSON struct { 12 | Metadata lint.FormatterMetadata 13 | } 14 | 15 | // Name returns the name of the formatter 16 | func (*JSON) Name() string { 17 | return "json" 18 | } 19 | 20 | // jsonObject defines a JSON object of an failure 21 | type jsonObject struct { 22 | Severity lint.Severity 23 | lint.Failure `json:",inline"` 24 | } 25 | 26 | // Format formats the failures gotten from the lint. 27 | func (*JSON) Format(failures <-chan lint.Failure, config lint.Config) (string, error) { 28 | var slice []jsonObject 29 | for failure := range failures { 30 | obj := jsonObject{} 31 | obj.Severity = severity(config, failure) 32 | obj.Failure = failure 33 | slice = append(slice, obj) 34 | } 35 | result, err := json.Marshal(slice) 36 | if err != nil { 37 | return "", err 38 | } 39 | return string(result), err 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/formatter/ndjson.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | 7 | "github.com/mgechev/revive/lint" 8 | ) 9 | 10 | // NDJSON is an implementation of the Formatter interface 11 | // which formats the errors to NDJSON stream. 12 | type NDJSON struct { 13 | Metadata lint.FormatterMetadata 14 | } 15 | 16 | // Name returns the name of the formatter 17 | func (*NDJSON) Name() string { 18 | return "ndjson" 19 | } 20 | 21 | // Format formats the failures gotten from the lint. 22 | func (*NDJSON) Format(failures <-chan lint.Failure, config lint.Config) (string, error) { 23 | var buf bytes.Buffer 24 | enc := json.NewEncoder(&buf) 25 | for failure := range failures { 26 | obj := jsonObject{} 27 | obj.Severity = severity(config, failure) 28 | obj.Failure = failure 29 | err := enc.Encode(obj) 30 | if err != nil { 31 | return "", err 32 | } 33 | } 34 | return buf.String(), nil 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/formatter/plain.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/mgechev/revive/lint" 8 | ) 9 | 10 | // Plain is an implementation of the Formatter interface 11 | // which formats the errors to JSON. 12 | type Plain struct { 13 | Metadata lint.FormatterMetadata 14 | } 15 | 16 | // Name returns the name of the formatter 17 | func (*Plain) Name() string { 18 | return "plain" 19 | } 20 | 21 | // Format formats the failures gotten from the lint. 22 | func (*Plain) Format(failures <-chan lint.Failure, _ lint.Config) (string, error) { 23 | var sb strings.Builder 24 | for failure := range failures { 25 | sb.WriteString(fmt.Sprintf("%v: %s %s\n", failure.Position.Start, failure.Failure, ruleDescriptionURL(failure.RuleName))) 26 | } 27 | return sb.String(), nil 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/formatter/severity.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import "github.com/mgechev/revive/lint" 4 | 5 | func severity(config lint.Config, failure lint.Failure) lint.Severity { 6 | if config, ok := config.Rules[failure.RuleName]; ok && config.Severity == lint.SeverityError { 7 | return lint.SeverityError 8 | } 9 | if config, ok := config.Directives[failure.RuleName]; ok && config.Severity == lint.SeverityError { 10 | return lint.SeverityError 11 | } 12 | return lint.SeverityWarning 13 | } 14 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/formatter/unix.go: -------------------------------------------------------------------------------- 1 | package formatter 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/mgechev/revive/lint" 8 | ) 9 | 10 | // Unix is an implementation of the Formatter interface 11 | // which formats the errors to a simple line based error format 12 | // 13 | // main.go:24:9: [errorf] should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) 14 | type Unix struct { 15 | Metadata lint.FormatterMetadata 16 | } 17 | 18 | // Name returns the name of the formatter 19 | func (*Unix) Name() string { 20 | return "unix" 21 | } 22 | 23 | // Format formats the failures gotten from the lint. 24 | func (*Unix) Format(failures <-chan lint.Failure, _ lint.Config) (string, error) { 25 | var sb strings.Builder 26 | for failure := range failures { 27 | sb.WriteString(fmt.Sprintf("%v: [%s] %s\n", failure.Position.Start, failure.RuleName, failure.Failure)) 28 | } 29 | return sb.String(), nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/internal/ifelse/args.go: -------------------------------------------------------------------------------- 1 | package ifelse 2 | 3 | // Args contains arguments common to the early-return, indent-error-flow 4 | // and superfluous-else rules 5 | type Args struct { 6 | PreserveScope bool 7 | AllowJump bool 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/internal/ifelse/chain.go: -------------------------------------------------------------------------------- 1 | package ifelse 2 | 3 | // Chain contains information about an if-else chain. 4 | type Chain struct { 5 | If Branch // what happens at the end of the "if" block 6 | HasElse bool // is there an "else" block? 7 | Else Branch // what happens at the end of the "else" block 8 | HasInitializer bool // is there an "if"-initializer somewhere in the chain? 9 | HasPriorNonDeviating bool // is there a prior "if" block that does NOT deviate control flow? 10 | AtBlockEnd bool // whether the chain is placed at the end of the surrounding block 11 | BlockEndKind BranchKind // control flow at end of surrounding block (e.g. "return" for function body) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/internal/ifelse/doc.go: -------------------------------------------------------------------------------- 1 | // Package ifelse provides helpers for analyzing the control flow in if-else chains, 2 | // presently used by the following rules: 3 | // - early-return 4 | // - indent-error-flow 5 | // - superfluous-else 6 | package ifelse 7 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/internal/ifelse/target.go: -------------------------------------------------------------------------------- 1 | package ifelse 2 | 3 | import "go/ast" 4 | 5 | // Target decides what line/column should be indicated by the rule in question. 6 | type Target int 7 | 8 | const ( 9 | // TargetIf means the text refers to the "if" 10 | TargetIf Target = iota 11 | 12 | // TargetElse means the text refers to the "else" 13 | TargetElse 14 | ) 15 | 16 | func (t Target) node(ifStmt *ast.IfStmt) ast.Node { 17 | switch t { 18 | case TargetIf: 19 | return ifStmt 20 | case TargetElse: 21 | return ifStmt.Else 22 | } 23 | panic("bad target") 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/internal/typeparams/typeparams.go: -------------------------------------------------------------------------------- 1 | // Package typeparams provides utilities for working with Go ASTs with support 2 | // for type parameters when built with Go 1.18 and higher. 3 | package typeparams 4 | 5 | import ( 6 | "go/ast" 7 | ) 8 | 9 | // Enabled reports whether type parameters are enabled in the current build 10 | // environment. 11 | func Enabled() bool { 12 | return enabled 13 | } 14 | 15 | // ReceiverType returns the named type of the method receiver, sans "*" and type 16 | // parameters, or "invalid-type" if fn.Recv is ill formed. 17 | func ReceiverType(fn *ast.FuncDecl) string { 18 | e := fn.Recv.List[0].Type 19 | if s, ok := e.(*ast.StarExpr); ok { 20 | e = s.X 21 | } 22 | if enabled { 23 | e = unpackIndexExpr(e) 24 | } 25 | if id, ok := e.(*ast.Ident); ok { 26 | return id.Name 27 | } 28 | return "invalid-type" 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/internal/typeparams/typeparams_go117.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.18 2 | // +build !go1.18 3 | 4 | package typeparams 5 | 6 | import ( 7 | "go/ast" 8 | ) 9 | 10 | const enabled = false 11 | 12 | func unpackIndexExpr(e ast.Expr) ast.Expr { return e } 13 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/internal/typeparams/typeparams_go118.go: -------------------------------------------------------------------------------- 1 | //go:build go1.18 2 | // +build go1.18 3 | 4 | package typeparams 5 | 6 | import ( 7 | "go/ast" 8 | ) 9 | 10 | const enabled = true 11 | 12 | func unpackIndexExpr(e ast.Expr) ast.Expr { 13 | switch e := e.(type) { 14 | case *ast.IndexExpr: 15 | return e.X 16 | case *ast.IndexListExpr: 17 | return e.X 18 | } 19 | return e 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/lint/doc.go: -------------------------------------------------------------------------------- 1 | // Package lint implements the linting machinery. 2 | package lint 3 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/lint/formatter.go: -------------------------------------------------------------------------------- 1 | package lint 2 | 3 | // FormatterMetadata configuration of a formatter 4 | type FormatterMetadata struct { 5 | Name string 6 | Description string 7 | Sample string 8 | } 9 | 10 | // Formatter defines an interface for failure formatters 11 | type Formatter interface { 12 | Format(<-chan Failure, Config) (string, error) 13 | Name() string 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/lint/rule.go: -------------------------------------------------------------------------------- 1 | package lint 2 | 3 | import ( 4 | "go/token" 5 | ) 6 | 7 | // DisabledInterval contains a single disabled interval and the associated rule name. 8 | type DisabledInterval struct { 9 | From token.Position 10 | To token.Position 11 | RuleName string 12 | } 13 | 14 | // Rule defines an abstract rule interface 15 | type Rule interface { 16 | Name() string 17 | Apply(*File, Arguments) []Failure 18 | } 19 | 20 | // ConfigurableRule defines an abstract configurable rule interface. 21 | type ConfigurableRule interface { 22 | Configure(Arguments) error 23 | } 24 | 25 | // ToFailurePosition returns the failure position. 26 | func ToFailurePosition(start, end token.Pos, file *File) FailurePosition { 27 | return FailurePosition{ 28 | Start: file.ToPosition(start), 29 | End: file.ToPosition(end), 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/logging/logger.go: -------------------------------------------------------------------------------- 1 | // Package logging provides a logger and related methods. 2 | package logging 3 | 4 | import ( 5 | "io" 6 | "log/slog" 7 | "os" 8 | ) 9 | 10 | const logFile = "revive.log" 11 | 12 | var logger *slog.Logger 13 | 14 | // GetLogger retrieves an instance of an application logger which outputs 15 | // to a file if the debug flag is enabled 16 | func GetLogger() (*slog.Logger, error) { 17 | if logger != nil { 18 | return logger, nil 19 | } 20 | 21 | debugModeEnabled := os.Getenv("DEBUG") != "" 22 | if !debugModeEnabled { 23 | // by default, suppress all logging output 24 | return slog.New(slog.NewTextHandler(io.Discard, nil)), nil // TODO: change to slog.New(slog.DiscardHandler) when we switch to Go 1.24 25 | } 26 | 27 | fileWriter, err := os.Create(logFile) 28 | if err != nil { 29 | return nil, err 30 | } 31 | 32 | logger = slog.New(slog.NewTextHandler(io.MultiWriter(os.Stderr, fileWriter), nil)) 33 | 34 | logger.Info("Logger initialized", "logFile", logFile) 35 | 36 | return logger, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/main.go: -------------------------------------------------------------------------------- 1 | // Package main is the build entry point of revive. 2 | package main 3 | 4 | import "github.com/mgechev/revive/cli" 5 | 6 | func main() { 7 | cli.RunRevive() 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:recommended" 5 | ], 6 | "packageRules": [ 7 | { 8 | "matchManagers": ["gomod"], 9 | "matchDepTypes": ["indirect"], 10 | "enabled": true 11 | } 12 | ], 13 | "postUpdateOptions": [ 14 | "gomodTidy" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/revivelib/extra_rule.go: -------------------------------------------------------------------------------- 1 | package revivelib 2 | 3 | import "github.com/mgechev/revive/lint" 4 | 5 | // ExtraRule configures a new rule to be used with revive. 6 | type ExtraRule struct { 7 | Rule lint.Rule 8 | DefaultConfig lint.RuleConfig 9 | } 10 | 11 | // NewExtraRule returns a configured extra rule. 12 | func NewExtraRule(rule lint.Rule, defaultConfig lint.RuleConfig) ExtraRule { 13 | return ExtraRule{ 14 | Rule: rule, 15 | DefaultConfig: defaultConfig, 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/revivelib/pattern.go: -------------------------------------------------------------------------------- 1 | package revivelib 2 | 3 | // LintPattern indicates a pattern to be included/excluded when linting 4 | type LintPattern struct { 5 | isExclude bool 6 | pattern string 7 | } 8 | 9 | // IsExclude - should this pattern be included or excluded when linting 10 | func (p *LintPattern) IsExclude() bool { 11 | return p.isExclude 12 | } 13 | 14 | // GetPattern - returns the actual pattern 15 | func (p *LintPattern) GetPattern() string { 16 | return p.pattern 17 | } 18 | 19 | // Include this pattern when linting 20 | func Include(pattern string) *LintPattern { 21 | return &LintPattern{ 22 | isExclude: false, 23 | pattern: pattern, 24 | } 25 | } 26 | 27 | // Exclude this pattern when linting 28 | func Exclude(pattern string) *LintPattern { 29 | return &LintPattern{ 30 | isExclude: true, 31 | pattern: pattern, 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/rule/doc.go: -------------------------------------------------------------------------------- 1 | // Package rule implements revive's linting rules. 2 | package rule 3 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/rule/duplicated_imports.go: -------------------------------------------------------------------------------- 1 | package rule 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/mgechev/revive/lint" 7 | ) 8 | 9 | // DuplicatedImportsRule looks for packages that are imported two or more times. 10 | type DuplicatedImportsRule struct{} 11 | 12 | // Apply applies the rule to given file. 13 | func (*DuplicatedImportsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure { 14 | var failures []lint.Failure 15 | 16 | impPaths := map[string]struct{}{} 17 | for _, imp := range file.AST.Imports { 18 | path := imp.Path.Value 19 | _, ok := impPaths[path] 20 | if ok { 21 | failures = append(failures, lint.Failure{ 22 | Confidence: 1, 23 | Failure: fmt.Sprintf("Package %s already imported", path), 24 | Node: imp, 25 | Category: lint.FailureCategoryImports, 26 | }) 27 | continue 28 | } 29 | 30 | impPaths[path] = struct{}{} 31 | } 32 | 33 | return failures 34 | } 35 | 36 | // Name returns the rule name. 37 | func (*DuplicatedImportsRule) Name() string { 38 | return "duplicated-imports" 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/rule/use_any.go: -------------------------------------------------------------------------------- 1 | package rule 2 | 3 | import ( 4 | "go/ast" 5 | 6 | "github.com/mgechev/revive/lint" 7 | ) 8 | 9 | // UseAnyRule proposes to replace `interface{}` with its alias `any`. 10 | type UseAnyRule struct{} 11 | 12 | // Apply applies the rule to given file. 13 | func (*UseAnyRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failure { 14 | var failures []lint.Failure 15 | 16 | walker := lintUseAny{ 17 | onFailure: func(failure lint.Failure) { 18 | failures = append(failures, failure) 19 | }, 20 | } 21 | fileAst := file.AST 22 | ast.Walk(walker, fileAst) 23 | 24 | return failures 25 | } 26 | 27 | // Name returns the rule name. 28 | func (*UseAnyRule) Name() string { 29 | return "use-any" 30 | } 31 | 32 | type lintUseAny struct { 33 | onFailure func(lint.Failure) 34 | } 35 | 36 | func (w lintUseAny) Visit(n ast.Node) ast.Visitor { 37 | it, ok := n.(*ast.InterfaceType) 38 | if !ok { 39 | return w 40 | } 41 | 42 | if len(it.Methods.List) != 0 { 43 | return w // it is not and empty interface 44 | } 45 | 46 | w.onFailure(lint.Failure{ 47 | Node: n, 48 | Confidence: 1, 49 | Category: lint.FailureCategoryNaming, 50 | Failure: "since Go 1.18 'interface{}' can be replaced by 'any'", 51 | }) 52 | 53 | return w 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/mgechev/revive/untyped.toml: -------------------------------------------------------------------------------- 1 | [rule.blank-imports] 2 | [rule.context-as-argument] 3 | [rule.dot-imports] 4 | [rule.error-return] 5 | [rule.error-strings] 6 | [rule.error-naming] 7 | [rule.exported] 8 | [rule.if-return] 9 | [rule.increment-decrement] 10 | [rule.var-naming] 11 | [rule.package-comments] 12 | [rule.range] 13 | [rule.receiver-naming] 14 | [rule.indent-error-flow] 15 | [rule.empty-block] 16 | [rule.range-val-in-closure] 17 | [rule.waitgroup-by-value] 18 | [rule.atomic] 19 | [rule.empty-lines] 20 | [rule.line-length-limit] 21 | arguments = [200] 22 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Go template 3 | # Binaries for programs and plugins 4 | *.exe 5 | *.exe~ 6 | *.dll 7 | *.so 8 | *.dylib 9 | 10 | # Test binary, build with `go test -c` 11 | *.test 12 | 13 | # Output of the go coverage tool, specifically when used with LiteIDE 14 | *.out 15 | 16 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | arch: 3 | - ppc64le 4 | - amd64 5 | go: 6 | - 1.3 7 | - 1.4 8 | - 1.5 9 | - 1.6 10 | - 1.7 11 | - 1.8 12 | - 1.9 13 | - "1.10" 14 | - tip 15 | jobs: 16 | exclude : 17 | - arch : ppc64le 18 | go : 19 | - 1.3 20 | - arch : ppc64le 21 | go : 22 | - 1.4 23 | -------------------------------------------------------------------------------- /vendor/github.com/olekukonko/tablewriter/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2014 by Oleku Konko 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/rivo/uniseg/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Oliver Kuederle 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/spf13/afero/.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/afero/.gitignore: -------------------------------------------------------------------------------- 1 | sftpfs/file1 2 | sftpfs/test/ 3 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/.golangci.yaml: -------------------------------------------------------------------------------- 1 | linters-settings: 2 | gci: 3 | sections: 4 | - standard 5 | - default 6 | - prefix(github.com/spf13/afero) 7 | 8 | linters: 9 | disable-all: true 10 | enable: 11 | - gci 12 | - gofmt 13 | - gofumpt 14 | - staticcheck 15 | 16 | issues: 17 | exclude-dirs: 18 | - gcsfs/internal/stiface 19 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/appveyor.yml: -------------------------------------------------------------------------------- 1 | # This currently does nothing. We have moved to GitHub action, but this is kept 2 | # until spf13 has disabled this project in AppVeyor. 3 | version: '{build}' 4 | clone_folder: C:\gopath\src\github.com\spf13\afero 5 | environment: 6 | GOPATH: C:\gopath 7 | build_script: 8 | - cmd: >- 9 | go version 10 | 11 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/const_bsds.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2016 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | //go:build aix || darwin || openbsd || freebsd || netbsd || dragonfly || zos 15 | // +build aix darwin openbsd freebsd netbsd dragonfly zos 16 | 17 | package afero 18 | 19 | import ( 20 | "syscall" 21 | ) 22 | 23 | const BADFD = syscall.EBADF 24 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/const_win_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2016 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | //go:build !darwin && !openbsd && !freebsd && !dragonfly && !netbsd && !aix && !zos 14 | // +build !darwin,!openbsd,!freebsd,!dragonfly,!netbsd,!aix,!zos 15 | 16 | package afero 17 | 18 | import ( 19 | "syscall" 20 | ) 21 | 22 | const BADFD = syscall.EBADFD 23 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/internal/common/adapters.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2022 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package common 15 | 16 | import "io/fs" 17 | 18 | // FileInfoDirEntry provides an adapter from os.FileInfo to fs.DirEntry 19 | type FileInfoDirEntry struct { 20 | fs.FileInfo 21 | } 22 | 23 | var _ fs.DirEntry = FileInfoDirEntry{} 24 | 25 | func (d FileInfoDirEntry) Type() fs.FileMode { return d.FileInfo.Mode().Type() } 26 | 27 | func (d FileInfoDirEntry) Info() (fs.FileInfo, error) { return d.FileInfo, nil } 28 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/lstater.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2018 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package afero 15 | 16 | import ( 17 | "os" 18 | ) 19 | 20 | // Lstater is an optional interface in Afero. It is only implemented by the 21 | // filesystems saying so. 22 | // It will call Lstat if the filesystem iself is, or it delegates to, the os filesystem. 23 | // Else it will call Stat. 24 | // In addtion to the FileInfo, it will return a boolean telling whether Lstat was called or not. 25 | type Lstater interface { 26 | LstatIfPossible(name string) (os.FileInfo, bool, error) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/spf13/afero/mem/dir.go: -------------------------------------------------------------------------------- 1 | // Copyright © 2014 Steve Francia . 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 | // http://www.apache.org/licenses/LICENSE-2.0 7 | // 8 | // Unless required by applicable law or agreed to in writing, software 9 | // distributed under the License is distributed on an "AS IS" BASIS, 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | // See the License for the specific language governing permissions and 12 | // limitations under the License. 13 | 14 | package mem 15 | 16 | type Dir interface { 17 | Len() int 18 | Names() []string 19 | Files() []*FileData 20 | Add(*FileData) 21 | Remove(*FileData) 22 | } 23 | 24 | func RemoveFromMemDir(dir *FileData, f *FileData) { 25 | dir.memDir.Remove(f) 26 | } 27 | 28 | func AddToMemDir(dir *FileData, f *FileData) { 29 | dir.memDir.Add(f) 30 | } 31 | 32 | func InitializeDir(d *FileData) { 33 | if d.memDir == nil { 34 | d.dir = true 35 | d.memDir = &DirMap{} 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /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_linux_riscv64.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 riscv64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /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.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 ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //go:linkname runtime_getAuxv runtime.getAuxv 15 | func runtime_getAuxv() []uintptr 16 | 17 | // Auxv returns the ELF auxiliary vector as a sequence of key/value pairs. 18 | // The returned slice is always a fresh copy, owned by the caller. 19 | // It returns an error on non-ELF platforms, or if the auxiliary vector cannot be accessed, 20 | // which happens in some locked-down environments and build modes. 21 | func Auxv() ([][2]uintptr, error) { 22 | vec := runtime_getAuxv() 23 | vecLen := len(vec) 24 | 25 | if vecLen == 0 { 26 | return nil, syscall.ENOENT 27 | } 28 | 29 | if vecLen%2 != 0 { 30 | return nil, syscall.EINVAL 31 | } 32 | 33 | result := make([]uintptr, vecLen) 34 | copy(result, vec) 35 | return unsafe.Slice((*[2]uintptr)(unsafe.Pointer(&result[0])), vecLen/2), nil 36 | } 37 | -------------------------------------------------------------------------------- /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_dragonfly.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 Dragonfly'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 DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD 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_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.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 dragonfly || freebsd || linux || netbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /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_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 && openbsd 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 = int16(mode) 20 | k.Flags = uint16(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 = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_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 && openbsd 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 SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(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 = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.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 arm && openbsd 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 = int16(mode) 20 | k.Flags = uint16(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 = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_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 && openbsd 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 SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(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 = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_libc.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 openbsd 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 17 | 18 | //go:linkname syscall_syscall syscall.syscall 19 | //go:linkname syscall_syscall6 syscall.syscall6 20 | //go:linkname syscall_syscall10 syscall.syscall10 21 | //go:linkname syscall_rawSyscall syscall.rawSyscall 22 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 23 | 24 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 25 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 26 | } 27 | -------------------------------------------------------------------------------- /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_openbsd_ppc64.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 ppc64 && openbsd 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 SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(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 = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_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 && openbsd 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 SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(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 = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /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/sys/windows/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 windows 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.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 windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.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 generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/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 windows && race 6 | 7 | package windows 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/windows/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 windows && !race 6 | 7 | package windows 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/windows/str.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 windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_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 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 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 windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/analysis/checker/iter_go122.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 !go1.23 6 | 7 | package checker 8 | 9 | // This type is a placeholder for go1.23's iter.Seq[*Action]. 10 | type actionSeq func(yield func(*Action) bool) 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/analysis/checker/iter_go123.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 go1.23 6 | 7 | package checker 8 | 9 | import "iter" 10 | 11 | type actionSeq = iter.Seq[*Action] 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/analysis/internal/analysisflags/url.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 analysisflags 6 | 7 | import ( 8 | "fmt" 9 | "net/url" 10 | 11 | "golang.org/x/tools/go/analysis" 12 | ) 13 | 14 | // ResolveURL resolves the URL field for a Diagnostic from an Analyzer 15 | // and returns the URL. See Diagnostic.URL for details. 16 | func ResolveURL(a *analysis.Analyzer, d analysis.Diagnostic) (string, error) { 17 | if d.URL == "" && d.Category == "" && a.URL == "" { 18 | return "", nil // do nothing 19 | } 20 | raw := d.URL 21 | if d.URL == "" && d.Category != "" { 22 | raw = "#" + d.Category 23 | } 24 | u, err := url.Parse(raw) 25 | if err != nil { 26 | return "", fmt.Errorf("invalid Diagnostic.URL %q: %s", raw, err) 27 | } 28 | base, err := url.Parse(a.URL) 29 | if err != nil { 30 | return "", fmt.Errorf("invalid Analyzer.URL %q: %s", a.URL, err) 31 | } 32 | return base.ResolveReference(u).String(), nil 33 | } 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/analysis/internal/internal.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 internal 6 | 7 | import "golang.org/x/tools/go/analysis" 8 | 9 | // This function is set by the checker package to provide 10 | // backdoor access to the private Pass field 11 | // of the checker.Action type, for use by analysistest. 12 | var Pass func(any) *analysis.Pass 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/ast/astutil/util.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 | package astutil 6 | 7 | import "go/ast" 8 | 9 | // Unparen returns e with any enclosing parentheses stripped. 10 | // Deprecated: use [ast.Unparen]. 11 | // 12 | //go:fix inline 13 | func Unparen(e ast.Expr) ast.Expr { return ast.Unparen(e) } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/go/types/typeutil/imports.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 typeutil 6 | 7 | import "go/types" 8 | 9 | // Dependencies returns all dependencies of the specified packages. 10 | // 11 | // Dependent packages appear in topological order: if package P imports 12 | // package Q, Q appears earlier than P in the result. 13 | // The algorithm follows import statements in the order they 14 | // appear in the source code, so the result is a total order. 15 | func Dependencies(pkgs ...*types.Package) []*types.Package { 16 | var result []*types.Package 17 | seen := make(map[*types.Package]bool) 18 | var visit func(pkgs []*types.Package) 19 | visit = func(pkgs []*types.Package) { 20 | for _, p := range pkgs { 21 | if !seen[p] { 22 | seen[p] = true 23 | visit(p.Imports()) 24 | result = append(result, p) 25 | } 26 | } 27 | } 28 | visit(pkgs) 29 | return result 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/diff/lcs/git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2022 The Go Authors. All rights reserved. 4 | # Use of this source code is governed by a BSD-style 5 | # license that can be found in the LICENSE file. 6 | # 7 | # Creates a zip file containing all numbered versions 8 | # of the commit history of a large source file, for use 9 | # as input data for the tests of the diff algorithm. 10 | # 11 | # Run script from root of the x/tools repo. 12 | 13 | set -eu 14 | 15 | # WARNING: This script will install the latest version of $file 16 | # The largest real source file in the x/tools repo. 17 | # file=internal/golang/completion/completion.go 18 | # file=internal/golang/diagnostics.go 19 | file=internal/protocol/tsprotocol.go 20 | 21 | tmp=$(mktemp -d) 22 | git log $file | 23 | awk '/^commit / {print $2}' | 24 | nl -ba -nrz | 25 | while read n hash; do 26 | git checkout --quiet $hash $file 27 | cp -f $file $tmp/$n 28 | done 29 | (cd $tmp && zip -q - *) > testdata.zip 30 | rm -fr $tmp 31 | git restore --staged $file 32 | git restore $file 33 | echo "Created testdata.zip" 34 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/doc.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 event provides a set of packages that cover the main 6 | // concepts of telemetry in an implementation agnostic way. 7 | package event 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/keys/standard.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 keys 6 | 7 | var ( 8 | // Msg is a key used to add message strings to label lists. 9 | Msg = NewString("message", "a readable message") 10 | // Label is a key used to indicate an event adds labels to the context. 11 | Label = NewTag("label", "a label context marker") 12 | // Start is used for things like traces that have a name. 13 | Start = NewString("start", "span start") 14 | // Metric is a key used to indicate an event records metrics. 15 | End = NewTag("end", "a span end marker") 16 | // Metric is a key used to indicate an event records metrics. 17 | Detach = NewTag("detach", "a span detach marker") 18 | // Err is a key used to add error values to label lists. 19 | Err = NewError("error", "an error that occurred") 20 | // Metric is a key used to indicate an event records metrics. 21 | Metric = NewTag("metric", "a metric event marker") 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/event/keys/util.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 keys 6 | 7 | import ( 8 | "sort" 9 | "strings" 10 | ) 11 | 12 | // Join returns a canonical join of the keys in S: 13 | // a sorted comma-separated string list. 14 | func Join[S ~[]T, T ~string](s S) string { 15 | strs := make([]string, 0, len(s)) 16 | for _, v := range s { 17 | strs = append(strs, string(v)) 18 | } 19 | sort.Strings(strs) 20 | return strings.Join(strs, ",") 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gcimporter/support.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 | package gcimporter 6 | 7 | import ( 8 | "bufio" 9 | "io" 10 | "strconv" 11 | "strings" 12 | ) 13 | 14 | // Copy of $GOROOT/src/cmd/internal/archive.ReadHeader. 15 | func readArchiveHeader(b *bufio.Reader, name string) int { 16 | // architecture-independent object file output 17 | const HeaderSize = 60 18 | 19 | var buf [HeaderSize]byte 20 | if _, err := io.ReadFull(b, buf[:]); err != nil { 21 | return -1 22 | } 23 | aname := strings.Trim(string(buf[0:16]), " ") 24 | if !strings.HasPrefix(aname, name) { 25 | return -1 26 | } 27 | asize := strings.Trim(string(buf[48:58]), " ") 28 | i, _ := strconv.Atoi(asize) 29 | return i 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gocommand/invoke_notunix.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 !unix 6 | 7 | package gocommand 8 | 9 | import "os" 10 | 11 | // sigStuckProcess is the signal to send to kill a hanging subprocess. 12 | // On Unix we send SIGQUIT, but on non-Unix we only have os.Kill. 13 | var sigStuckProcess = os.Kill 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/gocommand/invoke_unix.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 unix 6 | 7 | package gocommand 8 | 9 | import "syscall" 10 | 11 | // Sigstuckprocess is the signal to send to kill a hanging subprocess. 12 | // Send SIGQUIT to get a stack trace. 13 | var sigStuckProcess = syscall.SIGQUIT 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/packagesinternal/packages.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 packagesinternal exposes internal-only fields from go/packages. 6 | package packagesinternal 7 | 8 | var GetDepsErrors = func(p any) []*PackageError { return nil } 9 | 10 | type PackageError struct { 11 | ImportStack []string // shortest path from package named on command line to this one 12 | Pos string // position of error (if present, file:line:col) 13 | Err string // the error itself 14 | } 15 | 16 | var TypecheckCgo int 17 | var DepsErrors int // must be set as a LoadMode to call GetDepsErrors 18 | 19 | var SetModFlag = func(config any, value string) {} 20 | var SetModFile = func(config any, value string) {} 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/flags.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 | package pkgbits 6 | 7 | const ( 8 | flagSyncMarkers = 1 << iota // file format contains sync markers 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/reloc.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 | package pkgbits 6 | 7 | // A RelocKind indicates a particular section within a unified IR export. 8 | type RelocKind int32 9 | 10 | // An Index represents a bitstream element index within a particular 11 | // section. 12 | type Index int32 13 | 14 | // A relocEnt (relocation entry) is an entry in an element's local 15 | // reference table. 16 | // 17 | // TODO(mdempsky): Rename this too. 18 | type RelocEnt struct { 19 | Kind RelocKind 20 | Idx Index 21 | } 22 | 23 | // Reserved indices within the meta relocation section. 24 | const ( 25 | PublicRootIdx Index = 0 26 | PrivateRootIdx Index = 1 27 | ) 28 | 29 | const ( 30 | RelocString RelocKind = iota 31 | RelocMeta 32 | RelocPosBase 33 | RelocPkg 34 | RelocName 35 | RelocType 36 | RelocObj 37 | RelocObjExt 38 | RelocObjDict 39 | RelocBody 40 | 41 | numRelocs = iota 42 | ) 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/tools/internal/pkgbits/support.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 | package pkgbits 6 | 7 | import "fmt" 8 | 9 | func assert(b bool) { 10 | if !b { 11 | panic("assertion failed") 12 | } 13 | } 14 | 15 | func panicf(format string, args ...any) { 16 | panic(fmt.Errorf(format, args...)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Dominik Honnef 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/analysis/facts/directives/directives.go: -------------------------------------------------------------------------------- 1 | package directives 2 | 3 | import ( 4 | "reflect" 5 | 6 | "golang.org/x/tools/go/analysis" 7 | "honnef.co/go/tools/analysis/lint" 8 | ) 9 | 10 | func directives(pass *analysis.Pass) (interface{}, error) { 11 | return lint.ParseDirectives(pass.Files, pass.Fset), nil 12 | } 13 | 14 | var Analyzer = &analysis.Analyzer{ 15 | Name: "directives", 16 | Doc: "extracts linter directives", 17 | Run: directives, 18 | RunDespiteErrors: true, 19 | ResultType: reflect.TypeOf([]lint.Directive{}), 20 | } 21 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/analysis/facts/tokenfile/token.go: -------------------------------------------------------------------------------- 1 | package tokenfile 2 | 3 | import ( 4 | "go/ast" 5 | "go/token" 6 | "reflect" 7 | 8 | "golang.org/x/tools/go/analysis" 9 | ) 10 | 11 | var Analyzer = &analysis.Analyzer{ 12 | Name: "tokenfileanalyzer", 13 | Doc: "creates a mapping of *token.File to *ast.File", 14 | Run: func(pass *analysis.Pass) (interface{}, error) { 15 | m := map[*token.File]*ast.File{} 16 | for _, af := range pass.Files { 17 | tf := pass.Fset.File(af.Pos()) 18 | m[tf] = af 19 | } 20 | return m, nil 21 | }, 22 | RunDespiteErrors: true, 23 | ResultType: reflect.TypeOf(map[*token.File]*ast.File{}), 24 | } 25 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/cmd/staticcheck/README.md: -------------------------------------------------------------------------------- 1 | # staticcheck 2 | 3 | _staticcheck_ offers extensive analysis of Go code, covering a myriad 4 | of categories. It will detect bugs, suggest code simplifications, 5 | point out dead code, and more. 6 | 7 | ## Installation 8 | 9 | See [the main README](https://github.com/dominikh/go-tools#installation) for installation instructions. 10 | 11 | ## Documentation 12 | 13 | Detailed documentation can be found on 14 | [staticcheck.dev](https://staticcheck.dev/docs/). 15 | 16 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/cmd/staticcheck/staticcheck.go: -------------------------------------------------------------------------------- 1 | // staticcheck analyses Go code and makes it better. 2 | package main 3 | 4 | import ( 5 | "log" 6 | "os" 7 | 8 | "honnef.co/go/tools/lintcmd" 9 | "honnef.co/go/tools/lintcmd/version" 10 | "honnef.co/go/tools/quickfix" 11 | "honnef.co/go/tools/simple" 12 | "honnef.co/go/tools/staticcheck" 13 | "honnef.co/go/tools/stylecheck" 14 | "honnef.co/go/tools/unused" 15 | ) 16 | 17 | func main() { 18 | cmd := lintcmd.NewCommand("staticcheck") 19 | cmd.SetVersion(version.Version, version.MachineVersion) 20 | 21 | fs := cmd.FlagSet() 22 | debug := fs.String("debug.unused-graph", "", "Write unused's object graph to `file`") 23 | qf := fs.Bool("debug.run-quickfix-analyzers", false, "Run quickfix analyzers") 24 | 25 | cmd.ParseFlags(os.Args[1:]) 26 | 27 | cmd.AddAnalyzers(simple.Analyzers...) 28 | cmd.AddAnalyzers(staticcheck.Analyzers...) 29 | cmd.AddAnalyzers(stylecheck.Analyzers...) 30 | cmd.AddAnalyzers(unused.Analyzer) 31 | 32 | if *qf { 33 | cmd.AddAnalyzers(quickfix.Analyzers...) 34 | } 35 | 36 | if *debug != "" { 37 | f, err := os.OpenFile(*debug, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666) 38 | if err != nil { 39 | log.Fatal(err) 40 | } 41 | unused.Debug = f 42 | } 43 | 44 | cmd.Run() 45 | } 46 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/config/example.conf: -------------------------------------------------------------------------------- 1 | checks = ["all", "-SA9003", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022", "-ST1023"] 2 | initialisms = ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", 3 | "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", 4 | "IP", "JSON", "QPS", "RAM", "RPC", "SLA", 5 | "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", 6 | "UDP", "UI", "GID", "UID", "UUID", "URI", 7 | "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", 8 | "XSS", "SIP", "RTP", "AMQP", "DB", "TS"] 9 | dot_import_whitelist = [ 10 | "github.com/mmcloughlin/avo/build", 11 | "github.com/mmcloughlin/avo/operand", 12 | "github.com/mmcloughlin/avo/reg", 13 | ] 14 | http_status_code_whitelist = ["200", "400", "404", "500"] 15 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/go/ast/astutil/upstream.go: -------------------------------------------------------------------------------- 1 | package astutil 2 | 3 | import ( 4 | "go/ast" 5 | "go/token" 6 | _ "unsafe" 7 | 8 | "golang.org/x/tools/go/ast/astutil" 9 | ) 10 | 11 | type Cursor = astutil.Cursor 12 | type ApplyFunc = astutil.ApplyFunc 13 | 14 | func Apply(root ast.Node, pre, post ApplyFunc) (result ast.Node) { 15 | return astutil.Apply(root, pre, post) 16 | } 17 | 18 | func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Node, exact bool) { 19 | return astutil.PathEnclosingInterval(root, start, end) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/go/buildid/UPSTREAM: -------------------------------------------------------------------------------- 1 | This package extracts buildid.go and note.go from cmd/internal/buildid/. 2 | 3 | We have modified it to remove support for AIX big archive files, to cut down on our dependencies. 4 | 5 | The last upstream commit we've looked at was: e8ee1dc4f9e2632ba1018610d1a1187743ae397f 6 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/go/ir/UPSTREAM: -------------------------------------------------------------------------------- 1 | This package started as a copy of golang.org/x/tools/go/ssa, imported from an unknown commit in 2016. 2 | It has since been heavily modified to match our own needs in an IR. 3 | The changes are too many to list here, and it is best to consider this package independent of go/ssa. 4 | 5 | Upstream changes still get applied when they address bugs in portions of code we have inherited. 6 | 7 | The last upstream commit we've looked at was: 8 | ac2946029ad3806349fa00546449da9f59320e89 9 | 10 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/go/ir/irutil/loops.go: -------------------------------------------------------------------------------- 1 | package irutil 2 | 3 | import "honnef.co/go/tools/go/ir" 4 | 5 | type Loop struct{ *ir.BlockSet } 6 | 7 | func FindLoops(fn *ir.Function) []Loop { 8 | if fn.Blocks == nil { 9 | return nil 10 | } 11 | tree := fn.DomPreorder() 12 | var sets []Loop 13 | for _, h := range tree { 14 | for _, n := range h.Preds { 15 | if !h.Dominates(n) { 16 | continue 17 | } 18 | // n is a back-edge to h 19 | // h is the loop header 20 | if n == h { 21 | set := Loop{ir.NewBlockSet(len(fn.Blocks))} 22 | set.Add(n) 23 | sets = append(sets, set) 24 | continue 25 | } 26 | set := Loop{ir.NewBlockSet(len(fn.Blocks))} 27 | set.Add(h) 28 | set.Add(n) 29 | for _, b := range allPredsBut(n, h, nil) { 30 | set.Add(b) 31 | } 32 | sets = append(sets, set) 33 | } 34 | } 35 | return sets 36 | } 37 | 38 | func allPredsBut(b, but *ir.BasicBlock, list []*ir.BasicBlock) []*ir.BasicBlock { 39 | outer: 40 | for _, pred := range b.Preds { 41 | if pred == but { 42 | continue 43 | } 44 | for _, p := range list { 45 | // TODO improve big-o complexity of this function 46 | if pred == p { 47 | continue outer 48 | } 49 | } 50 | list = append(list, pred) 51 | list = allPredsBut(pred, but, list) 52 | } 53 | return list 54 | } 55 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/go/ir/irutil/stub.go: -------------------------------------------------------------------------------- 1 | package irutil 2 | 3 | import ( 4 | "honnef.co/go/tools/go/ir" 5 | ) 6 | 7 | // IsStub reports whether a function is a stub. A function is 8 | // considered a stub if it has no instructions or if all it does is 9 | // return a constant value. 10 | func IsStub(fn *ir.Function) bool { 11 | for _, b := range fn.Blocks { 12 | for _, instr := range b.Instrs { 13 | switch instr.(type) { 14 | case *ir.Const: 15 | // const naturally has no side-effects 16 | case *ir.Panic: 17 | // panic is a stub if it only uses constants 18 | case *ir.Return: 19 | // return is a stub if it only uses constants 20 | case *ir.DebugRef: 21 | case *ir.Jump: 22 | // if there are no disallowed instructions, then we're 23 | // only jumping to the exit block (or possibly 24 | // somewhere else that's stubby?) 25 | default: 26 | // all other instructions are assumed to do actual work 27 | return false 28 | } 29 | } 30 | } 31 | return true 32 | } 33 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/go/ir/write.go: -------------------------------------------------------------------------------- 1 | package ir 2 | 3 | func NewJump(parent *BasicBlock) *Jump { 4 | return &Jump{anInstruction{block: parent}} 5 | } 6 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/go/types/typeutil/ext.go: -------------------------------------------------------------------------------- 1 | package typeutil 2 | 3 | import ( 4 | "fmt" 5 | "go/types" 6 | ) 7 | 8 | type Iterator struct { 9 | elem types.Type 10 | } 11 | 12 | func (t *Iterator) Underlying() types.Type { return t } 13 | func (t *Iterator) String() string { return fmt.Sprintf("iterator(%s)", t.elem) } 14 | func (t *Iterator) Elem() types.Type { return t.elem } 15 | 16 | func NewIterator(elem types.Type) *Iterator { 17 | return &Iterator{elem: elem} 18 | } 19 | 20 | type DeferStack struct{} 21 | 22 | func (t *DeferStack) Underlying() types.Type { return t } 23 | func (t *DeferStack) String() string { return "deferStack" } 24 | 25 | func NewDeferStack() *DeferStack { 26 | return &DeferStack{} 27 | } 28 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/internal/renameio/UPSTREAM: -------------------------------------------------------------------------------- 1 | This package is a copy of cmd/go/internal/renameio. 2 | The upstream package no longer exists, as the Go project replaced all of its uses with the lockedfile package. 3 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/internal/robustio/UPSTREAM: -------------------------------------------------------------------------------- 1 | This package is a copy of cmd/go/internal/robustio. 2 | It is mostly in sync with upstream according to the last commit we've looked at, 3 | with the exception of still using I/O functions that work with older Go versions. 4 | 5 | The last upstream commit we've looked at was: 6 | dc04f3ba1f25313bc9c97e728620206c235db9ee 7 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/internal/robustio/robustio_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 robustio 6 | 7 | import ( 8 | "errors" 9 | "syscall" 10 | ) 11 | 12 | const errFileNotFound = syscall.ENOENT 13 | 14 | // isEphemeralError returns true if err may be resolved by waiting. 15 | func isEphemeralError(err error) bool { 16 | var errno syscall.Errno 17 | if errors.As(err, &errno) { 18 | return errno == errFileNotFound 19 | } 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/internal/robustio/robustio_other.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 !windows && !darwin 6 | 7 | package robustio 8 | 9 | import ( 10 | "os" 11 | ) 12 | 13 | func rename(oldpath, newpath string) error { 14 | return os.Rename(oldpath, newpath) 15 | } 16 | 17 | func readFile(filename string) ([]byte, error) { 18 | return os.ReadFile(filename) 19 | } 20 | 21 | func removeAll(path string) error { 22 | return os.RemoveAll(path) 23 | } 24 | 25 | func isEphemeralError(err error) bool { 26 | return false 27 | } 28 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/internal/robustio/robustio_windows.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 robustio 6 | 7 | import ( 8 | "errors" 9 | "syscall" 10 | ) 11 | 12 | const ERROR_SHARING_VIOLATION = 32 13 | const errFileNotFound = syscall.ERROR_FILE_NOT_FOUND 14 | 15 | // isEphemeralError returns true if err may be resolved by waiting. 16 | func isEphemeralError(err error) bool { 17 | var errno syscall.Errno 18 | if errors.As(err, &errno) { 19 | switch errno { 20 | case syscall.ERROR_ACCESS_DENIED, 21 | syscall.ERROR_FILE_NOT_FOUND, 22 | ERROR_SHARING_VIOLATION: 23 | return true 24 | } 25 | } 26 | return false 27 | } 28 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/internal/sync/sync.go: -------------------------------------------------------------------------------- 1 | package sync 2 | 3 | type Semaphore struct { 4 | ch chan struct{} 5 | } 6 | 7 | func NewSemaphore(size int) Semaphore { 8 | return Semaphore{ 9 | ch: make(chan struct{}, size), 10 | } 11 | } 12 | 13 | func (sem Semaphore) Acquire() { 14 | sem.ch <- struct{}{} 15 | } 16 | 17 | func (sem Semaphore) AcquireMaybe() bool { 18 | select { 19 | case sem.ch <- struct{}{}: 20 | return true 21 | default: 22 | return false 23 | } 24 | } 25 | 26 | func (sem Semaphore) Release() { 27 | <-sem.ch 28 | } 29 | 30 | func (sem Semaphore) Len() int { 31 | return len(sem.ch) 32 | } 33 | 34 | func (sem Semaphore) Cap() int { 35 | return cap(sem.ch) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/knowledge/doc.go: -------------------------------------------------------------------------------- 1 | // Package knowledge contains manually collected information about Go APIs. 2 | package knowledge 3 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/knowledge/targets.go: -------------------------------------------------------------------------------- 1 | package knowledge 2 | 3 | var KnownGOOS = map[string]struct{}{ 4 | "aix": {}, 5 | "android": {}, 6 | "darwin": {}, 7 | "dragonfly": {}, 8 | "freebsd": {}, 9 | "hurd": {}, 10 | "illumos": {}, 11 | "ios": {}, 12 | "js": {}, 13 | "linux": {}, 14 | "netbsd": {}, 15 | "openbsd": {}, 16 | "plan9": {}, 17 | "solaris": {}, 18 | "wasip1": {}, 19 | "windows": {}, 20 | } 21 | 22 | var KnownGOARCH = map[string]struct{}{ 23 | "386": {}, 24 | "amd64": {}, 25 | "arm": {}, 26 | "arm64": {}, 27 | "loong64": {}, 28 | "mips": {}, 29 | "mipsle": {}, 30 | "mips64": {}, 31 | "mips64le": {}, 32 | "ppc64": {}, 33 | "ppc64le": {}, 34 | "riscv64": {}, 35 | "s390x": {}, 36 | "sparc64": {}, 37 | "wasm": {}, 38 | } 39 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/lintcmd/cache/UPSTREAM: -------------------------------------------------------------------------------- 1 | This package is a copy of cmd/go/internal/cache. 2 | 3 | Differences from upstream: 4 | - we continue to use renameio instead of lockedfile for writing trim.txt 5 | - we still use I/O helpers that work with earlier versions of Go. 6 | - we use a cache directory specific to Staticcheck 7 | - we use a Staticcheck-specific salt 8 | 9 | The last upstream commit we've looked at was: 10 | 06ac303f6a14b133254f757e54599c48e3c2a4ad 11 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/lintcmd/stats.go: -------------------------------------------------------------------------------- 1 | //go:build !aix && !android && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris 2 | // +build !aix,!android,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris 3 | 4 | package lintcmd 5 | 6 | import "os" 7 | 8 | var infoSignals = []os.Signal{} 9 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/lintcmd/stats_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build darwin || dragonfly || freebsd || netbsd || openbsd 2 | // +build darwin dragonfly freebsd netbsd openbsd 3 | 4 | package lintcmd 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | var infoSignals = []os.Signal{syscall.SIGINFO} 12 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/lintcmd/stats_posix.go: -------------------------------------------------------------------------------- 1 | //go:build aix || android || linux || solaris 2 | // +build aix android linux solaris 3 | 4 | package lintcmd 5 | 6 | import ( 7 | "os" 8 | "syscall" 9 | ) 10 | 11 | var infoSignals = []os.Signal{syscall.SIGUSR1} 12 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/lintcmd/version/buildinfo.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "fmt" 5 | "runtime/debug" 6 | ) 7 | 8 | func printBuildInfo() { 9 | if info, ok := debug.ReadBuildInfo(); ok { 10 | fmt.Println("Main module:") 11 | printModule(&info.Main) 12 | fmt.Println("Dependencies:") 13 | for _, dep := range info.Deps { 14 | printModule(dep) 15 | } 16 | } else { 17 | fmt.Println("Built without Go modules") 18 | } 19 | } 20 | 21 | func buildInfoVersion() (string, bool) { 22 | info, ok := debug.ReadBuildInfo() 23 | if !ok { 24 | return "", false 25 | } 26 | if info.Main.Version == "(devel)" { 27 | return "", false 28 | } 29 | return info.Main.Version, true 30 | } 31 | 32 | func printModule(m *debug.Module) { 33 | fmt.Printf("\t%s", m.Path) 34 | if m.Version != "(devel)" { 35 | fmt.Printf("@%s", m.Version) 36 | } 37 | if m.Sum != "" { 38 | fmt.Printf(" (sum: %s)", m.Sum) 39 | } 40 | if m.Replace != nil { 41 | fmt.Printf(" (replace: %s)", m.Replace.Path) 42 | } 43 | fmt.Println() 44 | } 45 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/lintcmd/version/version.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "path/filepath" 7 | "runtime" 8 | ) 9 | 10 | const Version = "2025.1.1" 11 | const MachineVersion = "0.6.1" 12 | 13 | // version returns a version descriptor and reports whether the 14 | // version is a known release. 15 | func version(human, machine string) (human_, machine_ string, known bool) { 16 | if human != "devel" { 17 | return human, machine, true 18 | } 19 | v, ok := buildInfoVersion() 20 | if ok { 21 | return v, "", false 22 | } 23 | return "devel", "", false 24 | } 25 | 26 | func Print(human, machine string) { 27 | human, machine, release := version(human, machine) 28 | 29 | if release { 30 | fmt.Printf("%s %s (%s)\n", filepath.Base(os.Args[0]), human, machine) 31 | } else if human == "devel" { 32 | fmt.Printf("%s (no version)\n", filepath.Base(os.Args[0])) 33 | } else { 34 | fmt.Printf("%s (devel, %s)\n", filepath.Base(os.Args[0]), human) 35 | } 36 | } 37 | 38 | func Verbose(human, machine string) { 39 | Print(human, machine) 40 | fmt.Println() 41 | fmt.Println("Compiled with Go version:", runtime.Version()) 42 | printBuildInfo() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/printf/fuzz.go: -------------------------------------------------------------------------------- 1 | //go:build gofuzz 2 | // +build gofuzz 3 | 4 | package printf 5 | 6 | func Fuzz(data []byte) int { 7 | _, err := Parse(string(data)) 8 | if err == nil { 9 | return 1 10 | } 11 | return 0 12 | } 13 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/quickfix/analysis.go: -------------------------------------------------------------------------------- 1 | // Code generated by generate.go. DO NOT EDIT. 2 | 3 | package quickfix 4 | 5 | import ( 6 | "honnef.co/go/tools/analysis/lint" 7 | "honnef.co/go/tools/quickfix/qf1001" 8 | "honnef.co/go/tools/quickfix/qf1002" 9 | "honnef.co/go/tools/quickfix/qf1003" 10 | "honnef.co/go/tools/quickfix/qf1004" 11 | "honnef.co/go/tools/quickfix/qf1005" 12 | "honnef.co/go/tools/quickfix/qf1006" 13 | "honnef.co/go/tools/quickfix/qf1007" 14 | "honnef.co/go/tools/quickfix/qf1008" 15 | "honnef.co/go/tools/quickfix/qf1009" 16 | "honnef.co/go/tools/quickfix/qf1010" 17 | "honnef.co/go/tools/quickfix/qf1011" 18 | "honnef.co/go/tools/quickfix/qf1012" 19 | ) 20 | 21 | var Analyzers = []*lint.Analyzer{ 22 | qf1001.SCAnalyzer, 23 | qf1002.SCAnalyzer, 24 | qf1003.SCAnalyzer, 25 | qf1004.SCAnalyzer, 26 | qf1005.SCAnalyzer, 27 | qf1006.SCAnalyzer, 28 | qf1007.SCAnalyzer, 29 | qf1008.SCAnalyzer, 30 | qf1009.SCAnalyzer, 31 | qf1010.SCAnalyzer, 32 | qf1011.SCAnalyzer, 33 | qf1012.SCAnalyzer, 34 | } 35 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/quickfix/doc.go: -------------------------------------------------------------------------------- 1 | //go:generate go run ../generate.go 2 | 3 | // Package quickfix contains analyzes that implement code refactorings. 4 | // None of these analyzers produce diagnostics that have to be followed. 5 | // Most of the time, they only provide alternative ways of doing things, 6 | // requiring users to make informed decisions. 7 | // 8 | // None of these analyzes should fail a build, and they are likely useless in CI as a whole. 9 | package quickfix 10 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/quickfix/qf1011/qf1011.go: -------------------------------------------------------------------------------- 1 | package qf1011 2 | 3 | import ( 4 | "honnef.co/go/tools/analysis/lint" 5 | "honnef.co/go/tools/internal/sharedcheck" 6 | ) 7 | 8 | func init() { 9 | SCAnalyzer.Analyzer.Name = "QF1011" 10 | } 11 | 12 | var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ 13 | Analyzer: sharedcheck.RedundantTypeInDeclarationChecker("could", true), 14 | Doc: &lint.RawDocumentation{ 15 | Title: "Omit redundant type from variable declaration", 16 | Since: "2021.1", 17 | Severity: lint.SeverityHint, 18 | }, 19 | }) 20 | 21 | var Analyzer = SCAnalyzer.Analyzer 22 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/simple/doc.go: -------------------------------------------------------------------------------- 1 | //go:generate go run ../generate.go 2 | 3 | // Package simple contains analyzes that simplify code. 4 | // All suggestions made by these analyzes are intended to result in objectively simpler code, 5 | // and following their advice is recommended. 6 | package simple 7 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/simple/s1029/s1029.go: -------------------------------------------------------------------------------- 1 | package s1029 2 | 3 | import ( 4 | "honnef.co/go/tools/analysis/lint" 5 | "honnef.co/go/tools/internal/passes/buildir" 6 | "honnef.co/go/tools/internal/sharedcheck" 7 | 8 | "golang.org/x/tools/go/analysis" 9 | ) 10 | 11 | var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ 12 | Analyzer: &analysis.Analyzer{ 13 | Name: "S1029", 14 | Run: sharedcheck.CheckRangeStringRunes, 15 | Requires: []*analysis.Analyzer{buildir.Analyzer}, 16 | }, 17 | Doc: &lint.RawDocumentation{ 18 | Title: `Range over the string directly`, 19 | Text: `Ranging over a string will yield byte offsets and runes. If the offset 20 | isn't used, this is functionally equivalent to converting the string 21 | to a slice of runes and ranging over that. Ranging directly over the 22 | string will be more performant, however, as it avoids allocating a new 23 | slice, the size of which depends on the length of the string.`, 24 | Before: `for _, r := range []rune(s) {}`, 25 | After: `for _, r := range s {}`, 26 | Since: "2017.1", 27 | MergeIf: lint.MergeIfAny, 28 | }, 29 | }) 30 | 31 | var Analyzer = SCAnalyzer.Analyzer 32 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/staticcheck/doc.go: -------------------------------------------------------------------------------- 1 | //go:generate go run ../generate.go 2 | 3 | // Package staticcheck contains analyzes that find bugs and performance issues. 4 | // Barring the rare false positive, any code flagged by these analyzes needs to be fixed. 5 | package staticcheck 6 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/staticcheck/fakexml/xml.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 | package fakexml 6 | 7 | // References: 8 | // Annotated XML spec: https://www.xml.com/axml/testaxml.htm 9 | // XML name spaces: https://www.w3.org/TR/REC-xml-names/ 10 | 11 | // TODO(rsc): 12 | // Test error handling. 13 | 14 | // A Name represents an XML name (Local) annotated 15 | // with a name space identifier (Space). 16 | // In tokens returned by Decoder.Token, the Space identifier 17 | // is given as a canonical URL, not the short prefix used 18 | // in the document being parsed. 19 | type Name struct { 20 | Space, Local string 21 | } 22 | 23 | // An Attr represents an attribute in an XML element (Name=Value). 24 | type Attr struct { 25 | Name Name 26 | Value string 27 | } 28 | 29 | // A StartElement represents an XML start element. 30 | type StartElement struct { 31 | Name Name 32 | Attr []Attr 33 | } 34 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/staticcheck/sa1000/sa1000.go: -------------------------------------------------------------------------------- 1 | package sa1000 2 | 3 | import ( 4 | "go/constant" 5 | "regexp" 6 | 7 | "honnef.co/go/tools/analysis/callcheck" 8 | "honnef.co/go/tools/analysis/lint" 9 | "honnef.co/go/tools/internal/passes/buildir" 10 | 11 | "golang.org/x/tools/go/analysis" 12 | ) 13 | 14 | var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ 15 | Analyzer: &analysis.Analyzer{ 16 | Name: "SA1000", 17 | Requires: []*analysis.Analyzer{buildir.Analyzer}, 18 | Run: callcheck.Analyzer(rules), 19 | }, 20 | Doc: &lint.RawDocumentation{ 21 | Title: `Invalid regular expression`, 22 | Since: "2017.1", 23 | Severity: lint.SeverityError, 24 | MergeIf: lint.MergeIfAny, 25 | }, 26 | }) 27 | 28 | var Analyzer = SCAnalyzer.Analyzer 29 | 30 | var rules = map[string]callcheck.Check{ 31 | "regexp.MustCompile": check, 32 | "regexp.Compile": check, 33 | "regexp.Match": check, 34 | "regexp.MatchReader": check, 35 | "regexp.MatchString": check, 36 | } 37 | 38 | func check(call *callcheck.Call) { 39 | arg := call.Args[0] 40 | if c := callcheck.ExtractConstExpectKind(arg.Value, constant.String); c != nil { 41 | s := constant.StringVal(c.Value) 42 | if _, err := regexp.Compile(s); err != nil { 43 | arg.Invalid(err.Error()) 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/staticcheck/sa1002/sa1002.go: -------------------------------------------------------------------------------- 1 | package sa1002 2 | 3 | import ( 4 | "go/constant" 5 | "strings" 6 | "time" 7 | 8 | "honnef.co/go/tools/analysis/callcheck" 9 | "honnef.co/go/tools/analysis/lint" 10 | "honnef.co/go/tools/internal/passes/buildir" 11 | "honnef.co/go/tools/knowledge" 12 | 13 | "golang.org/x/tools/go/analysis" 14 | ) 15 | 16 | var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ 17 | Analyzer: &analysis.Analyzer{ 18 | Name: "SA1002", 19 | Requires: []*analysis.Analyzer{buildir.Analyzer}, 20 | Run: callcheck.Analyzer(rules), 21 | }, 22 | Doc: &lint.RawDocumentation{ 23 | Title: `Invalid format in \'time.Parse\'`, 24 | Since: "2017.1", 25 | Severity: lint.SeverityError, 26 | MergeIf: lint.MergeIfAny, 27 | }, 28 | }) 29 | 30 | var Analyzer = SCAnalyzer.Analyzer 31 | 32 | var rules = map[string]callcheck.Check{ 33 | "time.Parse": func(call *callcheck.Call) { 34 | arg := call.Args[knowledge.Arg("time.Parse.layout")] 35 | if c := callcheck.ExtractConstExpectKind(arg.Value, constant.String); c != nil { 36 | s := constant.StringVal(c.Value) 37 | s = strings.Replace(s, "_", " ", -1) 38 | s = strings.Replace(s, "Z", "-", -1) 39 | _, err := time.Parse(s, s) 40 | if err != nil { 41 | arg.Invalid(err.Error()) 42 | } 43 | } 44 | }, 45 | } 46 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/staticcheck/sa1007/sa1007.go: -------------------------------------------------------------------------------- 1 | package sa1007 2 | 3 | import ( 4 | "fmt" 5 | "go/constant" 6 | "net/url" 7 | 8 | "honnef.co/go/tools/analysis/callcheck" 9 | "honnef.co/go/tools/analysis/lint" 10 | "honnef.co/go/tools/internal/passes/buildir" 11 | "honnef.co/go/tools/knowledge" 12 | 13 | "golang.org/x/tools/go/analysis" 14 | ) 15 | 16 | var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ 17 | Analyzer: &analysis.Analyzer{ 18 | Name: "SA1007", 19 | Requires: []*analysis.Analyzer{buildir.Analyzer}, 20 | Run: callcheck.Analyzer(rules), 21 | }, 22 | Doc: &lint.RawDocumentation{ 23 | Title: `Invalid URL in \'net/url.Parse\'`, 24 | Since: "2017.1", 25 | Severity: lint.SeverityError, 26 | MergeIf: lint.MergeIfAny, 27 | }, 28 | }) 29 | 30 | var Analyzer = SCAnalyzer.Analyzer 31 | 32 | var rules = map[string]callcheck.Check{ 33 | "net/url.Parse": func(call *callcheck.Call) { 34 | arg := call.Args[knowledge.Arg("net/url.Parse.rawurl")] 35 | if c := callcheck.ExtractConstExpectKind(arg.Value, constant.String); c != nil { 36 | s := constant.StringVal(c.Value) 37 | _, err := url.Parse(s) 38 | if err != nil { 39 | arg.Invalid(fmt.Sprintf("%q is not a valid URL: %s", s, err)) 40 | } 41 | } 42 | }, 43 | } 44 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/staticcheck/sa4028/sa4028.go: -------------------------------------------------------------------------------- 1 | package sa4028 2 | 3 | import ( 4 | "go/ast" 5 | 6 | "honnef.co/go/tools/analysis/code" 7 | "honnef.co/go/tools/analysis/lint" 8 | "honnef.co/go/tools/analysis/report" 9 | "honnef.co/go/tools/pattern" 10 | 11 | "golang.org/x/tools/go/analysis" 12 | "golang.org/x/tools/go/analysis/passes/inspect" 13 | ) 14 | 15 | var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ 16 | Analyzer: &analysis.Analyzer{ 17 | Name: "SA4028", 18 | Run: run, 19 | Requires: []*analysis.Analyzer{inspect.Analyzer}, 20 | }, 21 | Doc: &lint.RawDocumentation{ 22 | Title: `\'x % 1\' is always zero`, 23 | Since: "2022.1", 24 | Severity: lint.SeverityWarning, 25 | MergeIf: lint.MergeIfAny, // MergeIfAny if we only flag literals, not named constants 26 | }, 27 | }) 28 | 29 | var Analyzer = SCAnalyzer.Analyzer 30 | 31 | var moduloOneQ = pattern.MustParse(`(BinaryExpr _ "%" (IntegerLiteral "1"))`) 32 | 33 | func run(pass *analysis.Pass) (interface{}, error) { 34 | fn := func(node ast.Node) { 35 | _, ok := code.Match(pass, moduloOneQ, node) 36 | if !ok { 37 | return 38 | } 39 | report.Report(pass, node, "x % 1 is always zero") 40 | } 41 | code.Preorder(pass, fn, (*ast.BinaryExpr)(nil)) 42 | return nil, nil 43 | } 44 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/stylecheck/doc.go: -------------------------------------------------------------------------------- 1 | //go:generate go run ../generate.go 2 | 3 | // Package stylecheck contains analyzes that enforce style rules. 4 | // Most of the recommendations made are universally agreed upon by the wider Go community. 5 | // Some analyzes, however, implement stricter rules that not everyone will agree with. 6 | // In the context of Staticcheck, these analyzes are not enabled by default. 7 | // 8 | // For the most part it is recommended to follow the advice given by the analyzers that are enabled by default, 9 | // but you may want to disable additional analyzes on a case by case basis. 10 | package stylecheck 11 | -------------------------------------------------------------------------------- /vendor/honnef.co/go/tools/stylecheck/st1023/st1023.go: -------------------------------------------------------------------------------- 1 | package st1023 2 | 3 | import ( 4 | "honnef.co/go/tools/analysis/lint" 5 | "honnef.co/go/tools/internal/sharedcheck" 6 | ) 7 | 8 | func init() { 9 | SCAnalyzer.Analyzer.Name = "ST1023" 10 | } 11 | 12 | var SCAnalyzer = lint.InitializeAnalyzer(&lint.Analyzer{ 13 | Analyzer: sharedcheck.RedundantTypeInDeclarationChecker("should", false), 14 | Doc: &lint.RawDocumentation{ 15 | Title: "Redundant type in variable declaration", 16 | Since: "2021.1", 17 | NonDefault: true, 18 | MergeIf: lint.MergeIfAll, 19 | }, 20 | }) 21 | 22 | var Analyzer = SCAnalyzer.Analyzer 23 | -------------------------------------------------------------------------------- /version.go: -------------------------------------------------------------------------------- 1 | package factorio 2 | 3 | // Version is semver. 4 | const Version = "0.0.11" 5 | --------------------------------------------------------------------------------