static favicon.png style.css
vendor
dario.cat
mergo .deepsource.toml .gitignore .travis.yml CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md SECURITY.md doc.go map.go merge.go mergo.go
github.com
Microsoft
go-winio
internal
fs doc.go fs.go security.go zsyscall_windows.go
socket rawaddr.go socket.go zsyscall_windows.go
stringbuffer wstring.go
pkg
guid guid.go guid_nonwindows.go guid_windows.go variant_string.go
.gitattributes .gitignore .golangci.yml CODEOWNERS LICENSE README.md SECURITY.md backup.go doc.go ea.go file.go fileinfo.go hvsock.go pipe.go privilege.go reparse.go sd.go syscall.go zsyscall_windows.go
ProtonMail
go-crypto
bitcurves bitcurve.go
brainpool brainpool.go rcurve.go
eax eax.go eax_test_vectors.go random_vectors.go
internal
byteutil byteutil.go
ocb ocb.go random_vectors.go rfc7253_test_vectors_suite_a.go rfc7253_test_vectors_suite_b.go
openpgp
aes
keywrap keywrap.go
armor armor.go encode.go
ecdh ecdh.go
ecdsa ecdsa.go
ed25519 ed25519.go
ed448 ed448.go
eddsa eddsa.go
elgamal elgamal.go
errors errors.go
internal
algorithm aead.go cipher.go hash.go
ecc curve25519.go curve_info.go curves.go ed25519.go ed448.go generic.go x448.go
encoding encoding.go mpi.go oid.go
packet aead_config.go aead_crypter.go aead_encrypted.go compressed.go config.go config_v5.go encrypted_key.go literal.go marker.go notation.go ocfb.go one_pass_signature.go opaque.go packet.go packet_sequence.go packet_unsupported.go padding.go private_key.go private_key_test_data.go public_key.go public_key_test_data.go reader.go recipient.go signature.go symmetric_key_encrypted.go symmetrically_encrypted.go symmetrically_encrypted_aead.go symmetrically_encrypted_mdc.go userattribute.go userid.go
s2k s2k.go s2k_cache.go s2k_config.go
x25519 x25519.go
x448 x448.go
canonical_text.go hash.go key_generation.go keys.go keys_test_data.go read.go read_write_test_data.go write.go
AUTHORS CONTRIBUTORS LICENSE PATENTS
alecthomas
chroma
v2
formatters
html html.go
lexers
embedded abap.xml abnf.xml actionscript.xml actionscript_3.xml ada.xml agda.xml al.xml alloy.xml ampl.xml angular2.xml antlr.xml apacheconf.xml apl.xml applescript.xml arangodb_aql.xml arduino.xml armasm.xml atl.xml autohotkey.xml autoit.xml awk.xml ballerina.xml bash.xml bash_session.xml batchfile.xml beef.xml bibtex.xml bicep.xml blitzbasic.xml bnf.xml bqn.xml brainfuck.xml c#.xml c++.xml c.xml c3.xml cap_n_proto.xml cassandra_cql.xml ceylon.xml cfengine3.xml cfstatement.xml chaiscript.xml chapel.xml cheetah.xml clojure.xml cmake.xml cobol.xml coffeescript.xml common_lisp.xml coq.xml core.xml crystal.xml css.xml csv.xml cue.xml cython.xml d.xml dart.xml dax.xml desktop_entry.xml devicetree.xml diff.xml django_jinja.xml dns.xml docker.xml dtd.xml dylan.xml ebnf.xml elixir.xml elm.xml emacslisp.xml erb.xml erlang.xml factor.xml fennel.xml fish.xml forth.xml fortran.xml fortranfixed.xml fsharp.xml gas.xml gdscript.xml gdscript3.xml gettext.xml gherkin.xml gleam.xml glsl.xml gnuplot.xml go_template.xml graphql.xml groff.xml groovy.xml handlebars.xml hare.xml haskell.xml hcl.xml hexdump.xml hlb.xml hlsl.xml holyc.xml html.xml hy.xml idris.xml igor.xml ini.xml io.xml iscdhcpd.xml j.xml janet.xml java.xml javascript.xml json.xml jsonata.xml jsonnet.xml julia.xml jungle.xml kakoune.xml kdl.xml kotlin.xml lateralus.xml lean.xml lighttpd_configuration_file.xml llvm.xml lox.xml lua.xml luau.xml makefile.xml mako.xml mason.xml materialize_sql_dialect.xml mathematica.xml matlab.xml mcfunction.xml meson.xml metal.xml microcad.xml minizinc.xml mlir.xml modelica.xml modula-2.xml mojo.xml monkeyc.xml moonbit.xml moonscript.xml morrowindscript.xml myghty.xml mysql.xml nasm.xml natural.xml ndisasm.xml newspeak.xml nginx_configuration_file.xml nim.xml nix.xml nsis.xml nu.xml objective-c.xml objectpascal.xml ocaml.xml octave.xml odin.xml onesenterprise.xml openedge_abl.xml openscad.xml org_mode.xml pacmanconf.xml perl.xml php.xml pig.xml pkgconfig.xml pl_pgsql.xml plaintext.xml plutus_core.xml pony.xml postgresql_sql_dialect.xml postscript.xml povray.xml powerquery.xml powershell.xml prolog.xml promela.xml promql.xml properties.xml protocol_buffer.xml prql.xml psl.xml puppet.xml python.xml python_2.xml qbasic.xml qml.xml r.xml racket.xml ragel.xml react.xml reasonml.xml reg.xml rego.xml rexx.xml rgbasm.xml ring.xml rpgle.xml rpm_spec.xml ruby.xml rust.xml sas.xml sass.xml scala.xml scdoc.xml scheme.xml scilab.xml scss.xml sed.xml sieve.xml smali.xml smalltalk.xml smarty.xml snbt.xml snobol.xml solidity.xml sourcepawn.xml spade.xml sparql.xml sql.xml squidconf.xml standard_ml.xml stas.xml stylus.xml swift.xml systemd.xml systemverilog.xml tablegen.xml tal.xml tasm.xml tcl.xml tcsh.xml termcap.xml terminfo.xml terraform.xml tex.xml thrift.xml toml.xml tradingview.xml transact-sql.xml turing.xml turtle.xml twig.xml txtpb.xml typescript.xml typoscript.xml typoscriptcssdata.xml typoscripthtmldata.xml typst.xml ucode.xml v.xml v_shell.xml vala.xml vb_net.xml verilog.xml vhdl.xml vhs.xml viml.xml vue.xml wat.xml wdte.xml webgpu_shading_language.xml webvtt.xml whiley.xml xml.xml xorg.xml yaml.xml yang.xml z80_assembly.xml zed.xml zig.xml
README.md caddyfile.go cl.go dns.go emacs.go erb.go gemtext.go genshi.go go.go haxe.go html.go http.go lexers.go markdown.go markless.go mysql.go php.go raku.go rst.go svelte.go typoscript.go zed.go
styles abap.xml algol.xml algol_nu.xml api.go arduino.xml ashen.xml aura-theme-dark-soft.xml aura-theme-dark.xml autumn.xml average.xml base16-snazzy.xml borland.xml bw.xml catppuccin-frappe.xml catppuccin-latte.xml catppuccin-macchiato.xml catppuccin-mocha.xml colorful.xml compat.go darcula.xml doom-one.xml doom-one2.xml dracula.xml emacs.xml evergarden.xml friendly.xml fruity.xml github-dark.xml github.xml gruvbox-light.xml gruvbox.xml hr_high_contrast.xml hrdark.xml igor.xml kanagawa-dragon.xml kanagawa-lotus.xml kanagawa-wave.xml lovelace.xml manni.xml modus-operandi.xml modus-vivendi.xml monokai.xml monokailight.xml murphy.xml native.xml nord.xml nordic.xml onedark.xml onesenterprise.xml paraiso-dark.xml paraiso-light.xml pastie.xml perldoc.xml pygments.xml rainbow_dash.xml rose-pine-dawn.xml rose-pine-moon.xml rose-pine.xml rpgle.xml rrt.xml solarized-dark.xml solarized-dark256.xml solarized-light.xml swapoff.xml tango.xml tokyonight-day.xml tokyonight-moon.xml tokyonight-night.xml tokyonight-storm.xml trac.xml vim.xml vs.xml vulcan.xml witchhazel.xml xcode-dark.xml xcode.xml
.editorconfig .gitignore .golangci.yml .goreleaser.yml AGENTS.md Bitfile COPYING Dockerfile Justfile README.md biome.json chroma.jpg coalesce.go colour.go delegate.go doc.go emitters.go formatter.go iterator.go lexer.go mutators.go pygments-lexers.txt regexp.go registry.go remap.go renovate.json5 serialise.go style.go table.py tokentype_enumer.go types.go
cloudflare
circl
dh
x25519 curve.go curve_amd64.go curve_amd64.h curve_amd64.s curve_generic.go curve_noasm.go doc.go key.go table.go
x448 curve.go curve_amd64.go curve_amd64.h curve_amd64.s curve_generic.go curve_noasm.go doc.go key.go table.go
ecc
goldilocks constants.go curve.go isogeny.go point.go scalar.go twist.go twistPoint.go twistTables.go twist_basemult.go
internal
conv conv.go
sha3 doc.go hashes.go keccakf.go rc.go sha3.go sha3_s390x.s shake.go xor.go xor_generic.go xor_unaligned.go
math
fp25519 fp.go fp_amd64.go fp_amd64.h fp_amd64.s fp_generic.go fp_noasm.go
fp448 fp.go fp_amd64.go fp_amd64.h fp_amd64.s fp_generic.go fp_noasm.go fuzzer.go
mlsbset mlsbset.go power.go
integer.go primes.go wnaf.go
sign
ed25519 ed25519.go modular.go mult.go point.go pubkey.go pubkey112.go signapi.go tables.go
ed448 ed448.go signapi.go
sign.go
LICENSE
cyphar
filepath-securejoin
internal
consts consts.go
.golangci.yml CHANGELOG.md COPYING.md LICENSE.BSD LICENSE.MPL-2.0 README.md VERSION codecov.yml doc.go join.go vfs.go
dlclark
regexp2
syntax charclass.go code.go escape.go fuzz.go parser.go prefix.go replacerdata.go tree.go writer.go
.gitignore .travis.yml ATTRIB LICENSE README.md fastclock.go match.go regexp.go replace.go runner.go testoutput1
emirpasic
gods
containers containers.go enumerable.go iterator.go serialization.go
lists
arraylist arraylist.go enumerable.go iterator.go serialization.go
lists.go
trees
binaryheap binaryheap.go iterator.go serialization.go
trees.go
utils comparator.go sort.go utils.go
LICENSE
go-enry
go-enry
v2
data
rule rule.go
alias.go colors.go commit.go content.go doc.go documentation.go extension.go filename.go frequencies.go generated.go groups.go heuristics.go id.go interpreter.go languageInfo.go mimeType.go test.go type.go vendor.go
internal
tokenizer
flex lex.linguist_yy.c lex.linguist_yy.h linguist.h tokenize_c.go
common.go tokenize.go tokenize_c.go
regex oniguruma.go regex.go standard.go
.editorconfig .gitignore LICENSE Makefile README.md classifier.go common.go enry.go utils.go
go-oniguruma LICENSE README.md chelper.c chelper.h constants.go quotemeta.go regex.go
go-git
gcfg
scanner errors.go scanner.go
token position.go serialize.go token.go
types bool.go doc.go enum.go int.go scan.go
.gitignore LICENSE Makefile README doc.go errors.go read.go set.go
go-billy
v5
helper
chroot chroot.go
polyfill polyfill.go
memfs memory.go storage.go
osfs os.go os_bound.go os_chroot.go os_js.go os_options.go os_plan9.go os_posix.go os_wasip1.go os_windows.go
util glob.go util.go walk.go
.gitignore LICENSE Makefile README.md fs.go
go-git
v5
config branch.go config.go modules.go refspec.go url.go
internal
path_util path_util.go
revision parser.go scanner.go token.go
url url.go
plumbing
cache buffer_lru.go common.go object_lru.go
color color.go
filemode filemode.go
format
config common.go decoder.go doc.go encoder.go format.go option.go section.go
diff colorconfig.go patch.go unified_encoder.go
gitignore dir.go doc.go matcher.go pattern.go
idxfile decoder.go doc.go encoder.go idxfile.go writer.go
index decoder.go doc.go encoder.go index.go match.go
objfile doc.go reader.go writer.go
packfile common.go delta_index.go delta_selector.go diff_delta.go doc.go encoder.go error.go fsobject.go object_pack.go packfile.go parser.go patch_delta.go scanner.go
pktline encoder.go error.go scanner.go
hash hash.go hash_sha1.go hash_sha256.go
object blob.go change.go change_adaptor.go commit.go commit_scanner.go commit_walker.go commit_walker_bfs.go commit_walker_bfs_filtered.go commit_walker_ctime.go commit_walker_limit.go commit_walker_path.go difftree.go file.go merge_base.go object.go patch.go rename.go signature.go tag.go tag_scanner.go tree.go treenoder.go
protocol
packp
capability capability.go list.go
sideband common.go demux.go doc.go muxer.go
advrefs.go advrefs_decode.go advrefs_encode.go common.go doc.go filter.go gitproto.go report_status.go shallowupd.go srvresp.go ulreq.go ulreq_decode.go ulreq_encode.go updreq.go updreq_decode.go updreq_encode.go uppackreq.go uppackresp.go
revlist revlist.go
storer doc.go index.go object.go reference.go shallow.go storer.go
transport
client client.go
file client.go server.go
git common.go
http common.go receive_pack.go transport.go upload_pack.go
internal
common common.go mocks.go server.go
server loader.go server.go
ssh auth_method.go common.go
common.go
error.go hash.go memory.go object.go reference.go revision.go
storage
filesystem
dotgit dotgit.go dotgit_rewrite_packed_refs.go dotgit_setref.go reader.go repository_filesystem.go writers.go writers_unix.go writers_windows.go
config.go deltaobject.go index.go module.go object.go reference.go shallow.go storage.go
memory storage.go
storer.go
utils
binary read.go write.go
diff diff.go
ioutil common.go
merkletrie
filesystem node.go
index node.go
internal
frame frame.go
noder noder.go path.go
change.go difftree.go doc.go doubleiter.go iter.go
sync bufio.go bytes.go zlib.go
trace trace.go
.gitignore CODE_OF_CONDUCT.md COMPATIBILITY.md CONTRIBUTING.md EXTENDING.md LICENSE Makefile README.md SECURITY.md blame.go common.go doc.go object_walker.go options.go oss-fuzz.sh prune.go remote.go repository.go repository_extensions.go signer.go status.go submodule.go worktree.go worktree_bsd.go worktree_commit.go worktree_js.go worktree_linux.go worktree_plan9.go worktree_status.go worktree_unix_other.go worktree_windows.go
golang
groupcache
lru lru.go
LICENSE
jbenet
go-context
io ctxio.go
LICENSE
kevinburke
ssh_config .gitattributes .gitignore .mailmap AUTHORS.txt CHANGELOG.md LICENSE Makefile README.md config.go lexer.go parser.go position.go token.go validators.go
klauspost
cpuid
v2 .gitignore .goreleaser.yml CONTRIBUTING.txt LICENSE README.md cpuid.go cpuid_386.s cpuid_amd64.s cpuid_arm64.s detect_arm64.go detect_ref.go detect_x86.go featureid_string.go os_darwin_arm64.go os_linux_arm64.go os_other_arm64.go os_safe_linux_arm64.go os_unsafe_linux_arm64.go test-architectures.sh
pjbgf
sha1cd
internal const.go
ubc const.go ubc.go
Dockerfile.arm Dockerfile.arm64 LICENSE Makefile README.md detection.go sha1cd.go sha1cdblock_amd64.go sha1cdblock_amd64.s sha1cdblock_arm64.go sha1cdblock_arm64.s sha1cdblock_generic.go sha1cdblock_noasm.go
sergi
go-diff
diffmatchpatch diff.go diffmatchpatch.go match.go mathutil.go operation_string.go patch.go stringutil.go
AUTHORS CONTRIBUTORS LICENSE
skeema
knownhosts CONTRIBUTING.md LICENSE NOTICE README.md knownhosts.go
xanzy
ssh-agent .gitignore LICENSE README.md pageant_windows.go sshagent.go sshagent_windows.go
yuin
goldmark
ast ast.go block.go inline.go
extension
ast definition_list.go footnote.go strikethrough.go table.go tasklist.go
cjk.go definition_list.go footnote.go gfm.go linkify.go package.go strikethrough.go table.go tasklist.go typographer.go
parser attribute.go atx_heading.go auto_link.go blockquote.go code_block.go code_span.go delimiter.go emphasis.go fcode_block.go html_block.go link.go link_ref.go list.go list_item.go paragraph.go parser.go raw_html.go setext_headings.go thematic_break.go
renderer
html html.go
renderer.go
text package.go reader.go segment.go
util html5entities.gen.go html5entities.go unicode_case_folding.gen.go unicode_case_folding.go util.go util_cjk.go util_safe.go util_unsafe_go120.go util_unsafe_go121.go
.gitignore .golangci.yml LICENSE Makefile README.md markdown.go
golang.org
x
crypto
argon2 argon2.go blake2b.go blamka_amd64.go blamka_amd64.s blamka_generic.go blamka_ref.go
blake2b blake2b.go blake2bAVX2_amd64.go blake2bAVX2_amd64.s blake2b_amd64.s blake2b_generic.go blake2b_ref.go blake2x.go go125.go register.go
blowfish block.go cipher.go const.go
cast5 cast5.go
chacha20 chacha_arm64.go chacha_arm64.s chacha_generic.go chacha_noasm.go chacha_ppc64x.go chacha_ppc64x.s chacha_s390x.go chacha_s390x.s xor.go
cryptobyte
asn1 asn1.go
asn1.go builder.go string.go
curve25519 curve25519.go
hkdf hkdf.go
internal
alias alias.go alias_purego.go
poly1305 mac_noasm.go poly1305.go sum_amd64.s sum_asm.go sum_generic.go sum_loong64.s sum_ppc64x.s sum_s390x.go sum_s390x.s
sha3 hashes.go legacy_hash.go legacy_keccakf.go shake.go
ssh
agent client.go forward.go keyring.go server.go
internal
bcrypt_pbkdf bcrypt_pbkdf.go
knownhosts knownhosts.go
buffer.go certs.go channel.go cipher.go client.go client_auth.go common.go connection.go doc.go handshake.go kex.go keys.go mac.go messages.go mlkem.go mux.go server.go session.go ssh_gss.go streamlocal.go tcpip.go transport.go
LICENSE PATENTS
net
context context.go
internal
socks client.go socks.go
proxy dial.go direct.go per_host.go proxy.go socks5.go
LICENSE PATENTS
sys
cpu asm_aix_ppc64.s asm_darwin_arm64_gc.s asm_darwin_x86_gc.s byteorder.go cpu.go cpu_aix.go cpu_arm.go cpu_arm64.go cpu_arm64.s cpu_darwin_arm64.go cpu_darwin_arm64_other.go cpu_darwin_x86.go cpu_gc_arm64.go cpu_gc_s390x.go cpu_gc_x86.go cpu_gc_x86.s cpu_gccgo_arm64.go cpu_gccgo_s390x.go cpu_gccgo_x86.c cpu_gccgo_x86.go cpu_linux.go cpu_linux_arm.go cpu_linux_arm64.go cpu_linux_loong64.go cpu_linux_mips64x.go cpu_linux_noinit.go cpu_linux_ppc64x.go cpu_linux_riscv64.go cpu_linux_s390x.go cpu_loong64.go cpu_loong64.s cpu_mips64x.go cpu_mipsx.go cpu_netbsd_arm64.go cpu_openbsd_arm64.go cpu_openbsd_arm64.s cpu_other_arm.go cpu_other_arm64.go cpu_other_mips64x.go cpu_other_ppc64x.go cpu_other_riscv64.go cpu_other_x86.go cpu_ppc64x.go cpu_riscv64.go cpu_s390x.go cpu_s390x.s cpu_wasm.go cpu_x86.go cpu_zos.go cpu_zos_s390x.go endian_big.go endian_little.go hwcap_linux.go parse.go proc_cpuinfo_linux.go runtime_auxv.go runtime_auxv_go121.go syscall_aix_gccgo.go syscall_aix_ppc64_gc.go syscall_darwin_arm64_gc.go syscall_darwin_x86_gc.go
execabs execabs.go execabs_go118.go execabs_go119.go
unix .gitignore README.md affinity_linux.go aliases.go asm_aix_ppc64.s asm_bsd_386.s asm_bsd_amd64.s asm_bsd_arm.s asm_bsd_arm64.s asm_bsd_ppc64.s asm_bsd_riscv64.s asm_linux_386.s asm_linux_amd64.s asm_linux_arm.s asm_linux_arm64.s asm_linux_loong64.s asm_linux_mips64x.s asm_linux_mipsx.s asm_linux_ppc64x.s asm_linux_riscv64.s asm_linux_s390x.s asm_openbsd_mips64.s asm_solaris_amd64.s asm_zos_s390x.s auxv.go auxv_unsupported.go bluetooth_linux.go bpxsvc_zos.go bpxsvc_zos.s cap_freebsd.go constants.go dev_aix_ppc.go dev_aix_ppc64.go dev_darwin.go dev_dragonfly.go dev_freebsd.go dev_linux.go dev_netbsd.go dev_openbsd.go dev_zos.go dirent.go endian_big.go endian_little.go env_unix.go fcntl.go fcntl_darwin.go fcntl_linux_32bit.go fdset.go gccgo.go gccgo_c.c gccgo_linux_amd64.go ifreq_linux.go ioctl_linux.go ioctl_signed.go ioctl_unsigned.go ioctl_zos.go mkall.sh mkerrors.sh mmap_nomremap.go mremap.go pagesize_unix.go pledge_openbsd.go ptrace_darwin.go ptrace_ios.go race.go race0.go readdirent_getdents.go readdirent_getdirentries.go sockcmsg_dragonfly.go sockcmsg_linux.go sockcmsg_unix.go sockcmsg_unix_other.go sockcmsg_zos.go symaddr_zos_s390x.s syscall.go syscall_aix.go syscall_aix_ppc.go syscall_aix_ppc64.go syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go syscall_darwin_arm64.go syscall_darwin_libSystem.go syscall_dragonfly.go syscall_dragonfly_amd64.go syscall_freebsd.go syscall_freebsd_386.go syscall_freebsd_amd64.go syscall_freebsd_arm.go syscall_freebsd_arm64.go syscall_freebsd_riscv64.go syscall_hurd.go syscall_hurd_386.go syscall_illumos.go syscall_linux.go syscall_linux_386.go syscall_linux_alarm.go syscall_linux_amd64.go syscall_linux_amd64_gc.go syscall_linux_arm.go syscall_linux_arm64.go syscall_linux_gc.go syscall_linux_gc_386.go syscall_linux_gc_arm.go syscall_linux_gccgo_386.go syscall_linux_gccgo_arm.go syscall_linux_loong64.go syscall_linux_mips64x.go syscall_linux_mipsx.go syscall_linux_ppc.go syscall_linux_ppc64x.go syscall_linux_riscv64.go syscall_linux_s390x.go syscall_linux_sparc64.go syscall_netbsd.go syscall_netbsd_386.go syscall_netbsd_amd64.go syscall_netbsd_arm.go syscall_netbsd_arm64.go syscall_openbsd.go syscall_openbsd_386.go syscall_openbsd_amd64.go syscall_openbsd_arm.go syscall_openbsd_arm64.go syscall_openbsd_libc.go syscall_openbsd_mips64.go syscall_openbsd_ppc64.go syscall_openbsd_riscv64.go syscall_solaris.go syscall_solaris_amd64.go syscall_unix.go syscall_unix_gc.go syscall_unix_gc_ppc64x.go syscall_zos_s390x.go sysvshm_linux.go sysvshm_unix.go sysvshm_unix_other.go timestruct.go unveil_openbsd.go vgetrandom_linux.go vgetrandom_unsupported.go xattr_bsd.go zerrors_aix_ppc.go zerrors_aix_ppc64.go zerrors_darwin_amd64.go zerrors_darwin_arm64.go zerrors_dragonfly_amd64.go zerrors_freebsd_386.go zerrors_freebsd_amd64.go zerrors_freebsd_arm.go zerrors_freebsd_arm64.go zerrors_freebsd_riscv64.go zerrors_linux.go zerrors_linux_386.go zerrors_linux_amd64.go zerrors_linux_arm.go zerrors_linux_arm64.go zerrors_linux_loong64.go zerrors_linux_mips.go zerrors_linux_mips64.go zerrors_linux_mips64le.go zerrors_linux_mipsle.go zerrors_linux_ppc.go zerrors_linux_ppc64.go zerrors_linux_ppc64le.go zerrors_linux_riscv64.go zerrors_linux_s390x.go zerrors_linux_sparc64.go zerrors_netbsd_386.go zerrors_netbsd_amd64.go zerrors_netbsd_arm.go zerrors_netbsd_arm64.go zerrors_openbsd_386.go zerrors_openbsd_amd64.go zerrors_openbsd_arm.go zerrors_openbsd_arm64.go zerrors_openbsd_mips64.go zerrors_openbsd_ppc64.go zerrors_openbsd_riscv64.go zerrors_solaris_amd64.go zerrors_zos_s390x.go zptrace_armnn_linux.go zptrace_linux_arm64.go zptrace_mipsnn_linux.go zptrace_mipsnnle_linux.go zptrace_x86_linux.go zsymaddr_zos_s390x.s zsyscall_aix_ppc.go zsyscall_aix_ppc64.go zsyscall_aix_ppc64_gc.go zsyscall_aix_ppc64_gccgo.go zsyscall_darwin_amd64.go zsyscall_darwin_amd64.s zsyscall_darwin_arm64.go zsyscall_darwin_arm64.s zsyscall_dragonfly_amd64.go zsyscall_freebsd_386.go zsyscall_freebsd_amd64.go zsyscall_freebsd_arm.go zsyscall_freebsd_arm64.go zsyscall_freebsd_riscv64.go zsyscall_illumos_amd64.go zsyscall_linux.go zsyscall_linux_386.go zsyscall_linux_amd64.go zsyscall_linux_arm.go zsyscall_linux_arm64.go zsyscall_linux_loong64.go zsyscall_linux_mips.go zsyscall_linux_mips64.go zsyscall_linux_mips64le.go zsyscall_linux_mipsle.go zsyscall_linux_ppc.go zsyscall_linux_ppc64.go zsyscall_linux_ppc64le.go zsyscall_linux_riscv64.go zsyscall_linux_s390x.go zsyscall_linux_sparc64.go zsyscall_netbsd_386.go zsyscall_netbsd_amd64.go zsyscall_netbsd_arm.go zsyscall_netbsd_arm64.go zsyscall_openbsd_386.go zsyscall_openbsd_386.s zsyscall_openbsd_amd64.go zsyscall_openbsd_amd64.s zsyscall_openbsd_arm.go zsyscall_openbsd_arm.s zsyscall_openbsd_arm64.go zsyscall_openbsd_arm64.s zsyscall_openbsd_mips64.go zsyscall_openbsd_mips64.s zsyscall_openbsd_ppc64.go zsyscall_openbsd_ppc64.s zsyscall_openbsd_riscv64.go zsyscall_openbsd_riscv64.s zsyscall_solaris_amd64.go zsyscall_zos_s390x.go zsysctl_openbsd_386.go zsysctl_openbsd_amd64.go zsysctl_openbsd_arm.go zsysctl_openbsd_arm64.go zsysctl_openbsd_mips64.go zsysctl_openbsd_ppc64.go zsysctl_openbsd_riscv64.go zsysnum_darwin_amd64.go zsysnum_darwin_arm64.go zsysnum_dragonfly_amd64.go zsysnum_freebsd_386.go zsysnum_freebsd_amd64.go zsysnum_freebsd_arm.go zsysnum_freebsd_arm64.go zsysnum_freebsd_riscv64.go zsysnum_linux_386.go zsysnum_linux_amd64.go zsysnum_linux_arm.go zsysnum_linux_arm64.go zsysnum_linux_loong64.go zsysnum_linux_mips.go zsysnum_linux_mips64.go zsysnum_linux_mips64le.go zsysnum_linux_mipsle.go zsysnum_linux_ppc.go zsysnum_linux_ppc64.go zsysnum_linux_ppc64le.go zsysnum_linux_riscv64.go zsysnum_linux_s390x.go zsysnum_linux_sparc64.go zsysnum_netbsd_386.go zsysnum_netbsd_amd64.go zsysnum_netbsd_arm.go zsysnum_netbsd_arm64.go zsysnum_openbsd_386.go zsysnum_openbsd_amd64.go zsysnum_openbsd_arm.go zsysnum_openbsd_arm64.go zsysnum_openbsd_mips64.go zsysnum_openbsd_ppc64.go zsysnum_openbsd_riscv64.go zsysnum_zos_s390x.go ztypes_aix_ppc.go ztypes_aix_ppc64.go ztypes_darwin_amd64.go ztypes_darwin_arm64.go ztypes_dragonfly_amd64.go ztypes_freebsd_386.go ztypes_freebsd_amd64.go ztypes_freebsd_arm.go ztypes_freebsd_arm64.go ztypes_freebsd_riscv64.go ztypes_linux.go ztypes_linux_386.go ztypes_linux_amd64.go ztypes_linux_arm.go ztypes_linux_arm64.go ztypes_linux_loong64.go ztypes_linux_mips.go ztypes_linux_mips64.go ztypes_linux_mips64le.go ztypes_linux_mipsle.go ztypes_linux_ppc.go ztypes_linux_ppc64.go ztypes_linux_ppc64le.go ztypes_linux_riscv64.go ztypes_linux_s390x.go ztypes_linux_sparc64.go ztypes_netbsd_386.go ztypes_netbsd_amd64.go ztypes_netbsd_arm.go ztypes_netbsd_arm64.go ztypes_openbsd_386.go ztypes_openbsd_amd64.go ztypes_openbsd_arm.go ztypes_openbsd_arm64.go ztypes_openbsd_mips64.go ztypes_openbsd_ppc64.go ztypes_openbsd_riscv64.go ztypes_solaris_amd64.go ztypes_zos_s390x.go
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
LICENSE PATENTS
gopkg.in
warnings.v0 LICENSE README warnings.go
yaml.v3 LICENSE NOTICE README.md apic.go decode.go emitterc.go encode.go parserc.go readerc.go resolve.go scannerc.go sorter.go writerc.go yaml.go yamlh.go yamlprivateh.go
modules.txt
views blob.html commit.html files.html footer.html license.html markers.html nav-main.html nav-repository.html readme.html repositories.html repository.html tree.html
.air.toml .gitignore LICENSE README.md bbgit.service cache.go config.go config.yaml embed.go gitutils.go go.mod go.sum hcommit.go hfiles.go hhome.go hinfo.go hrepo.go languages.go main.go mdalerts.go models.go templates.go
vendor/github.com/go-enry/go-enry/v2/README.md raw
  1# go-enry [![GoDoc](https://godoc.org/github.com/go-enry/go-enry?status.svg)](https://pkg.go.dev/github.com/go-enry/go-enry/v2) [![Test](https://github.com/go-enry/go-enry/actions/workflows/goTest.yml/badge.svg)](https://github.com/go-enry/go-enry/actions/workflows/goTest.yml?query=branch%3Amaster)
  2
  3Programming language detector and toolbox to ignore binary or vendored files. _enry_, started as a port to _Go_ of the original [Linguist](https://github.com/github/linguist) _Ruby_ library, that has an improved _2x performance_.
  4
  5- [CLI](#cli)
  6- [Library](#library)
  7  - [Use cases](#use-cases)
  8    - [By filename](#by-filename)
  9    - [By text](#by-text)
 10    - [By file](#by-file)
 11    - [Filtering](#filtering-vendoring-binaries-etc)
 12    - [Coloring](#language-colors-and-groups)
 13  - [Languages](#languages)
 14    - [Go](#go)
 15    - [Java bindings](#java-bindings)
 16    - [Python bindings](#python-bindings)
 17    - [Rust bindings](#rust-bindings)
 18- [Divergences from linguist](#divergences-from-linguist)
 19- [Benchmarks](#benchmarks)
 20- [Why Enry?](#why-enry)
 21- [Development](#development)
 22  - [Sync with github/linguist upstream](#sync-with-githublinguist-upstream)
 23- [Misc](#misc)
 24- [License](#license)
 25
 26# CLI
 27
 28The CLI binary is hosted in a separate repository [go-enry/enry](https://github.com/go-enry/enry).
 29
 30# Library
 31
 32_enry_ is also a Go library for guessing a programming language that exposes API through FFI to multiple programming environments.
 33
 34## Use cases
 35
 36_enry_ guesses a programming language using a sequence of matching _strategies_ that are
 37applied progressively to narrow down the possible options. Each _strategy_ varies on the type
 38of input data that it needs to make a decision: file name, extension, the first line of the file, the full content of the file, etc.
 39
 40Depending on available input data, enry API can be roughly divided into the next categories or use cases.
 41
 42### By filename
 43
 44Next functions require only a name of the file to make a guess:
 45
 46- `GetLanguageByExtension` uses only file extension (wich may be ambiguous)
 47- `GetLanguageByFilename` useful for cases like `.gitignore`, `.bashrc`, etc
 48- all [filtering helpers](#filtering)
 49
 50Please note that such guesses are expected not to be very accurate.
 51
 52### By text
 53
 54To make a guess only based on the content of the file or a text snippet, use
 55
 56- `GetLanguageByShebang` reads only the first line of text to identify the [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>).
 57- `GetLanguageByModeline` for cases when Vim/Emacs modeline e.g. `/* vim: set ft=cpp: */` may be present at a head or a tail of the text.
 58- `GetLanguageByClassifier` uses a Bayesian classifier trained on all the `./samples/` from Linguist.
 59
 60  It usually is a last-resort strategy that is used to disambiguate the guess of the previous strategies, and thus it requires a list of "candidate" guesses. One can provide a list of all known languages - keys from the `data.LanguagesLogProbabilities` as possible candidates if more intelligent hypotheses are not available, at the price of possibly suboptimal accuracy.
 61
 62### By file
 63
 64The most accurate guess would be when both a file name and its content are available:
 65
 66- `GetLanguagesByContent` only uses file extension and a set of regexp-based content heuristics.
 67- `GetLanguages` uses the full set of matching strategies and is expected to be most accurate.
 68
 69### Filtering: vendoring, binaries, etc
 70
 71_enry_ expose a set of file-level helpers `Is*` to simplify filtering out the files that are less interesting for the purpose of source code analysis:
 72
 73- `IsBinary`
 74- `IsVendor`
 75- `IsConfiguration`
 76- `IsDocumentation`
 77- `IsDotFile`
 78- `IsImage`
 79- `IsTest`
 80- `IsGenerated`
 81
 82### Language colors and groups
 83
 84_enry_ exposes function to get language color to use for example in presenting statistics in graphs:
 85
 86- `GetColor`
 87- `GetLanguageGroup` can be used to group similar languages together e.g. for `Less` this function will return `CSS`
 88
 89## Languages
 90
 91### Go
 92
 93In a [Go module](https://github.com/golang/go/wiki/Modules),
 94import `enry` to the module by running:
 95
 96```sh
 97go get github.com/go-enry/go-enry/v2
 98```
 99
100The rest of the examples will assume you have either done this or fetched the
101library into your `GOPATH`.
102
103```go
104// The examples here and below assume you have imported the library.
105import "github.com/go-enry/go-enry/v2"
106
107lang, safe := enry.GetLanguageByExtension("foo.go")
108fmt.Println(lang, safe)
109// result: Go true
110
111lang, safe := enry.GetLanguageByContent("foo.m", []byte("<matlab-code>"))
112fmt.Println(lang, safe)
113// result: Matlab true
114
115lang, safe := enry.GetLanguageByContent("bar.m", []byte("<objective-c-code>"))
116fmt.Println(lang, safe)
117// result: Objective-C true
118
119// all strategies together
120lang := enry.GetLanguage("foo.cpp", []byte("<cpp-code>"))
121// result: C++ true
122```
123
124Note that the returned boolean value `safe` is `true` if there is only one possible language detected.
125
126A plural version of the same API allows getting a list of all possible languages for a given file.
127
128```go
129langs := enry.GetLanguages("foo.h",  []byte("<cpp-code>"))
130// result: []string{"C", "C++", "Objective-C}
131
132langs := enry.GetLanguagesByExtension("foo.asc", []byte("<content>"), nil)
133// result: []string{"AGS Script", "AsciiDoc", "Public Key"}
134
135langs := enry.GetLanguagesByFilename("Gemfile", []byte("<content>"), []string{})
136// result: []string{"Ruby"}
137```
138
139### Java bindings
140
141Generated Java bindings using a C shared library and JNI are available under [`java`](https://github.com/go-enry/go-enry/blob/master/java).
142
143A library is published on Maven as [tech.sourced:enry-java](https://mvnrepository.com/artifact/tech.sourced/enry-java) for macOS and linux platforms. Windows support is planned under [src-d/enry#150](https://github.com/src-d/enry/issues/150).
144
145### Python bindings
146
147Python bindings using a C shared library and cffi are available for Python 3.9+.
148
149**Installation:**
150```bash
151pip install enry
152```
153
154Pre-built wheels are available for Linux (x86_64) and macOS (Intel + Apple Silicon).
155
156**Usage:**
157```python
158import enry
159
160language = enry.get_language("example.go", b"package main")
161print(language)  # Output: Go
162```
163
164A library is published on pypi as [enry](https://pypi.org/project/enry/) for
165macOS and linux platforms.
166
167For more details, see [python/README.md](https://github.com/go-enry/go-enry/blob/master/python/README.md).
168
169
170### Rust bindings
171
172Generated Rust bindings using a C static library are available at https://github.com/go-enry/rs-enry.
173
174
175## Divergences from Linguist
176
177The `enry` library is based on the data from `github/linguist` version **v9.5.0**.
178
179Parsing [linguist/samples](https://github.com/github/linguist/tree/master/samples) the following `enry` results are different from the Linguist:
180
181- [Heuristics for ".txt" extension](https://github.com/github/linguist/blob/8083cb5a89cee2d99f5a988f165994d0243f0d1e/lib/linguist/heuristics.yml#L521) in Vim Help File could not be parsed, due to unsupported negative lookahead in RE2 regexp engine.
182
183- [Heuristics for ".sol" extension](https://github.com/github/linguist/blob/8083cb5a89cee2d99f5a988f165994d0243f0d1e/lib/linguist/heuristics.yml#L464) in Solidity could not be parsed, due to unsupported negative lookahead in RE2 regexp engine.
184
185- [Heuristics for ".rno" extension](https://github.com/github/linguist/blob/3a1bd3c3d3e741a8aaec4704f782e06f5cd2a00d/lib/linguist/heuristics.yml#L365) in RUNOFF could not be parsed, due to unsupported lookahead in RE2 regexp engine.
186
187- [Heuristics for ".inc" extension](https://github.com/github/linguist/blob/f0e2d0d7f1ce600b2a5acccaef6b149c87d8b99c/lib/linguist/heuristics.yml#L222) in NASL could not be parsed, due to unsupported possessive quantifier in RE2 regexp engine.
188
189- [Heuristics for ".as" extension](https://github.com/github/linguist/blob/223c00bb80eff04788e29010f98c5778993d2b2a/lib/linguist/heuristics.yml#L67) in ActionScript could not be parsed, due to unsupported positive lookahead in RE2 regexp engine.
190
191- [Heuristics for ".csc", ".gsc" and ".gsh" extension](https://github.com/github/linguist/blob/7469c7982d93f2ad922230d712f586a353dc1a42/lib/linguist/heuristics.yml#L650-L651) in GSC could not be parsed, due to unsupported non-backtracking subexpressions in RE2 regexp engine.
192
193- [Heuristic for ".txt"](https://github.com/github/linguist/blob/bf853f1c663903e3ee35935189760191f1c45e1c/lib/linguist/heuristics.yml#L680-L702) detecting 'Adblock Filter List' regexp syntax not supported by RE2
194
195- [IsVendor('bootstrap.css') == false](https://github.com/github/linguist/blob/v7.23.0/lib/linguist/vendor.yml#L77) v7.23 first unsupported RE syntax outside content heuristics
196
197- As of [Linguist v5.3.2](https://github.com/github/linguist/releases/tag/v5.3.2) it is using [flex-based scanner in C for tokenization](https://github.com/github/linguist/pull/3846). Enry still uses [extract_token](https://github.com/github/linguist/pull/3846/files#diff-d5179df0b71620e3fac4535cd1368d15L60) regex-based algorithm. See [#193](https://github.com/src-d/enry/issues/193).
198
199- Bayesian classifier can't distinguish "SQL" from "PLpgSQL. See [#194](https://github.com/src-d/enry/issues/194).
200
201- Overriding languages and types though `.gitattributes` is not yet supported. See [#18](https://github.com/src-d/enry/issues/18).
202
203- `enry` CLI output does NOT exclude `.gitignore`ed files and git submodules, as Linguist does
204
205In all the cases above that have an issue number - we plan to update enry to match Linguist behavior.
206
207> All the issues related to heuristics' regexp  syntax incompatibilities with the RE2 engine can be avoided by using `oniguruma` instead (see [instuctions](#misc))
208
209## Benchmarks
210
211Enry's language detection has been compared with Linguist's on [_linguist/samples_](https://github.com/github/linguist/tree/master/samples).
212
213We got these results:
214
215![histogram](benchmarks/histogram/distribution.png)
216
217The histogram shows the _number of files_ (y-axis) per _time interval bucket_ (x-axis).
218Most of the files were detected faster by enry.
219
220There are several cases where enry is slower than Linguist due to
221Go regexp engine being slower than Ruby's on, wich is based on [oniguruma](https://github.com/kkos/oniguruma) library, written in C.
222
223See [instructions](#misc) for running enry with oniguruma.
224
225## Why Enry?
226
227In the movie [My Fair Lady](https://en.wikipedia.org/wiki/My_Fair_Lady), [Professor Henry Higgins](http://www.imdb.com/character/ch0011719/) is a linguist who at the very beginning of the movie enjoys guessing the origin of people based on their accent.
228
229"Enry Iggins" is how [Eliza Doolittle](http://www.imdb.com/character/ch0011720/), [pronounces](https://www.youtube.com/watch?v=pwNKyTktDIE) the name of the Professor.
230
231## Development
232
233To run the tests use:
234
235    go test ./...
236
237Setting `ENRY_TEST_REPO` to a path to the existing checkout of the Linguist will avoid cloning it and speeds tests up.
238Setting `ENRY_DEBUG=1` will provide insight into the Bayesian classifier built during `make code-generate`.
239
240### Sync with github/linguist upstream
241
242_enry_ re-uses parts of the original [github/linguist](https://github.com/github/linguist) to generate internal data structures.
243In order to update to the latest release of linguist do:
244
245```bash
246$ git clone https://github.com/github/linguist.git .linguist
247$ cd .linguist; git checkout <release-tag>; cd ..
248
249# put the new release's commit sha in the generator_test.go (to re-generate .gold test fixtures)
250# https://github.com/go-enry/go-enry/blob/13d3d66d37a87f23a013246a1b0678c9ee3d524b/internal/code-generator/generator/generator_test.go#L18
251
252$ make code-generate
253```
254
255To stay in sync, enry needs to be updated when a new release of the linguist includes changes to any of the following files:
256
257- [languages.yml](https://github.com/github/linguist/blob/master/lib/linguist/languages.yml)
258- [heuristics.yml](https://github.com/github/linguist/blob/master/lib/linguist/heuristics.yml)
259- [vendor.yml](https://github.com/github/linguist/blob/master/lib/linguist/vendor.yml)
260- [documentation.yml](https://github.com/github/linguist/blob/master/lib/linguist/documentation.yml)
261
262There now is automation for detecting the changes in the upstream Linguist project: every day Github CI runs [a job](.github/workflows/sync-linguist.yml) that will create a PR to this repo for each new Linguist release. It will include all the steps from the above.
263
264When submitting a pull request syncing up to a new release manually, please make sure it only contains the changes in
265the generated files (in [data](https://github.com/go-enry/go-enry/blob/master/data) subdirectory).
266
267Separating all the necessary "manual" code changes to a different PR that includes some background description and an update to the documentation on ["divergences from linguist"](#divergences-from-linguist) is encouraged and very much appreciated, as it simplifies the maintenance (review/release notes/etc).
268
269## Misc
270
271<details>
272  <summary>Running a benchmark & faster regexp engine</summary>
273
274### Benchmark
275
276All benchmark scripts are in [_benchmarks_](https://github.com/go-enry/go-enry/blob/master/benchmarks) directory.
277
278#### Dependencies
279
280As benchmarks depend on Ruby and GitHub-Linguist gem make sure you have:
281
282- Ruby (e.g using [`rbenv`](https://github.com/rbenv/rbenv)), [`bundler`](https://bundler.io/) installed
283- Docker
284- [native dependencies](https://github.com/github/linguist/#dependencies) installed
285- Build the gem `cd .linguist && bundle install && rake build_gem && cd -`
286- Install it `gem install --no-rdoc --no-ri --local .linguist/github-linguist-*.gem`
287
288#### Quick benchmark
289
290To run quicker benchmarks
291
292    make benchmarks
293
294to get average times for the primary detection function and strategies for the whole samples set. If you want to see measures per sample file use:
295
296    make benchmarks-samples
297
298#### Full benchmark
299
300If you want to reproduce the same benchmarks as reported above:
301
302- Make sure all [dependencies](#benchmark-dependencies) are installed
303- Install [gnuplot](http://gnuplot.info) (in order to plot the histogram)
304- Run `ENRY_TEST_REPO="$PWD/.linguist" benchmarks/run.sh` (takes ~15h)
305
306It will run the benchmarks for enry and Linguist, parse the output, create csv files and plot the histogram.
307
308### Faster regexp engine (optional)
309
310[Oniguruma](https://github.com/kkos/oniguruma) is CRuby's regular expression engine.
311It is very fast and performs better than the one built into Go runtime. _enry_ supports swapping
312between those two engines thanks to [rubex](https://github.com/moovweb/rubex) project.
313The typical overall speedup from using Oniguruma is 1.5-2x. However, it requires CGo and the external shared library.
314On macOS with [Homebrew](https://brew.sh/), it is:
315
316```
317brew install oniguruma
318```
319
320On Ubuntu, it is
321
322```
323sudo apt install libonig-dev
324```
325
326To build enry with Oniguruma regexps use the `oniguruma` build tag
327
328```
329go get -v -t --tags oniguruma ./...
330```
331
332and then rebuild the project.
333
334</details>
335
336## License
337
338Apache License, Version 2.0. See [LICENSE](LICENSE)