Go Report Card was initially developed during Gopher Gala 2015. It is free, open source and run by volunteers. If you feel like there is something that could be improved, we encourage you to open an issue or contribute on GitHub!
6 |The Go gopher on the home page was designed by Renée French.
9 |Go Report Card relies on the excellent Go Meta Linter tool.
10 |go vet
examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.`
27 | }
28 |
--------------------------------------------------------------------------------
/check/gofmt.go:
--------------------------------------------------------------------------------
1 | package check
2 |
3 | // GoFmt is the check for the go fmt command
4 | type GoFmt struct {
5 | Dir string
6 | Filenames []string
7 | }
8 |
9 | // Name returns the name of the display name of the command
10 | func (g GoFmt) Name() string {
11 | return "gofmt"
12 | }
13 |
14 | // Weight returns the weight this check has in the overall average
15 | func (g GoFmt) Weight() float64 {
16 | return .30
17 | }
18 |
19 | // Percentage returns the percentage of .go files that pass gofmt
20 | func (g GoFmt) Percentage() (float64, []FileSummary, error) {
21 | return GoTool(g.Dir, g.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=gofmt"})
22 | // return GoFmtNative(g.Dir, g.Filenames)
23 | }
24 |
25 | // Description returns the description of gofmt
26 | func (g GoFmt) Description() string {
27 | return `Gofmt formats Go programs. We run gofmt -s
on your code, where -s
is for the "simplify" command`
28 | }
29 |
--------------------------------------------------------------------------------
/check/golint.go:
--------------------------------------------------------------------------------
1 | package check
2 |
3 | // GoLint is the check for the go lint command
4 | type GoLint struct {
5 | Dir string
6 | Filenames []string
7 | }
8 |
9 | // Name returns the name of the display name of the command
10 | func (g GoLint) Name() string {
11 | return "golint"
12 | }
13 |
14 | // Weight returns the weight this check has in the overall average
15 | func (g GoLint) Weight() float64 {
16 | return .10
17 | }
18 |
19 | // Percentage returns the percentage of .go files that pass golint
20 | func (g GoLint) Percentage() (float64, []FileSummary, error) {
21 | return GoTool(g.Dir, g.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=golint", "--min-confidence=0.85", "--vendor"})
22 | }
23 |
24 | // Description returns the description of go lint
25 | func (g GoLint) Description() string {
26 | return `Golint is a linter for Go source code.`
27 | }
28 |
--------------------------------------------------------------------------------
/check/grade.go:
--------------------------------------------------------------------------------
1 | package check
2 |
3 | // Grade represents a grade returned by the server, which is normally
4 | // somewhere between A+ (highest) and F (lowest).
5 | type Grade string
6 |
7 | // The Grade constants below indicate the current available
8 | // grades.
9 | const (
10 | GradeAPlus = "A+"
11 | GradeA = "A"
12 | GradeB = "B"
13 | GradeC = "C"
14 | GradeD = "D"
15 | GradeE = "E"
16 | GradeF = "F"
17 | )
18 |
19 | // GradeFromPercentage gets the Grade for a percentage
20 | func GradeFromPercentage(percentage float64) Grade {
21 | switch {
22 | case percentage > 90:
23 | return GradeAPlus
24 | case percentage > 80:
25 | return GradeA
26 | case percentage > 70:
27 | return GradeB
28 | case percentage > 60:
29 | return GradeC
30 | case percentage > 50:
31 | return GradeD
32 | case percentage > 40:
33 | return GradeE
34 | default:
35 | return GradeF
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/check/ineffassign.go:
--------------------------------------------------------------------------------
1 | package check
2 |
3 | // IneffAssign is the check for the ineffassign command
4 | type IneffAssign struct {
5 | Dir string
6 | Filenames []string
7 | }
8 |
9 | // Name returns the name of the display name of the command
10 | func (g IneffAssign) Name() string {
11 | return "ineffassign"
12 | }
13 |
14 | // Weight returns the weight this check has in the overall average
15 | func (g IneffAssign) Weight() float64 {
16 | return 0.10
17 | }
18 |
19 | // Percentage returns the percentage of .go files that pass gofmt
20 | func (g IneffAssign) Percentage() (float64, []FileSummary, error) {
21 | return GoTool(g.Dir, g.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=ineffassign"})
22 | }
23 |
24 | // Description returns the description of IneffAssign
25 | func (g IneffAssign) Description() string {
26 | return `IneffAssign detects ineffectual assignments in Go code.`
27 | }
28 |
--------------------------------------------------------------------------------
/check/license_test.go:
--------------------------------------------------------------------------------
1 | package check
2 |
3 | import "testing"
4 |
5 | func TestPercentage(t *testing.T) {
6 | g := License{"testdata/testfiles", []string{}}
7 | p, _, err := g.Percentage()
8 | if err != nil {
9 | t.Fatal(err)
10 | }
11 | if p != 1.0 {
12 | t.Errorf("License check failed")
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/check/misspell.go:
--------------------------------------------------------------------------------
1 | package check
2 |
3 | // Misspell is the check for the misspell command
4 | type Misspell struct {
5 | Dir string
6 | Filenames []string
7 | }
8 |
9 | // Name returns the name of the display name of the command
10 | func (g Misspell) Name() string {
11 | return "misspell"
12 | }
13 |
14 | // Weight returns the weight this check has in the overall average
15 | func (g Misspell) Weight() float64 {
16 | return 0.0
17 | }
18 |
19 | // Percentage returns the percentage of .go files that pass gofmt
20 | func (g Misspell) Percentage() (float64, []FileSummary, error) {
21 | return GoTool(g.Dir, g.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=misspell"})
22 | }
23 |
24 | // Description returns the description of Misspell
25 | func (g Misspell) Description() string {
26 | return `Misspell Finds commonly misspelled English words`
27 | }
28 |
--------------------------------------------------------------------------------
/check/staticcheck.go:
--------------------------------------------------------------------------------
1 | package check
2 |
3 | // Staticcheck is the check for the staticcheck command
4 | type Staticcheck struct {
5 | Dir string
6 | Filenames []string
7 | }
8 |
9 | // Name returns the name of the display name of the command
10 | func (g Staticcheck) Name() string {
11 | return "staticcheck"
12 | }
13 |
14 | // Weight returns the weight this check has in the overall average
15 | func (g Staticcheck) Weight() float64 {
16 | return 0.15
17 | }
18 |
19 | // Percentage returns the percentage of .go files that pass
20 | func (g Staticcheck) Percentage() (float64, []FileSummary, error) {
21 | return GoTool(g.Dir, g.Filenames, []string{"gometalinter", "--deadline=180s", "--disable-all", "--enable=staticcheck"})
22 | }
23 |
24 | // Description returns the description of Staticcheck
25 | func (g Staticcheck) Description() string {
26 | return `Staticcheck finds bugs, performance issues, and more`
27 | }
28 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/Godeps/a.go:
--------------------------------------------------------------------------------
1 | package godeps
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/Godeps/b.go:
--------------------------------------------------------------------------------
1 | package godeps
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/Godeps/c.go:
--------------------------------------------------------------------------------
1 | package godeps
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/LICENCE.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gojp/goreportcard/1060522058ebc739b0be81eb6c1f773ffaa7eb1c/check/testdata/testfiles/LICENCE.txt
--------------------------------------------------------------------------------
/check/testdata/testfiles/a.go:
--------------------------------------------------------------------------------
1 | package testfiles
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/a.pb.go:
--------------------------------------------------------------------------------
1 | package testfiles
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/a.pb.gw.go:
--------------------------------------------------------------------------------
1 | package testfiles
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/b.go:
--------------------------------------------------------------------------------
1 | package testfiles
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/c.go:
--------------------------------------------------------------------------------
1 | package testfiles
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/d.go:
--------------------------------------------------------------------------------
1 | package testfiles
2 |
3 | import (
4 | "fmt"
5 | "time"
6 | )
7 |
8 | func foo() {
9 | a := time.Now()
10 | b := a.Sub(time.Now())
11 | fmt.Println(a, b)
12 | }
13 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/testdata/a.go:
--------------------------------------------------------------------------------
1 | package testdata
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/third_party/a.go:
--------------------------------------------------------------------------------
1 | package thirdparty
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/third_party/b.go:
--------------------------------------------------------------------------------
1 | package thirdparty
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/third_party/c.go:
--------------------------------------------------------------------------------
1 | package thirdparty
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/vendor/a.go:
--------------------------------------------------------------------------------
1 | package vendor
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/vendor/b.go:
--------------------------------------------------------------------------------
1 | package vendor
2 |
--------------------------------------------------------------------------------
/check/testdata/testfiles/vendor/c.go:
--------------------------------------------------------------------------------
1 | package vendor
2 |
--------------------------------------------------------------------------------
/check/testdata/testrepo@v0.1.0/a.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import "fmt"
4 |
5 | func main() {
6 | // obivous typo
7 | fmt.Println("invalid %s")
8 | }
9 |
--------------------------------------------------------------------------------
/download/download.go:
--------------------------------------------------------------------------------
1 | package download
2 |
3 | import (
4 | "strings"
5 | )
6 |
7 | // Clean trims any URL parts, like the scheme or username, that might be present
8 | // in a user-submitted URL
9 | func Clean(path string) string {
10 | return trimUsername(trimScheme(path))
11 | }
12 |
13 | // trimScheme removes a scheme (e.g. https://) from the URL for more
14 | // convenient pasting from browsers.
15 | func trimScheme(repo string) string {
16 | schemeSep := "://"
17 | schemeSepIdx := strings.Index(repo, schemeSep)
18 | if schemeSepIdx > -1 {
19 | return repo[schemeSepIdx+len(schemeSep):]
20 | }
21 |
22 | return repo
23 | }
24 |
25 | // trimUsername removes the username for a URL, if it is present
26 | func trimUsername(repo string) string {
27 | usernameSep := "@"
28 | usernameSepIdx := strings.Index(repo, usernameSep)
29 | if usernameSepIdx > -1 {
30 | return repo[usernameSepIdx+len(usernameSep):]
31 | }
32 |
33 | return repo
34 | }
35 |
--------------------------------------------------------------------------------
/download/download_test.go:
--------------------------------------------------------------------------------
1 | package download
2 |
3 | import "testing"
4 |
5 | func TestClean(t *testing.T) {
6 | cases := []struct {
7 | path string
8 | want string
9 | }{
10 | {"github.com/foo/bar", "github.com/foo/bar"},
11 | {"https://github.com/foo/bar", "github.com/foo/bar"},
12 | {"https://user@github.com/foo/bar", "github.com/foo/bar"},
13 | {"github.com/foo/bar/v2", "github.com/foo/bar/v2"},
14 | {"https://github.com/foo/bar/v2", "github.com/foo/bar/v2"},
15 | {"https://user@github.com/foo/bar/v2", "github.com/foo/bar/v2"},
16 | }
17 |
18 | for _, tt := range cases {
19 | got := Clean(tt.path)
20 |
21 | if got != tt.want {
22 | t.Errorf("Clean(%q) = %q, want %q", tt.path, got, tt.want)
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/handlers/about.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | import (
4 | "log"
5 | "net/http"
6 | )
7 |
8 | // AboutHandler handles the about page
9 | func (gh *GRCHandler) AboutHandler(w http.ResponseWriter, r *http.Request) {
10 | t, err := gh.loadTemplate("templates/about.html")
11 | if err != nil {
12 | log.Println("ERROR: could not get about template: ", err)
13 | http.Error(w, err.Error(), 500)
14 | return
15 | }
16 |
17 | if err := t.ExecuteTemplate(w, "base", map[string]interface{}{
18 | "google_analytics_key": googleAnalyticsKey,
19 | }); err != nil {
20 | log.Println("ERROR:", err)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/handlers/checks_test.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | import "testing"
4 |
5 | var dirNameTests = []struct {
6 | url string
7 | ver string
8 | want string
9 | }{
10 | {"github.com/foo/bar", "v0.1.0", "_repos/src/github.com/foo/bar@v0.1.0"},
11 | }
12 |
13 | func TestDirName(t *testing.T) {
14 | for _, tt := range dirNameTests {
15 | if got := dirName(tt.url, tt.ver); got != tt.want {
16 | t.Errorf("dirName(%q, %q) = %q, want %q", tt.url, tt.ver, got, tt.want)
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/handlers/error.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | import (
4 | "log"
5 | "net/http"
6 | )
7 |
8 | func (gh *GRCHandler) errorHandler(w http.ResponseWriter, r *http.Request, status int) {
9 | w.WriteHeader(status)
10 | if status == http.StatusNotFound {
11 | t, err := gh.loadTemplate("/templates/404.html")
12 | if err != nil {
13 | log.Println("ERROR: could not get 404 template: ", err)
14 | http.Error(w, err.Error(), 500)
15 | return
16 | }
17 |
18 | if err := t.ExecuteTemplate(w, "base", nil); err != nil {
19 | log.Println("ERROR:", err)
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/handlers/grc.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | import "net/http"
4 |
5 | // GRCHandler contains fields shared among the different handlers
6 | type GRCHandler struct {
7 | AssetsFS http.FileSystem
8 | }
9 |
--------------------------------------------------------------------------------
/handlers/score_heap.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | type scoreItem struct {
4 | Repo string `json:"repo"`
5 | Score float64 `json:"score"`
6 | Files int `json:"files"`
7 | }
8 |
9 | // An ScoreHeap is a min-heap of ints.
10 | type ScoreHeap []scoreItem
11 |
12 | func (h ScoreHeap) Len() int { return len(h) }
13 | func (h ScoreHeap) Less(i, j int) bool { return h[i].Score < h[j].Score }
14 | func (h ScoreHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }
15 |
16 | // Push onto the heap
17 | func (h *ScoreHeap) Push(x interface{}) {
18 | // Push and Pop use pointer receivers because they modify the slice's length,
19 | // not just its contents.
20 | *h = append(*h, x.(scoreItem))
21 | }
22 |
23 | // Pop item off of the heap
24 | func (h *ScoreHeap) Pop() interface{} {
25 | old := *h
26 | n := len(old)
27 | x := old[n-1]
28 | *h = old[0 : n-1]
29 | return x
30 | }
31 |
--------------------------------------------------------------------------------
/handlers/supporters.go:
--------------------------------------------------------------------------------
1 | package handlers
2 |
3 | import (
4 | "log"
5 | "net/http"
6 | )
7 |
8 | // SupportersHandler handles the supporters page
9 | func (gh *GRCHandler) SupportersHandler(w http.ResponseWriter, r *http.Request) {
10 | t, err := gh.loadTemplate("/templates/supporters.html")
11 | if err != nil {
12 | log.Println("ERROR: could not get supporters template: ", err)
13 | http.Error(w, err.Error(), 500)
14 | return
15 | }
16 |
17 | if err := t.ExecuteTemplate(w, "base", map[string]interface{}{
18 | "google_analytics_key": googleAnalyticsKey,
19 | }); err != nil {
20 | log.Println("ERROR:", err)
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/scripts/gofmt.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | need_gofmt=$(gofmt -s -l `find . -name '*.go' | grep -v vendor | grep -v _repos | grep -v testrepo`)
4 |
5 | if [[ -n ${need_gofmt} ]]; then
6 | echo "These files fail gofmt -s:"
7 | echo "${need_gofmt}"
8 | exit 1
9 | fi
10 |
11 |
12 |
--------------------------------------------------------------------------------
/scripts/make-install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | go install ./vendor/github.com/alecthomas/gometalinter
4 |
5 | go install ./vendor/golang.org/x/lint/golint
6 | go install ./vendor/github.com/fzipp/gocyclo/cmd/gocyclo
7 | go install ./vendor/github.com/gordonklaus/ineffassign
8 | go install ./vendor/github.com/client9/misspell/cmd/misspell
9 |
--------------------------------------------------------------------------------
/tools/tools.go:
--------------------------------------------------------------------------------
1 | //go:build tools
2 | // +build tools
3 |
4 | package tools
5 |
6 | import (
7 | _ "github.com/alecthomas/gometalinter"
8 | _ "github.com/client9/misspell/cmd/misspell"
9 | _ "github.com/fzipp/gocyclo/cmd/gocyclo"
10 | _ "github.com/gordonklaus/ineffassign"
11 | _ "golang.org/x/lint/golint"
12 | _ "honnef.co/go/tools/cmd/staticcheck"
13 | )
14 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/.gitignore:
--------------------------------------------------------------------------------
1 | TAGS
2 | tags
3 | .*.swp
4 | tomlcheck/tomlcheck
5 | toml.test
6 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 | go:
3 | - 1.1
4 | - 1.2
5 | - 1.3
6 | - 1.4
7 | - 1.5
8 | - 1.6
9 | - tip
10 | install:
11 | - go install ./...
12 | - go get github.com/BurntSushi/toml-test
13 | script:
14 | - export PATH="$PATH:$HOME/gopath/bin"
15 | - make test
16 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/COMPATIBLE:
--------------------------------------------------------------------------------
1 | Compatible with TOML version
2 | [v0.4.0](https://github.com/toml-lang/toml/blob/v0.4.0/versions/en/toml-v0.4.0.md)
3 |
4 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/Makefile:
--------------------------------------------------------------------------------
1 | install:
2 | go install ./...
3 |
4 | test: install
5 | go test -v
6 | toml-test toml-test-decoder
7 | toml-test -encoder toml-test-encoder
8 |
9 | fmt:
10 | gofmt -w *.go */*.go
11 | colcheck *.go */*.go
12 |
13 | tags:
14 | find ./ -name '*.go' -print0 | xargs -0 gotags > TAGS
15 |
16 | push:
17 | git push origin master
18 | git push github master
19 |
20 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/encoding_types.go:
--------------------------------------------------------------------------------
1 | // +build go1.2
2 |
3 | package toml
4 |
5 | // In order to support Go 1.1, we define our own TextMarshaler and
6 | // TextUnmarshaler types. For Go 1.2+, we just alias them with the
7 | // standard library interfaces.
8 |
9 | import (
10 | "encoding"
11 | )
12 |
13 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
14 | // so that Go 1.1 can be supported.
15 | type TextMarshaler encoding.TextMarshaler
16 |
17 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
18 | // here so that Go 1.1 can be supported.
19 | type TextUnmarshaler encoding.TextUnmarshaler
20 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/encoding_types_1.1.go:
--------------------------------------------------------------------------------
1 | // +build !go1.2
2 |
3 | package toml
4 |
5 | // These interfaces were introduced in Go 1.2, so we add them manually when
6 | // compiling for Go 1.1.
7 |
8 | // TextMarshaler is a synonym for encoding.TextMarshaler. It is defined here
9 | // so that Go 1.1 can be supported.
10 | type TextMarshaler interface {
11 | MarshalText() (text []byte, err error)
12 | }
13 |
14 | // TextUnmarshaler is a synonym for encoding.TextUnmarshaler. It is defined
15 | // here so that Go 1.1 can be supported.
16 | type TextUnmarshaler interface {
17 | UnmarshalText(text []byte) error
18 | }
19 |
--------------------------------------------------------------------------------
/vendor/github.com/BurntSushi/toml/session.vim:
--------------------------------------------------------------------------------
1 | au BufWritePost *.go silent!make tags > /dev/null 2>&1
2 |
--------------------------------------------------------------------------------
/vendor/github.com/DataDog/zstd/debug.c:
--------------------------------------------------------------------------------
1 | /* ******************************************************************
2 | * debug
3 | * Part of FSE library
4 | * Copyright (c) 2013-2020, Yann Collet, Facebook, Inc.
5 | *
6 | * You can contact the author at :
7 | * - Source repository : https://github.com/Cyan4973/FiniteStateEntropy
8 | *
9 | * This source code is licensed under both the BSD-style license (found in the
10 | * LICENSE file in the root directory of this source tree) and the GPLv2 (found
11 | * in the COPYING file in the root directory of this source tree).
12 | * You may select, at your option, one of the above-listed licenses.
13 | ****************************************************************** */
14 |
15 |
16 | /*
17 | * This module only hosts one global variable
18 | * which can be used to dynamically influence the verbosity of traces,
19 | * such as DEBUGLOG and RAWLOG
20 | */
21 |
22 | #include "debug.h"
23 |
24 | int g_debuglevel = DEBUGLEVEL;
25 |
--------------------------------------------------------------------------------
/vendor/github.com/DataDog/zstd/errors.go:
--------------------------------------------------------------------------------
1 | package zstd
2 |
3 | /*
4 | #define ZSTD_STATIC_LINKING_ONLY
5 | #include "zstd.h"
6 | */
7 | import "C"
8 |
9 | // ErrorCode is an error returned by the zstd library.
10 | type ErrorCode int
11 |
12 | // Error returns the error string given by zstd
13 | func (e ErrorCode) Error() string {
14 | return C.GoString(C.ZSTD_getErrorName(C.size_t(e)))
15 | }
16 |
17 | func cIsError(code int) bool {
18 | return int(C.ZSTD_isError(C.size_t(code))) != 0
19 | }
20 |
21 | // getError returns an error for the return code, or nil if it's not an error
22 | func getError(code int) error {
23 | if code < 0 && cIsError(code) {
24 | return ErrorCode(code)
25 | }
26 | return nil
27 | }
28 |
29 | // IsDstSizeTooSmallError returns whether the error correspond to zstd standard sDstSizeTooSmall error
30 | func IsDstSizeTooSmallError(e error) bool {
31 | if e != nil && e.Error() == "Destination buffer is too small" {
32 | return true
33 | }
34 | return false
35 | }
36 |
--------------------------------------------------------------------------------
/vendor/github.com/DataDog/zstd/travis_test_32.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # Get utilities
3 | #yum -y -q -e 0 install wget tar unzip gcc
4 | apt-get update
5 | apt-get -y install wget tar unzip gcc
6 |
7 | # Get Go
8 | wget -q https://dl.google.com/go/go1.13.linux-386.tar.gz
9 | tar -C /usr/local -xzf go1.13.linux-386.tar.gz
10 | export PATH=$PATH:/usr/local/go/bin
11 |
12 | # Get payload
13 | wget -q https://github.com/DataDog/zstd/files/2246767/mr.zip
14 | unzip mr.zip
15 |
16 | # Build and run tests
17 | go build
18 | DISABLE_BIG_TESTS=1 PAYLOAD=$(pwd)/mr go test -v
19 | DISABLE_BIG_TESTS=1 PAYLOAD=$(pwd)/mr go test -bench .
20 |
--------------------------------------------------------------------------------
/vendor/github.com/DataDog/zstd/zbuff_common.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-2020, Yann Collet, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under both the BSD-style license (found in the
6 | * LICENSE file in the root directory of this source tree) and the GPLv2 (found
7 | * in the COPYING file in the root directory of this source tree).
8 | * You may select, at your option, one of the above-listed licenses.
9 | */
10 |
11 | /*-*************************************
12 | * Dependencies
13 | ***************************************/
14 | #include "error_private.h"
15 | #include "zbuff.h"
16 |
17 | /*-****************************************
18 | * ZBUFF Error Management (deprecated)
19 | ******************************************/
20 |
21 | /*! ZBUFF_isError() :
22 | * tells if a return value is an error code */
23 | unsigned ZBUFF_isError(size_t errorCode) { return ERR_isError(errorCode); }
24 | /*! ZBUFF_getErrorName() :
25 | * provides error code string from function result (useful for debugging) */
26 | const char* ZBUFF_getErrorName(size_t errorCode) { return ERR_getErrorName(errorCode); }
27 |
--------------------------------------------------------------------------------
/vendor/github.com/alecthomas/gometalinter/.gitignore:
--------------------------------------------------------------------------------
1 | vendor/bin
2 | vendor/pkg
3 |
--------------------------------------------------------------------------------
/vendor/github.com/alecthomas/gometalinter/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | language: go
3 | install:
4 | - go get -t -v . ./regressiontests
5 | - gometalinter --install
6 | go: 1.7
7 | script: go test -v . ./regressiontests
8 |
--------------------------------------------------------------------------------
/vendor/github.com/alecthomas/template/README.md:
--------------------------------------------------------------------------------
1 | # Go's `text/template` package with newline elision
2 |
3 | This is a fork of Go 1.4's [text/template](http://golang.org/pkg/text/template/) package with one addition: a backslash immediately after a closing delimiter will delete all subsequent newlines until a non-newline.
4 |
5 | eg.
6 |
7 | ```
8 | {{if true}}\
9 | hello
10 | {{end}}\
11 | ```
12 |
13 | Will result in:
14 |
15 | ```
16 | hello\n
17 | ```
18 |
19 | Rather than:
20 |
21 | ```
22 | \n
23 | hello\n
24 | \n
25 | ```
26 |
--------------------------------------------------------------------------------
/vendor/github.com/alecthomas/units/COPYING:
--------------------------------------------------------------------------------
1 | Copyright (C) 2014 Alec Thomas
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 | of the Software, and to permit persons to whom the Software is furnished to do
8 | so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in all
11 | 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 THE
19 | SOFTWARE.
20 |
--------------------------------------------------------------------------------
/vendor/github.com/alecthomas/units/README.md:
--------------------------------------------------------------------------------
1 | # Units - Helpful unit multipliers and functions for Go
2 |
3 | The goal of this package is to have functionality similar to the [time](http://golang.org/pkg/time/) package.
4 |
5 | It allows for code like this:
6 |
7 | ```go
8 | n, err := ParseBase2Bytes("1KB")
9 | // n == 1024
10 | n = units.Mebibyte * 512
11 | ```
12 |
--------------------------------------------------------------------------------
/vendor/github.com/alecthomas/units/doc.go:
--------------------------------------------------------------------------------
1 | // Package units provides helpful unit multipliers and functions for Go.
2 | //
3 | // The goal of this package is to have functionality similar to the time [1] package.
4 | //
5 | //
6 | // [1] http://golang.org/pkg/time/
7 | //
8 | // It allows for code like this:
9 | //
10 | // n, err := ParseBase2Bytes("1KB")
11 | // // n == 1024
12 | // n = units.Mebibyte * 512
13 | package units
14 |
--------------------------------------------------------------------------------
/vendor/github.com/cespare/xxhash/rotate.go:
--------------------------------------------------------------------------------
1 | // +build !go1.9
2 |
3 | package xxhash
4 |
5 | // TODO(caleb): After Go 1.10 comes out, remove this fallback code.
6 |
7 | func rol1(x uint64) uint64 { return (x << 1) | (x >> (64 - 1)) }
8 | func rol7(x uint64) uint64 { return (x << 7) | (x >> (64 - 7)) }
9 | func rol11(x uint64) uint64 { return (x << 11) | (x >> (64 - 11)) }
10 | func rol12(x uint64) uint64 { return (x << 12) | (x >> (64 - 12)) }
11 | func rol18(x uint64) uint64 { return (x << 18) | (x >> (64 - 18)) }
12 | func rol23(x uint64) uint64 { return (x << 23) | (x >> (64 - 23)) }
13 | func rol27(x uint64) uint64 { return (x << 27) | (x >> (64 - 27)) }
14 | func rol31(x uint64) uint64 { return (x << 31) | (x >> (64 - 31)) }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/cespare/xxhash/rotate19.go:
--------------------------------------------------------------------------------
1 | // +build go1.9
2 |
3 | package xxhash
4 |
5 | import "math/bits"
6 |
7 | func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) }
8 | func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) }
9 | func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }
10 | func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }
11 | func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }
12 | func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }
13 | func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }
14 | func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }
15 |
--------------------------------------------------------------------------------
/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go:
--------------------------------------------------------------------------------
1 | // +build !appengine
2 | // +build gc
3 | // +build !purego
4 |
5 | package xxhash
6 |
7 | // Sum64 computes the 64-bit xxHash digest of b.
8 | //
9 | //go:noescape
10 | func Sum64(b []byte) uint64
11 |
12 | //go:noescape
13 | func writeBlocks(d *Digest, b []byte) int
14 |
--------------------------------------------------------------------------------
/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go:
--------------------------------------------------------------------------------
1 | // +build appengine
2 |
3 | // This file contains the safe implementations of otherwise unsafe-using code.
4 |
5 | package xxhash
6 |
7 | // Sum64String computes the 64-bit xxHash digest of s.
8 | func Sum64String(s string) uint64 {
9 | return Sum64([]byte(s))
10 | }
11 |
12 | // WriteString adds more data to d. It always returns len(s), nil.
13 | func (d *Digest) WriteString(s string) (n int, err error) {
14 | return d.Write([]byte(s))
15 | }
16 |
--------------------------------------------------------------------------------
/vendor/github.com/cespare/xxhash/xxhash_amd64.go:
--------------------------------------------------------------------------------
1 | // +build !appengine
2 | // +build gc
3 | // +build !purego
4 |
5 | package xxhash
6 |
7 | // Sum64 computes the 64-bit xxHash digest of b.
8 | //
9 | //go:noescape
10 | func Sum64(b []byte) uint64
11 |
12 | func writeBlocks(x *xxh, b []byte) []byte
13 |
--------------------------------------------------------------------------------
/vendor/github.com/cespare/xxhash/xxhash_safe.go:
--------------------------------------------------------------------------------
1 | // +build appengine
2 |
3 | // This file contains the safe implementations of otherwise unsafe-using code.
4 |
5 | package xxhash
6 |
7 | // Sum64String computes the 64-bit xxHash digest of s.
8 | func Sum64String(s string) uint64 {
9 | return Sum64([]byte(s))
10 | }
11 |
--------------------------------------------------------------------------------
/vendor/github.com/cespare/xxhash/xxhash_unsafe.go:
--------------------------------------------------------------------------------
1 | // +build !appengine
2 |
3 | // This file encapsulates usage of unsafe.
4 | // xxhash_safe.go contains the safe implementations.
5 |
6 | package xxhash
7 |
8 | import (
9 | "reflect"
10 | "unsafe"
11 | )
12 |
13 | // Sum64String computes the 64-bit xxHash digest of s.
14 | // It may be faster than Sum64([]byte(s)) by avoiding a copy.
15 | //
16 | // TODO(caleb): Consider removing this if an optimization is ever added to make
17 | // it unnecessary: https://golang.org/issue/2205.
18 | //
19 | // TODO(caleb): We still have a function call; we could instead write Go/asm
20 | // copies of Sum64 for strings to squeeze out a bit more speed.
21 | func Sum64String(s string) uint64 {
22 | // See https://groups.google.com/d/msg/golang-nuts/dcjzJy-bSpw/tcZYBzQqAQAJ
23 | // for some discussion about this unsafe conversion.
24 | var b []byte
25 | bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
26 | bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data
27 | bh.Len = len(s)
28 | bh.Cap = len(s)
29 | return Sum64(b)
30 | }
31 |
--------------------------------------------------------------------------------
/vendor/github.com/client9/misspell/.gitignore:
--------------------------------------------------------------------------------
1 | dist/
2 | bin/
3 | vendor/
4 |
5 | # editor turds
6 | *~
7 | *.gz
8 | *.bz2
9 | *.csv
10 |
11 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
12 | *.o
13 | *.a
14 | *.so
15 |
16 | # Folders
17 | _obj
18 | _test
19 |
20 | # Architecture specific extensions/prefixes
21 | *.[568vq]
22 | [568vq].out
23 |
24 | *.cgo1.go
25 | *.cgo2.c
26 | _cgo_defun.c
27 | _cgo_gotypes.go
28 | _cgo_export.*
29 |
30 | _testmain.go
31 |
32 | *.exe
33 | *.test
34 | *.prof
35 |
--------------------------------------------------------------------------------
/vendor/github.com/client9/misspell/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 | dist: trusty
3 | group: edge
4 | language: go
5 | go:
6 | - "1.10"
7 | git:
8 | depth: 1
9 |
10 | script:
11 | - ./scripts/travis.sh
12 |
13 | # calls goreleaser when a new tag is pushed
14 | deploy:
15 | - provider: script
16 | skip_cleanup: true
17 | script: curl -sL http://git.io/goreleaser | bash
18 | on:
19 | tags: true
20 | condition: $TRAVIS_OS_NAME = linux
21 |
--------------------------------------------------------------------------------
/vendor/github.com/client9/misspell/Gopkg.lock:
--------------------------------------------------------------------------------
1 | # This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
2 |
3 |
4 | [[projects]]
5 | name = "github.com/gobwas/glob"
6 | packages = [
7 | ".",
8 | "compiler",
9 | "match",
10 | "syntax",
11 | "syntax/ast",
12 | "syntax/lexer",
13 | "util/runes",
14 | "util/strings"
15 | ]
16 | revision = "5ccd90ef52e1e632236f7326478d4faa74f99438"
17 | version = "v0.2.3"
18 |
19 | [solve-meta]
20 | analyzer-name = "dep"
21 | analyzer-version = 1
22 | inputs-digest = "087ea4c49358ea8258ad9edfe514cd5ce9975c889c258e5ec7b5d2b720aae113"
23 | solver-name = "gps-cdcl"
24 | solver-version = 1
25 |
--------------------------------------------------------------------------------
/vendor/github.com/client9/misspell/Gopkg.toml:
--------------------------------------------------------------------------------
1 | # Gopkg.toml example
2 | #
3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4 | # for detailed Gopkg.toml documentation.
5 | #
6 | # required = ["github.com/user/thing/cmd/thing"]
7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8 | #
9 | # [[constraint]]
10 | # name = "github.com/user/project"
11 | # version = "1.0.0"
12 | #
13 | # [[constraint]]
14 | # name = "github.com/user/project2"
15 | # branch = "dev"
16 | # source = "github.com/myfork/project2"
17 | #
18 | # [[override]]
19 | # name = "github.com/x/y"
20 | # version = "2.4.0"
21 | #
22 | # [prune]
23 | # non-go = false
24 | # go-tests = true
25 | # unused-packages = true
26 |
27 |
28 | [[constraint]]
29 | name = "github.com/gobwas/glob"
30 | version = "0.2.3"
31 |
32 | [prune]
33 | go-tests = true
34 | unused-packages = true
35 |
--------------------------------------------------------------------------------
/vendor/github.com/client9/misspell/RELEASE-HOWTO.md:
--------------------------------------------------------------------------------
1 | # Release HOWTO
2 |
3 | since I forget.
4 |
5 |
6 | 1. Review existing tags and pick new release number
7 |
8 | ```sh
9 | git tag
10 | ```
11 |
12 | 2. Tag locally
13 |
14 | ```sh
15 | git tag -a v0.1.0 -m "First release"
16 | ```
17 |
18 | If things get screwed up, delete the tag with
19 |
20 | ```sh
21 | git tag -d v0.1.0
22 | ```
23 |
24 | 3. Test goreleaser
25 |
26 | TODO: how to install goreleaser
27 |
28 | ```sh
29 | ./scripts/goreleaser-dryrun.sh
30 | ```
31 |
32 | 4. Push
33 |
34 | ```bash
35 | git push origin v0.1.0
36 | ```
37 |
38 | 5. Verify release and edit notes. See https://github.com/client9/misspell/releases
39 |
--------------------------------------------------------------------------------
/vendor/github.com/client9/misspell/goreleaser.yml:
--------------------------------------------------------------------------------
1 | # goreleaser.yml
2 | # https://github.com/goreleaser/goreleaser
3 |
4 | project_name: misspell
5 |
6 | builds:
7 | -
8 | main: cmd/misspell/main.go
9 | binary: misspell
10 | ldflags: -s -w -X main.version={{.Version}}
11 | goos:
12 | - darwin
13 | - linux
14 | - windows
15 | goarch:
16 | - amd64
17 | env:
18 | - CGO_ENABLED=0
19 | ignore:
20 | - goos: darwin
21 | goarch: 386
22 | - goos: windows
23 | goarch: 386
24 |
25 | archive:
26 | name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
27 | replacements:
28 | amd64: 64bit
29 | 386: 32bit
30 | darwin: mac
31 | files:
32 | - none*
33 |
34 | checksum:
35 | name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
36 |
37 | snapshot:
38 | name_template: "SNAPSHOT-{{.Commit}}"
39 |
--------------------------------------------------------------------------------
/vendor/github.com/client9/misspell/url.go:
--------------------------------------------------------------------------------
1 | package misspell
2 |
3 | import (
4 | "regexp"
5 | )
6 |
7 | // Regexp for URL https://mathiasbynens.be/demo/url-regex
8 | //
9 | // original @imme_emosol (54 chars) has trouble with dashes in hostname
10 | // @(https?|ftp)://(-\.)?([^\s/?\.#-]+\.?)+(/[^\s]*)?$@iS
11 | var reURL = regexp.MustCompile(`(?i)(https?|ftp)://(-\.)?([^\s/?\.#]+\.?)+(/[^\s]*)?`)
12 |
13 | // StripURL attemps to replace URLs with blank spaces, e.g.
14 | // "xxx http://foo.com/ yyy -> "xxx yyyy"
15 | func StripURL(s string) string {
16 | return reURL.ReplaceAllStringFunc(s, replaceWithBlanks)
17 | }
18 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/.deepsource.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 |
3 | test_patterns = [
4 | 'integration/testgc/**',
5 | '**/*_test.go'
6 | ]
7 |
8 | exclude_patterns = [
9 |
10 | ]
11 |
12 | [[analyzers]]
13 | name = 'go'
14 | enabled = true
15 |
16 |
17 | [analyzers.meta]
18 | import_path = 'github.com/dgraph-io/badger'
19 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/.gitignore:
--------------------------------------------------------------------------------
1 | p/
2 | badger-test*/
3 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/.golangci.yml:
--------------------------------------------------------------------------------
1 | run:
2 | tests: false
3 |
4 | linters-settings:
5 | lll:
6 | line-length: 100
7 |
8 | linters:
9 | disable-all: true
10 | enable:
11 | - errcheck
12 | - ineffassign
13 | - gas
14 | - gofmt
15 | - golint
16 | - gosimple
17 | - govet
18 | - lll
19 | - varcheck
20 | - unused
21 |
22 | issues:
23 | exclude-rules:
24 | - linters:
25 | - gosec
26 | text: "G404: "
27 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Code of Conduct
2 |
3 | Our Code of Conduct can be found here:
4 |
5 | https://dgraph.io/conduct
6 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/pb/gen.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # You might need to go get -v github.com/gogo/protobuf/...
4 |
5 | protos=${GOPATH-$HOME/go}/src/github.com/dgraph-io/badger/pb
6 | pushd $protos > /dev/null
7 | protoc --gofast_out=plugins=grpc:. -I=. pb.proto
8 |
9 | # Move pb.pb.go file to the correct directory. This is necessary because protoc
10 | # would generate the pb.pb.go file inside a different directory.
11 | mv $protos/github.com/dgraph-io/badger/v2/pb/pb.pb.go ./
12 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/y/event_log.go:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2019 Dgraph Labs, Inc. and Contributors
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package y
18 |
19 | import "golang.org/x/net/trace"
20 |
21 | var (
22 | NoEventLog trace.EventLog = nilEventLog{}
23 | )
24 |
25 | type nilEventLog struct{}
26 |
27 | func (nel nilEventLog) Printf(format string, a ...interface{}) {}
28 |
29 | func (nel nilEventLog) Errorf(format string, a ...interface{}) {}
30 |
31 | func (nel nilEventLog) Finish() {}
32 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/y/file_dsync.go:
--------------------------------------------------------------------------------
1 | // +build !dragonfly,!freebsd,!windows
2 |
3 | /*
4 | * Copyright 2017 Dgraph Labs, Inc. and Contributors
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package y
20 |
21 | import "golang.org/x/sys/unix"
22 |
23 | func init() {
24 | datasyncFileFlag = unix.O_DSYNC
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/badger/v2/y/file_nodsync.go:
--------------------------------------------------------------------------------
1 | // +build dragonfly freebsd windows
2 |
3 | /*
4 | * Copyright 2017 Dgraph Labs, Inc. and Contributors
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package y
20 |
21 | import "syscall"
22 |
23 | func init() {
24 | datasyncFileFlag = syscall.O_SYNC
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/ristretto/.deepsource.toml:
--------------------------------------------------------------------------------
1 | version = 1
2 |
3 | test_patterns = [
4 | '**/*_test.go'
5 | ]
6 |
7 | exclude_patterns = [
8 |
9 | ]
10 |
11 | [[analyzers]]
12 | name = 'go'
13 | enabled = true
14 |
15 |
16 | [analyzers.meta]
17 | import_path = 'github.com/dgraph-io/ristretto'
18 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/ristretto/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | go:
4 | - 1.12
5 | - 1.13
6 |
7 | env:
8 | - GO111MODULE=on # Enable go module for all versions.
9 |
10 | script:
11 | - go test -race ./...
12 |
--------------------------------------------------------------------------------
/vendor/github.com/dgraph-io/ristretto/z/rtutil.s:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gojp/goreportcard/1060522058ebc739b0be81eb6c1f773ffaa7eb1c/vendor/github.com/dgraph-io/ristretto/z/rtutil.s
--------------------------------------------------------------------------------
/vendor/github.com/dgryski/go-farm/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files, Static and Dynamic libs (Shared Objects)
2 | *.o
3 | *.a
4 | *.so
5 |
6 | # Folders
7 | _obj
8 | _test
9 |
10 | # Architecture specific extensions/prefixes
11 | *.[568vq]
12 | [568vq].out
13 |
14 | *.cgo1.go
15 | *.cgo2.c
16 | _cgo_defun.c
17 | _cgo_gotypes.go
18 | _cgo_export.*
19 |
20 | *.exe
21 | *.test
22 | *.prof
23 |
24 | target
25 |
--------------------------------------------------------------------------------
/vendor/github.com/dgryski/go-farm/.travis.yml:
--------------------------------------------------------------------------------
1 | language: go
2 |
3 | sudo: false
4 |
5 | branches:
6 | except:
7 | - release
8 |
9 | branches:
10 | only:
11 | - master
12 | - develop
13 | - travis
14 |
15 | go:
16 | - 1.12.x
17 | - 1.13.x
18 | - tip
19 |
20 | matrix:
21 | allow_failures:
22 | - go: tip
23 |
24 | before_install:
25 | - if [ -n "$GH_USER" ]; then git config --global github.user ${GH_USER}; fi;
26 | - if [ -n "$GH_TOKEN" ]; then git config --global github.token ${GH_TOKEN}; fi;
27 | - go get github.com/mattn/goveralls
28 |
29 | before_script:
30 | - make deps
31 |
32 | script:
33 | - make qa
34 |
35 | after_failure:
36 | - cat ./target/test/report.xml
37 |
38 | after_success:
39 | - if [ "$TRAVIS_GO_VERSION" = "1.9" ]; then $HOME/gopath/bin/goveralls -covermode=count -coverprofile=target/report/coverage.out -service=travis-ci; fi;
40 |
--------------------------------------------------------------------------------
/vendor/github.com/dgryski/go-farm/VERSION:
--------------------------------------------------------------------------------
1 | 2.0.1
2 |
--------------------------------------------------------------------------------
/vendor/github.com/dgryski/go-farm/basics.go:
--------------------------------------------------------------------------------
1 | package farm
2 |
3 | import "math/bits"
4 |
5 | // Some primes between 2^63 and 2^64 for various uses.
6 | const k0 uint64 = 0xc3a5c85c97cb3127
7 | const k1 uint64 = 0xb492b66fbe98f273
8 | const k2 uint64 = 0x9ae16a3b2f90404f
9 |
10 | // Magic numbers for 32-bit hashing. Copied from Murmur3.
11 | const c1 uint32 = 0xcc9e2d51
12 | const c2 uint32 = 0x1b873593
13 |
14 | // A 32-bit to 32-bit integer hash copied from Murmur3.
15 | func fmix(h uint32) uint32 {
16 | h ^= h >> 16
17 | h *= 0x85ebca6b
18 | h ^= h >> 13
19 | h *= 0xc2b2ae35
20 | h ^= h >> 16
21 | return h
22 | }
23 |
24 | func mur(a, h uint32) uint32 {
25 | // Helper from Murmur3 for combining two 32-bit values.
26 | a *= c1
27 | a = bits.RotateLeft32(a, -17)
28 | a *= c2
29 | h ^= a
30 | h = bits.RotateLeft32(h, -19)
31 | return h*5 + 0xe6546b64
32 | }
33 |
--------------------------------------------------------------------------------
/vendor/github.com/dgryski/go-farm/fp_generic.go:
--------------------------------------------------------------------------------
1 | // +build !amd64 purego
2 |
3 | package farm
4 |
5 | // Fingerprint64 is a 64-bit fingerprint function for byte-slices
6 | func Fingerprint64(s []byte) uint64 {
7 | return naHash64(s)
8 | }
9 |
10 | // Fingerprint32 is a 32-bit fingerprint function for byte-slices
11 | func Fingerprint32(s []byte) uint32 {
12 | return Hash32(s)
13 | }
14 |
--------------------------------------------------------------------------------
/vendor/github.com/dgryski/go-farm/fp_stub.go:
--------------------------------------------------------------------------------
1 | // Code generated by command: go run asm.go -out=fp_amd64.s -stubs=fp_stub.go. DO NOT EDIT.
2 |
3 | // +build amd64,!purego
4 |
5 | package farm
6 |
7 | func Fingerprint64(s []byte) uint64
8 |
9 | func Fingerprint32(s []byte) uint32
10 |
--------------------------------------------------------------------------------
/vendor/github.com/dustin/go-humanize/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: false
2 | language: go
3 | go_import_path: github.com/dustin/go-humanize
4 | go:
5 | - 1.13.x
6 | - 1.14.x
7 | - 1.15.x
8 | - 1.16.x
9 | - stable
10 | - master
11 | matrix:
12 | allow_failures:
13 | - go: master
14 | fast_finish: true
15 | install:
16 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step).
17 | script:
18 | - diff -u <(echo -n) <(gofmt -d -s .)
19 | - go vet .
20 | - go install -v -race ./...
21 | - go test -v -race ./...
22 |
--------------------------------------------------------------------------------
/vendor/github.com/dustin/go-humanize/big.go:
--------------------------------------------------------------------------------
1 | package humanize
2 |
3 | import (
4 | "math/big"
5 | )
6 |
7 | // order of magnitude (to a max order)
8 | func oomm(n, b *big.Int, maxmag int) (float64, int) {
9 | mag := 0
10 | m := &big.Int{}
11 | for n.Cmp(b) >= 0 {
12 | n.DivMod(n, b, m)
13 | mag++
14 | if mag == maxmag && maxmag >= 0 {
15 | break
16 | }
17 | }
18 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag
19 | }
20 |
21 | // total order of magnitude
22 | // (same as above, but with no upper limit)
23 | func oom(n, b *big.Int) (float64, int) {
24 | mag := 0
25 | m := &big.Int{}
26 | for n.Cmp(b) >= 0 {
27 | n.DivMod(n, b, m)
28 | mag++
29 | }
30 | return float64(n.Int64()) + (float64(m.Int64()) / float64(b.Int64())), mag
31 | }
32 |
--------------------------------------------------------------------------------
/vendor/github.com/dustin/go-humanize/commaf.go:
--------------------------------------------------------------------------------
1 | //go:build go1.6
2 | // +build go1.6
3 |
4 | package humanize
5 |
6 | import (
7 | "bytes"
8 | "math/big"
9 | "strings"
10 | )
11 |
12 | // BigCommaf produces a string form of the given big.Float in base 10
13 | // with commas after every three orders of magnitude.
14 | func BigCommaf(v *big.Float) string {
15 | buf := &bytes.Buffer{}
16 | if v.Sign() < 0 {
17 | buf.Write([]byte{'-'})
18 | v.Abs(v)
19 | }
20 |
21 | comma := []byte{','}
22 |
23 | parts := strings.Split(v.Text('f', -1), ".")
24 | pos := 0
25 | if len(parts[0])%3 != 0 {
26 | pos += len(parts[0]) % 3
27 | buf.WriteString(parts[0][:pos])
28 | buf.Write(comma)
29 | }
30 | for ; pos < len(parts[0]); pos += 3 {
31 | buf.WriteString(parts[0][pos : pos+3])
32 | buf.Write(comma)
33 | }
34 | buf.Truncate(buf.Len() - 1)
35 |
36 | if len(parts) > 1 {
37 | buf.Write([]byte{'.'})
38 | buf.WriteString(parts[1])
39 | }
40 | return buf.String()
41 | }
42 |
--------------------------------------------------------------------------------
/vendor/github.com/dustin/go-humanize/humanize.go:
--------------------------------------------------------------------------------
1 | /*
2 | Package humanize converts boring ugly numbers to human-friendly strings and back.
3 |
4 | Durations can be turned into strings such as "3 days ago", numbers
5 | representing sizes like 82854982 into useful strings like, "83 MB" or
6 | "79 MiB" (whichever you prefer).
7 | */
8 | package humanize
9 |
--------------------------------------------------------------------------------
/vendor/github.com/dustin/go-humanize/ordinals.go:
--------------------------------------------------------------------------------
1 | package humanize
2 |
3 | import "strconv"
4 |
5 | // Ordinal gives you the input number in a rank/ordinal format.
6 | //
7 | // Ordinal(3) -> 3rd
8 | func Ordinal(x int) string {
9 | suffix := "th"
10 | switch x % 10 {
11 | case 1:
12 | if x%100 != 11 {
13 | suffix = "st"
14 | }
15 | case 2:
16 | if x%100 != 12 {
17 | suffix = "nd"
18 | }
19 | case 3:
20 | if x%100 != 13 {
21 | suffix = "rd"
22 | }
23 | }
24 | return strconv.Itoa(x) + suffix
25 | }
26 |
--------------------------------------------------------------------------------
/vendor/github.com/fzipp/gocyclo/CONTRIBUTORS:
--------------------------------------------------------------------------------
1 | # Names should be added to this file like so:
2 | # Name