messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage events\n\nimport (\n\t\"encoding/json\"\n)\n\ntype (\n\t// UserEvent represents the user related segment of an Event within Ion Channel.\n\t// Action is the specific type of User Event that occurred,\n\t// Data is information relevant t... | go | edit | 0 | 0 | apache-2.0 | 325959b0e0775ce997ca1454b0057e6ebe853918 | ion-channel/ionic,ion-channel/ionic | events/user_events.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage retrystrategy\n\nimport (\n\t\"time\"\n\n\tboshlog \"github.com/cloudfoundry/bosh-utils/logger\"\n)\n\ntype attemptRetryStrategy struct {\n\tmaxAttempts int\n\tdelay time.Duration\n\tretryable Retryable\n\tlogger boshlog.Lo... | go | edit | 9 | 4 | apache-2.0 | 1a4f82e96cf7e29708a13c83023ff33a576cf45d | cloudfoundry/bosh-utils,cloudfoundry/bosh-utils | retrystrategy/attempt_retry_strategy.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"io/ioutil\"\n \"net/http\"\n \"encoding/json\"\n)\n\ntype JsonData struct {\n Name string `json:\"name\"`\n Struct struct {\n Integer int `json:\"integer\"`\n } `json:\"struce\"`\n}\n\nfunc main(... | go | edit | 0 | 2 | mit | 966b35e5088fa6e0bd3e4ada957c1f5412f56170 | rollbrettler/go-playground | _draft/simple-http.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/* This is a FLEXible file which can be used by both client and daemon.\n * Teehee.\n */\npackage lxd\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\nvar Version = \"0.0.1\"\n\n/*\n * Please increment the api compat number every t... | go | edit | 0 | 2 | apache-2.0 | 7877a39a708de1a0b40e8f98b5bcffd625c259ff | benaryorg/lxd,techtonik/lxd,stgraber/lxd,techtonik/lxd,Skarlso/lxd,chrisglass/lxd,basvanbeek/lxd,atxwebs/lxd,stgraber/lxd,rrva/lxd,Skarlso/lxd,hallyn/lxd,beni55/lxd,jumpstarter-io/lxd,tych0/lxd,achanda/lxd,jsavikko/lxd,pcdummy/lxd,pcdummy/lxd,basvanbeek/lxd,hallyn/lxd,hallyn/lxd,pcdummy/lxd,mjeanson/lxd,sl1pm4t/lxd,jen... | flex.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"compress/gzip\"\n \"io\"\n \"log\"\n \"os\"\n\n \"github.com/aws/aws-sdk-go/aws\"\n \"github.com/aws/aws-sdk-go/aws/session\"\n \"github.com/aws/aws-sdk-go/service/s3/s3manager\"\n)\n\nfunc main... | go | edit | 0 | 3 | mit | 8f65a61d67722c256cdcc8f0500aefa2b4e9fab6 | bjwbell/ironframe,bjwbell/ironframe,bjwbell/ironframe,bjwbell/ironframe,bjwbell/ironframe | nightlies/s3-upload.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage crypto\n\nimport (\n\t\"encoding/base64\"\n\t\"strings\"\n\n\t\"github.com/pborman/uuid\"\n)\n\n// SecureToken creates a new random token\nfunc SecureToken() string {\n\ttoken := uuid.NewRandom()\n\treturn removePadding(base64.URLEncodi... | go | edit | 0 | 2 | mit | a63777686e70587831cabca1e69a2670119553b9 | netlify/gotrue,netlify/gotrue | crypto/crypto.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package chalk lets you colour you\n// terminal string styles\npackage chalk\n\n// Black colours your string black\nfunc Black(s string) string {\n\treturn \"\\033[30m\" + s + \"\\033[0m\"\n}\n\n// Red colours your string red\nfunc Red(s stri... | go | edit | 0 | 1 | apache-2.0 | 0bb0ec93302744b468690b2eb5cf31d466375a68 | bentranter/chalk | chalk.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gedcom\n\n// Individual represents an individual record in a node structure with links to\n// other individuals.\ntype Individual struct {\n\tNode *Node\n\tFather *Individual\n\tMother *Individual\n}\n\n```\n\nApply this change: Add a... | go | edit | 3 | 2 | mit | d24073084723c8426da64d9bff3ac1c7b8034ecc | lukevers/gedcom | individual.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n// Build a standalone executable with 'go build go-calc'\n// Or just do a one time run test with 'go run go-calc 1 / 4'\n\nimport \"fmt\"\nimport \"os\" // For ARGV\nimport \"strconv\"\n\nfunc main() {\n\tvar arg_count int = len... | go | edit | 0 | 7 | mit | 3af62e460d8e9b09fb6afc479ca01045a9807f86 | scottieinor/simple-calc-langs,scottieinor/simple-calc-langs | Go/go-calc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage wol\n\n// WARNING: Auto generated version file. Do not edit this file by hand.\n// WARNING: go get github.com/sabhiram/gover to manage this file.\n// Version: 1.0.4\n\nconst (\n Major = 1\n Minor = 0\n Patch = 4\n\n Version ... | go | edit | 0 | 0 | mit | 55f66b1c0ccd2d6f4e0feec45e7a6c661f78f142 | sabhiram/go-wol,sabhiram/go-wol | version_gen.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fileserver\n\n// FileServer serves web resources from files.\ntype FileServer struct {\n\t// ContentRoot is the folder containing the content\n\tContentRoot string\n\tGetters []Getter\n}\n\n// NewFileServer creates a new instance wi... | go | edit | 15 | 4 | mit | 577564d1d5603f50e8ecc78362ea520cb12b1e29 | jacobhands/multiweb,jacobhands/multiweb | fileserver/fileserver.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage blorg\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestBlorg(t *testing.T) {\n\tconfig, err := ReadConfig(\"testdata/blorg.org\")\n\tif err != nil {\n\t\tt.Errorf(\"Could not read confi... | go | edit | 3 | 6 | mit | 2a85f587d3109de5155f500c51042c6cd61dd18b | niklasfasching/go-org,niklasfasching/go-org | blorg/config_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2018 The Jetstack cert-manager contributors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ht... | go | edit | 0 | 1 | apache-2.0 | e7e2f28584a777b6d4dae4f90bf818009183e9a0 | jetstack/cert-manager,jetstack/cert-manager,jetstack/cert-manager,jetstack-experimental/cert-manager,cert-manager/cert-manager,cert-manager/cert-manager,jetstack-experimental/cert-manager,cert-manager/cert-manager,jetstack-experimental/cert-manager | cmd/webhook/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"atlantis/router/lb\"\n\t\"flag\"\n)\n\nvar servers string\n\nfunc main() {\n\tflag.StringVar(&servers, \"zk\", \"localhost:2181\", \"zookeeper connection string\")\n\tbalancer := lb.New(servers)\n\tbalancer.Run()\n... | go | edit | 0 | 2 | apache-2.0 | 3369ca8862c8b7fd99e37bc74155488ea9a346cd | ooyala/atlantis-router,ooyala/atlantis-router,ooyala/atlantis-router,budhrg/atlantis-router,ooyala/atlantis-router,budhrg/atlantis-router,budhrg/atlantis-router,ooyala/atlantis-router,budhrg/atlantis-router,budhrg/atlantis-router | example/router.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fm_test\n\nimport (\n\t\"go/ast\"\n\t\"testing\"\n\n\t\"github.com/enocom/fm/lib\"\n)\n\nfunc TestConvertBuildsAddsSpyToTypeSpecName(t *testing.T) {\n\tconverter := &fm.SpyStructConverter{}\n\n\ttypeSpec := converter.Convert(\n\t\t&ast.... | go | edit | 6 | 4 | unlicense | 036080221477ff7cd909d0b5091a319476ad9d67 | enocom/fm,enocom/fm | lib/converter_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage atlas\n\nimport (\n\t\"github.com/stretchr/testify/assert\"\n\t\"testing\"\n)\n\nvar TestForm = map[string]string{\n\t\"Type\": \"foo\",\n\t\"AF\": \"1\",\n\t\"InWifiGroup\": \"true\",\n\t\"Spread\": \"1\",\n}\n\nfu... | go | edit | 0 | 1 | mit | f2bae6e09f345adce5e9f24fa3d492c7482867eb | keltia/ripe-atlas | utils_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jsonutil\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"strings\"\n)\n\nfunc Encode(v interface{}) (string, error) {\n\tvar buf bytes.Buffer\n err := json.NewEncoder(&buf).Encode(v)\n if err != nil {\n return \"\", err\... | go | edit | 0 | 2 | mit | 2762e0a70a271c7af3d59ec6ad12d01ef8ef1ccd | hnakamur/commango | jsonutil/jsonutil.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dsbldr\n\n// RunFunc holds the computation that processes the API responses to features\n// is sent a JSON string of the response ??as well as a map of data from the features parent features??\n// Basically what you do with the run func... | go | edit | 0 | 1 | mit | e05c5060b15f74428f7464d4e3b09b60d5771fc7 | Korede-TA/dsbldr | features.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dna\n\n// Histogram is a mapping from nucleotide to its count in given DNA.\ntype Histogram map[rune]int\n\ntype DNA string\n\n// Counts generates a histogram of valid nucleotides in the given DNA.\n// Returns an error if d contains an ... | go | edit | 0 | 6 | mit | 66306253961fbff152d00755910bb1327368055b | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/nucleotide-count/nucleotide_count.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lifecycle\n\nimport (\n\t\"github.com/lxc/lxd/shared/api\"\n\t\"github.com/lxc/lxd/shared/version\"\n)\n\n// NetworkLoadBalancerAction represents a lifecycle event action for network load balancers.\ntype NetworkLoadBalancerAction strin... | go | edit | 3 | 1 | apache-2.0 | 6de3139072bc6c74cfe672d33d30b0778670eace | stgraber/lxd,lxc/lxd,lxc/lxd,lxc/lxd,hallyn/lxd,hallyn/lxd,stgraber/lxd,lxc/lxd,hallyn/lxd,stgraber/lxd,lxc/lxd,lxc/lxd,hallyn/lxd,hallyn/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,hallyn/lxd,stgraber/lxd,stgraber/lxd | lxd/lifecycle/network_load_balancer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"gopkg.in/src-d/go-git.v4\"\n\t. \"gopkg.in/src-d/go-git.v4/_examples\"\n)\n\n// Pull changes from a remote repository\nfunc main() {\n\tCheckArgs(\"<path>\")\n\tpath := os.Args[1]\n\n\t// We ... | go | edit | 21 | 1 | apache-2.0 | e79f5331726d29c2f1213ffd942d2670d09cb40f | mcuadros/go-git,src-d/go-git,mcuadros/go-git,src-d/go-git,go-git/go-git,go-git/go-git | _examples/pull/main.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport \"runtime/debug\"\n\n// SemVer is the version of mockery at build time.\nvar SemVer = \"v0.0.0-dev\"\n\nfunc GetSemverInfo() string {\n\tif version, ok := debug.ReadBuildInfo(); ok {\n\t\treturn version.Main.Version\n\t... | go | edit | 0 | 1 | bsd-3-clause | 3641040b5597b1b965b719b8fa56fb7641f2780c | vektra/mockery,vektra/mockery | pkg/config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\n\t\"gopkg.in/gcfg.v1\"\n)\n\nvar serverConfig = struct {\n\tServer struct {\n\t\tPort string\n\t}\n\tMessage struct {\n\t\tTimeout int\n\t}\n\tTLS struct {\n\t\tUseHTTPS bool\n\... | go | edit | 3 | 2 | mit | 33d58ef5debc48d6d2862005967efeafe935ea35 | LibertyLocked/RestRPC,LibertyLocked/RestRPC,LibertyLocked/RestRPC,LibertyLocked/RestRPC | WebScriptHook.Server/serverconfig.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage schema\n\n// CommandType is an enum of the type that can be represented by a schema.\ntype CommandType int //go:generate stringer -type=CommandType :: manual\n\nconst (\n\tCommandInvalid CommandType = iota\n\tCommandList\n\tCommandCreat... | go | edit | 0 | 2 | apache-2.0 | d0c48a1227827cb33e30827738560052010937ee | sacloud/usacloud,sacloud/usacloud,yamamoto-febc/usacloud,yamamoto-febc/usacloud | schema/command_type.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage openpgp\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// Gnupg keyrings files\nvar gPubringFile string = filepath.Join(os.Getenv(\"HOME\"), \".gnupg\", \"pubring.gpg\")\nvar gSecringFile string = filepath.Join(os.Getenv(\"HOME\"), \"... | go | edit | 0 | 0 | mit | e8f2bfa311a7353358a9d4ee326880526d4942fc | tomykaira/trousseau,oleiade/trousseau,tomykaira/trousseau,mrnugget/trousseau,oleiade/trousseau,mrnugget/trousseau,mrnugget/trousseau,tomykaira/trousseau | crypto/openpgp/globals.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ebay\n\nimport \"strings\"\n\ntype ebayErrors []ebayResponseError\n\nfunc (err ebayErrors) Error() string {\n\tvar errors []string\n\n\tfor _, e := range err {\n\t\terrors = append(errors, e.LongMessage)\n\t}\n\n\treturn strings.Join(er... | go | edit | 3 | 5 | isc | 16b8ee1dcedcaf0ca2434cf90d416671256c3347 | zombor/go-ebay | errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logic\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestPauseCommandFromJson(t *testing.T) {\n\n\tmapper := NewActionsMapper()\n\ta := &ActionService{}\n\tmapper.Load(a)\n\n\tif... | go | edit | 6 | 3 | apache-2.0 | dc75f78d80004b0dc365b7e40e3c040531ffded5 | stampzilla/stampzilla-go,stampzilla/stampzilla-go,stampzilla/stampzilla-go,stampzilla/stampzilla-go,stampzilla/stampzilla-go | nodes/stampzilla-server/logic/command_pause_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\n// +build !confonly\n\npackage tls\n\nimport \"crypto/x509\"\n\nfunc (c *Config) getCertPool() (*x509.CertPool, error) {\n\tif c.DisableSystemRoot {\n\t\treturn c.loadSelfCertPool()\n\t}\n\n\treturn nil, nil\n}\n\n```\n\nAppl... | go | edit | 3 | 1 | mit | 3b087bf8c46bf0fda753d6015c40ede45122b765 | v2ray/v2ray-core,panzer13/v2ray-core,v2ray/v2ray-core,panzer13/v2ray-core | transport/internet/tls/config_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage filters\n\nimport (\n\t\"bones/repositories\"\n\t\"bones/web/context\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc Params(res http.ResponseWriter, req *http.Request, chain *RequestFilterChain) {\n\terr := context.InitParams(req)\n\n\tif err !... | go | edit | 6 | 4 | mit | 400764703c931ba79573d1e50b8c0ca5718a782b | peterskeide/bones | web/filters/filters.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage oak\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestDefaultConfig(t *testing.T) {\n\terr := LoadConf(\"default.config\")\n\tassert.Nil(t, err)\n\tassert.Equal(t, conf, SetupConfig)\n\tf, e... | go | edit | 33 | 1 | apache-2.0 | ac7c2234a21aec4cccc98ecebb8cfe22a1c47bb2 | oakmound/oak,oakmound/oak,oakmound/oak | config_test.go | rejected_lint | Too many lint violations: 33 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lua\n\nimport (\n\t\"regexp\"\n\t\"testing\"\n)\n\n// https://github.com/Shopify/go-lua/pull/63\nfunc TestPushFStringPointer(t *testing.T) {\n\tl := NewState()\n\tl.PushFString(\"%p %s\", l, \"test\")\n\n\tactual := CheckString(l, -1)\n... | go | edit | 6 | 2 | mit | 58b2bb5c502fd3bddf68ced3b20d0baa9e263603 | Shopify/go-lua | lua_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage backend\n\nimport (\n\t\"imperial-splendour-bundler/backend/customErrors\"\n\t\"os\"\n)\n\nfunc (a *API) SelectSourceDir() (string, error) {\n\tdir := a.dialog.SelectDirectory()\n\n\tsourceDir, err := os.Stat(dir)\n\tif err != nil || !s... | go | edit | 6 | 3 | mit | 972956f61894958dc1ce5150664aadaa23fcea4b | SophieAu/imperial-splendour-launcher,SophieAu/imperial-splendour-launcher,SophieAu/imperial-splendour-launcher,SophieAu/imperial-splendour-launcher | bundler/backend/FrontendFileHandler.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage turtle\n\n// Version of the turtle library\nconst Version = \"v0.1.0\"\n\n// Emojis maps a name to an Emoji\nvar Emojis = make(map[string]*Emoji)\n\nfunc init() {\n\tfor _, e := range emojis {\n\t\tEmojis[e.Name] = e\n\t}\n}\n\n// Searc... | go | edit | 21 | 2 | mit | 10d67817e85716b9b0cdbc1c819b36feb9ddfbe8 | hackebrot/turtle | turtle.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013-2017 the u-root Authors. All rights reserved\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// mkfifo creates a named pipe.\n//\n// Synopsis:\n// mkfifo [OPTION... | go | edit | 0 | 4 | bsd-3-clause | 94a46963220d3b3cbe4756f7964de495f25c6fc7 | hugelgupf/u-root,rminnich/u-root,u-root/u-root,hugelgupf/u-root,hugelgupf/u-root,hugelgupf/u-root,rminnich/u-root,GanShun/u-root,rminnich/u-root,u-root/u-root,GanShun/u-root,u-root/u-root,rminnich/u-root,GanShun/u-root | cmds/mkfifo/mkfifo.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\n\t\"github.com/pilu/traffic\"\n\t\"github.com/tealeg/xlsx\"\n)\n\ntype ExcelData struct {\n\tDocumentName string\n\tSheets [][][]string\n}\n\nfunc excelResponse(w traf... | go | edit | 0 | 5 | bsd-3-clause | fbee2a389140f70ec16be73c09ea9c87c1e2ff16 | tealeg/helloxl,tealeg/helloxl | api_handler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"net\"\n)\n\nfunc clientLoop(conn net.Conn, clientId int) {\n\tclientWriteBytes(conn, motd)\n\tclientWrite(conn, \"\\nDragonroar!\\nV0026\\n\")\n\n\treader := bufio.NewReader(conn)\n\tfor {\n... | go | edit | 15 | 4 | unlicense | 02b9bd83b1c66bbf232d272edcdadd3af9c29e21 | amaloy/despite | client.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lib\n\n// Region on Vultr\ntype Region struct {\n\tID int `json:\"DCID,string\"`\n\tName string `json:\"name\"`\n\tCountry string `json:\"country\"`\n\tContinent string `json:\"continent\"`\n\tState string `json:\"s... | go | edit | 3 | 3 | mit | 10e2bc58c9580ceb456f3f9c92cd222ed48c87df | janeczku/vultr,JamesClonk/vultr,jackmiller334/vultr | lib/regions.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage codeutilsShared\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n)\n\n// ExecCommand executes a utility with args and returning the stringified output\nfunc ExecCommand(utility string, args []string, liveOutput bool) string {\n\tvar... | go | edit | 3 | 2 | apache-2.0 | aa4b1c01b0b4eeadab857cca016351a63d7cd1d8 | StroblIndustries/codeutilsShared,StroblIndustries/coreutils | exec.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stripe\n\n// Country is the list of supported countries\ntype Country string\n\n// VerificationFieldsList lists the fields needed for an account verification.\n// For more details see https://stripe.com/docs/api#country_spec_object-veri... | go | edit | 21 | 0 | mit | be7aaaa8feaaaea5ca1289d95e3f415db190aff4 | ChannelMeter/stripe-go,stripe/stripe-go,stripe/stripe-go,ChannelMeter/stripe-go | countryspec.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tools\n\nimport (\n\t\"log\"\n\t\"strings\"\n\t\"fmt\"\n)\n\n// UploadFile used to upload file by S3 pre-signed URL\nfunc UploadFile(path, url string) int {\n\tlog.Println(\"Uploading file from path:\", path)\n\tfile, info := prepareFil... | go | edit | 9 | 2 | mit | ad50209dd215f6324ec49fc22036af57d8f1e15b | artemnikitin/devicefarm-ci-tool | tools/tools.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage image\n\nimport (\n\t\"testing\"\n)\n\nfunc TestWriteBMP(t *testing.T) {\n\tfilename := \"test.bmp\"\n\n\tvar di DcmImage\n\n\tdi.Columns = 64\n\tdi.Rows = 64\n\tdi.BitsAllocated = 16\n\tdi.BitsStored = 12\n\tdi.HighBit = 11\n\terr := d... | go | edit | 9 | 2 | mit | 0fbff83d68948a1b1834deaad45f2821e0c3bf8a | grayzone/godcm | image/dcmimage_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2018 Google LLC\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/... | go | edit | 3 | 1 | apache-2.0 | 6cf39801b3b2294491d447a1e9d0ed23050eaba3 | GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold | cmd/skaffold/app/cmd/completion.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage collector\n\nimport (\n\t\"fullerite/metric\"\n\n\tl \"github.com/Sirupsen/logrus\"\n)\n\n// NerveHTTPD discovers Apache servers via Nerve config\n// and reports metric for them\ntype NerveHTTPD struct {\n\tbaseCollector\n}\n\nfunc init... | go | edit | 24 | 5 | apache-2.0 | dbf57b6e6c282fa7558dd573758795ae91f10154 | qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect | src/fullerite/collector/nerve_httpd.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gifs\n\ntype Crop struct {\n\tX float32 `json:\"x,omitempty\"`\n\tY float32 `json:\"y,omitempty\"`\n\n\tHeight float32 `json:\"height,omitempty\"`\n\tWidth float32 `json:\"width,omitempty\"`\n}\n\n```\n\nApply this change: Add comments... | go | edit | 0 | 0 | mit | 1f93bea7466fae550349ce1600263c41b8758cb1 | gifs/gifs-go | crop.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cache\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestLruCache_Get(t *testing.T) {\n\tl := NewLRUCache(1024 * 1024)\n\tfor idx := 0; idx < 100000; idx++ {\n\t\tl.Set(strings.Repeat(fmt.Sprintf(\"%016d\", idx), 16))\n... | go | edit | 3 | 6 | mit | 680c733882cab51fea3faa7086b053a85df83251 | flachnetz/dd-zipkin-proxy | cache/lru_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport (\n\t\"fmt\"\n\t\"golang.org/x/crypto/sha3\"\n\t\"time\"\n)\n\n// Feed is a single source of articles.\ntype Feed struct {\n\tID int64\n\tFolderID int64\n\n\tTitle string\n\tDescription string\n\tURL ... | go | edit | 0 | 1 | mit | d767399f889dad44213b61e78cd56e0f644cb93c | jrupac/goliath,jrupac/goliath,jrupac/goliath,jrupac/goliath,jrupac/goliath | models/feed.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dnsp\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\ntype HostEntry struct {\n\tIP string\n\tHost string\n}\n\nfunc (h *HostEntry) String() string {\n\treturn fmt.Sprintf(\"%v @ %v\", h.Host, h.IP)\n}\n\nfunc ParseHostLine(line string) Ho... | go | edit | 0 | 4 | mit | 55683db05ffa84f0c9ef086251139a8e11a18dc0 | gophergala/dnsp,gophergala/dnsp,stutiredboy/ddns | hosts_file.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage metrics\n\nimport \"github.com/prometheus/client_golang/prometheus\"\n\nvar (\n\t// PodFailure returns counter for pod_errors_total metric\n\tPodFailure = prometheus.NewCounterVec(\n\t\tprometheus.CounterOpts{\n\t\t\tName: \"pod_errors_... | go | edit | 0 | 0 | apache-2.0 | 14dc3f5e761ee8f72aa3fc117752a4e5c52381bb | tczekajlo/kube-consul-register | metrics/controller.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bsearch/index\"\n\t\"bsearch/ops\"\n\t\"fmt\"\n\t\"os\"\n\t\"flag\"\n)\n\nfunc usage() {\n\tfmt.Fprintf(os.Stderr, \"usage: bsearch <path to index blob>\\n\")\n\tflag.PrintDefaults()\n\tos.Exit(1)\n}\n\nfunc main()... | go | edit | 0 | 5 | isc | 0d36314b5179a3251459cba07315a606af06d13a | art4711/bsearch | main/bsearch.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n)\n\nfunc getBenchmarkInput(filename string) (output []BenchmarkInput, err error) {\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\terr = r.(error)\n\t\t}\n\t}()\n\n\t_ = readRawData(filename)\n... | go | edit | 3 | 5 | mit | caa2d9b5bad5ccf4e3706d2f688d0d1139c4725f | zhtw/bopomofo-benchmark,zhtw/bopomofo-benchmark | data-reader.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\ntype DisjoinSet struct {\n\tparent []int\n\trank []int\n}\n\nfunc NewDisjoinSet() *DisjoinSet {\n\treturn &DisjoinSet{}\n}\n\nfunc (s *DisjoinSet) Make() int {\n\ts.parent = append(s.parent, -1)\n\ts.rank = append(s.rank, 0)\n... | go | edit | 0 | 3 | mit | accdcdb92ab2a9205b15aef94cda458c3c1c7912 | krasin/voxel | src/disjoin_set.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage actors\n\nimport (\n\t\"github.com/cloudfoundry/cli/cf/i18n\"\n\tgoi18n \"github.com/nicksnyder/go-i18n/i18n\"\n)\n\nvar T goi18n.TranslateFunc\n\nfunc init() {\n\tT = i18n.Init(\"actors\", i18n.GetResourcesPath())\n}\n```\n\nApply this... | go | edit | 0 | 1 | apache-2.0 | cb99b9dafe92b22e8ed5fee286e70bc7fc3bc2e8 | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | cf/actors/i18n_init.go | rejected_duplicate | Near-duplicate of sample 118627 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sqlparser\n\n// Magicify runs the SQL passed in, and a table name, throught a customized\n// TextQL SQL Parser. This provides the following functionality:\n// - Queries that do not start with SELECT are implictly mapped to SELECT state... | go | edit | 24 | 6 | mit | ea85e692cc33c3e474923dfec80a3487c97e8b62 | dinedal/textql | sqlparser/sql_mod.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nfunc Base62(n uint) string {\n\tb62 := \"\"\n\tif n == 0 {\n\t\treturn \"0\"\n\t}\n\tfor n != 0 {\n\t\tr := n % 62\n\t\tn = n / 62\n\t\tb62 = string(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"[r]) + b62\n... | go | edit | 0 | 3 | apache-2.0 | aa2edfb1a5f4b40ccab7edff9b0371987f0ff518 | control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced,control-center/serviced | utils/base62.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage uuid_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/northbright/uuid\"\n)\n\nfunc ExampleNew() {\n\tfor i := 0; i < 5; i++ {\n\t\tuuid, _ := uuid.New()\n\t\tfmt.Printf(\"%v\\n\", uuid)\n\t}\n\t// Output\n}\n\n```\n\nApply this change: Fi... | go | edit | 0 | 2 | mit | a5246f8c166f46e76b5778599d48b1e184046bc0 | northbright/uuid | uuid_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage algoholic\n\nimport \"testing\"\n\nconst BENCHMARK_LENGTH = 10\n\nfunc TestFisherYatesShufflesEvenly(t *testing.T) {\n\t// Set an arbitrary maximum error from expectation - We expect each number to occur within\n\t// 0.7% of the probabi... | go | edit | 12 | 1 | mit | 765834d4380829547004dd347382dfd378b3bd04 | lorenzo-stoakes/algoholic | src/combinatorial/shuffle/shuffle_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage opencv\n\nimport (\n\t\"testing\"\n)\n\nfunc TestLoadImage2(t *testing.T) {\n\t// t.Errorf(\"aaa\")\n}\n\n\n```\n\nApply this change: Create start of testing of cxcore functions"
},
{
"role": "assistant",
"content": "package... | go | edit | 42 | 3 | bsd-3-clause | 2850c39ffbb7e14bf0b4feb192e36930b8e2aa9c | mike-ando/go-opencv,mike-ando/go-opencv,mike-ando/go-opencv,mike-ando/go-opencv | opencv/cxcore_test.go | rejected_lint | Too many lint violations: 42 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage opensimplex\n\nimport \"math/rand\"\n\nfunc Example() {\n\tnoise := New(rand.Int63())\n\n\tw, h := 100, 100\n\theightmap := make([]float64, w, h)\n\tfor y := 0; y < h; y++ {\n\t\tfor x := 0; x < w; x++ {\n\t\t\txFloat := float64(x) / fl... | go | edit | 0 | 3 | unlicense | 26fead6a64ec453e40f2bc4fb41ac7148ee6cb3b | ojrac/opensimplex-go | doc_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc mainTester(t *testing.T) {\n\tfmt.Println(\"Howdy buddy\")\n\tt.Log(\"one test passed.\")\n}\n\n```\n\nApply this change: Test after run test main"
},
{
"role": "assistant",
... | go | edit | 0 | 1 | mit | 0e28ef61a73873d6cfc4df35202d5543b5af10b6 | vassilux/vorimport,vassilux/vorimport,vassilux/vorimport | main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage meta\n\nimport \"fmt\"\n\n// GITCOMMIT indicates which git hash the binary was built off of.\nvar GITCOMMIT string\n\n// VERSION indicates which version of the binary is running.\nvar VERSION string\n\nconst majorRelease = \"0.3.x\"\n\n... | go | edit | 0 | 3 | mit | e97dffb5547e9b6c67c1feda609d31019876f455 | kshvmdn/fsql | meta/meta.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux,darwin\n\npackage github\n\nimport (\n\t\"code.google.com/p/go.crypto/ssh/terminal\"\n)\n\nfunc isTerminal(fd uintptr) bool {\n\treturn terminal.IsTerminal(int(fd))\n}\n\n```\n\nApply this change: Use not windows build tag"
},... | go | edit | 0 | 1 | mit | c7a917086e16dd9c2c8200ffaa156d6efc3c893f | ASidlinskiy/hub,dongjoon-hyun/hub,elancom/hub,ASidlinskiy/hub,pankona/hub,boris-rea/hub,elancom/hub,terry2000/hub,RichardLitt/hub,AndBicScadMedia/hub,github/hub,sbp/hub,AndBicScadMedia/hub,cpick/hub,jingweno/hub,github/hub,haikyuu/hub,dev4mobile/hub,ASidlinskiy/hub,nmfzone/hub,adjohnson916/hub,hopil/hub,jpkrohling/hub,... | github/util.go | rejected_duplicate | Near-duplicate of sample 117271 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux,!windows\n\n/*\nCopyright 2017 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License... | go | edit | 0 | 1 | apache-2.0 | 2cfc85c8b300c5a727f7caebc8530a8db4e96c43 | yarntime/kubernetes,roberthbailey/kubernetes,shyamjvs/kubernetes,pmorie/kubernetes,Lion-Wei/kubernetes,ping035627/kubernetes,verb/kubernetes,rrati/kubernetes,deads2k/kubernetes,bparees/kubernetes,coolsvap/kubernetes,cofyc/kubernetes,nikhita/kubernetes,tomzhang/kubernetes,u2takey/kubernetes,dereknex/kubernetes,coolsvap/... | pkg/kubelet/dockershim/docker_stats_unsupported.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage shell\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestCat(t *testing.T) {\n\tmyShell, err := NewShell()\n\tif err != nil {\n\t\tfmt.Fprintf(os.Stderr, \"error: %s\\n\", err)\n\t\tos.Exit(1)\n\t}\n\n\treader, ... | go | edit | 3 | 4 | mit | b6e805835a546d7481bc6f184f174ae5b6d040c6 | noffle/fallback-ipfs-shell | getshell_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage exc\n\nimport (\n\t\"testing\"\n\n\t\"github.com/elves/elvish/pkg/eval\"\n)\n\nvar That = eval.That\n\nfunc TestExc(t *testing.T) {\n\tsetup := func(ev *eval.Evaler) { ev.Global.AddNs(\"exc\", Ns) }\n\teval.TestWithSetup(t, setup,\n\t\t... | go | edit | 12 | 1 | bsd-2-clause | ff16eda59f1a5f937519ec5d330120a594860512 | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | pkg/eval/exc/exc_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gotop\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestMemoryUsage(t *testing.T) {\n\tmemInfoChan := make(chan MemInfo)\n\tgo MemoryUsage(memInfoChan, time.Second)\n\titerations := 0\n\tfor {\n\t\tme... | go | edit | 6 | 4 | mit | 2ccd8d7ae0a2e66fc2d6b8f014bef2d7d9237796 | nindalf/gotop | memory_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux\n\n/*\nCopyright 2017 Gravitational, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ht... | go | edit | 6 | 1 | apache-2.0 | 80a1a84ffc3bdb55e92d9443aad4e11e3f772ff0 | gravitational/satellite,gravitational/satellite | monitoring/os.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2011 Google Inc. All Rights Reserved.\n// This file is available under the Apache license.\n\n// +build gofuzz\n\npackage vm\n\nimport (\n\t\"bytes\"\n)\n\nfunc Fuzz(data []byte) int {\n\tif _, err := Compile(\"fuzz\", bytes.NewRea... | go | edit | 9 | 2 | apache-2.0 | 715564d057e14cd2c2bcccce60ebd74a2befe02e | google/mtail,SuperQ/mtail,SuperQ/mtail,google/mtail | internal/vm/fuzz.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestMain(m *testing.M) {\n\tos.Setenv(\"FAW_ICONS_YAML_PATH\", \"workflow/icons.yml\")\n\tm.Run()\n}\n\n```\n\nApply this change: Improve TestMain function for exit code"
},
{
... | go | edit | 0 | 1 | mit | 2f67940fac1b3cbe3106d4ecab9227ec89d58abc | ruedap/alfred-font-awesome-workflow,ruedap/alfred-font-awesome-workflow,ruedap/alfred-font-awesome-workflow | main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/codegangsta/cli\"\n\t\"os\"\n\t\"path\"\n)\n\ntype File struct {\n\tImdbID string\n\tFormat string\n\tFileName string\n\tFullPath string\n}\n\nfunc (f *File) IsValid() bool {\n\treturn f.ImdbID != \"... | go | edit | 0 | 2 | mit | 77205cc922eb8f68e1804bdd593273d50cc86a71 | dillonhafer/imdb-tags,dillonhafer/imdb-tags | file.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ec2\n\nimport (\n\t\"errors\"\n\n\tgoaws \"github.com/aws/aws-sdk-go/aws\"\n\tawsec2 \"github.com/aws/aws-sdk-go/service/ec2\"\n)\n\ntype AvailabilityZoneRetriever struct {\n\tec2ClientProvider ec2ClientProvider\n}\n\nfunc NewAvailabili... | go | edit | 6 | 5 | apache-2.0 | 86bb90498ca29ed3c67e66585cd3cedc80ed0262 | niroyb/bosh-bootloader,niroyb/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader | aws/ec2/availability_zone_retriever.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"errors\"\n\t\"sync\"\n\t\"time\"\n)\n\ntype LanguagePool struct {\n\tmutex sync.RWMutex\n\tlanguages map[string]*Language\n}\n\nfunc NewLanguagePool() *LanguagePool {\n\tp := new(LanguagePool)\n\tp.languages ... | go | edit | 15 | 2 | mit | d884bcc1848360e1996d301669efa72f603af823 | MStoykov/mazungumzo | server/language_pool.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sodium\n\nimport \"fmt\"\nimport \"unsafe\"\n\n// #include <stdio.h>\n// #include <sodium.h>\nimport \"C\"\n\nfunc MemZero(buff1 []byte) {\n\tif len(buff1) > 0 {\n\t\tC.sodium_memzero(unsafe.Pointer(&buff1[0]), C.size_t(len(buff1)))\n\t... | go | edit | 3 | 3 | isc | 491cfff74ed9b21fc6db57e24e4d26edea170696 | GoKillers/libsodium-go,GoKillers/libsodium-go | sodium/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jsonlog\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"time\"\n)\n\ntype JSONLog struct {\n\tLog string `json:\"log,omitempty\"`\n\tStream string `json:\"stream,omitempty\"`\n\tCreated time.Time `json:\... | go | edit | 0 | 5 | apache-2.0 | fd3f2e175fa6ddb606d2c681ff86a97faccfebbd | rabbitcount/docker,spinolacastro/docker,PatrickLang/moby,laijs/docker,aidanhs/docker,euank/docker,harche/docker,makinacorpus/docker,swasd/baleno,troy0820/docker.github.io,jvgogh/docker,tklauser/docker,moxiegirl/docker,shaded-enmity/docker,clearlinux/docker,msagheer/docker,itsnuwan/docker,yang1992/docker,konstruktoid/do... | pkg/jsonlog/jsonlog.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2018 The Ebiten Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://w... | go | edit | 3 | 4 | apache-2.0 | 2106e0fa6a6d245a6f5a1f65a67849987eacfabc | hajimehoshi/ebiten,hajimehoshi/ebiten | internal/devicescale/impl_js.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scamp\n\nimport (\n\t\"io/ioutil\"\n\t\"testing\"\n)\n\nvar pemPath = \"./../fixtures/ticket_verify_public_key.pem\"\n\nfunc TestTicket(t *testing.T) {\n\tgood, err := ioutil.ReadFile(\"./../fixtures/processor-dispatch.token\")\n\tif er... | go | edit | 0 | 6 | mit | 300b3ff35e2dd89177b6dcd2b1b86dde60db37b1 | gudTECH/scamp-go,gudTECH/scamp-go | scamp/ticket_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage generator\n\nimport (\n\t\"strconv\"\n\n\t\"github.com/adam-hanna/randomstrings\"\n\t\"github.com/onsi/ginkgo/config\"\n)\n\nfunc randomName() string {\n\tstr, err := randomstrings.GenerateRandomString(20)\n\tif err != nil {\n\t\tpanic(... | go | edit | 0 | 2 | apache-2.0 | 8db61c9870a31f416e68a4b9227a24575937efd2 | cloudfoundry-incubator/cf-test-helpers,cloudfoundry-incubator/cf-test-helpers | generator/random_name.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\nimport (\n\t\"io/ioutil\"\n\t\"net\"\n\t\"net/http\"\n)\n\nvar (\n\t// HTTP stuff\n\ttr *http.Transport\n\tclient *http.Client\n)\n\n// Custom dial for Docker unix socket\nfunc unixSocketDial(proto, addr string) (conn net.Co... | go | edit | 12 | 3 | mit | 54150cb6ae8a96d139c21723df3754616d8b1ac5 | 90TechSAS/docker-guard-probe,90TechSAS/docker-guard-probe | core/api-client.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage kafka\n\nvar codecs = make(map[int8]CompressionCodec)\n\n// RegisterCompressionCodec registers a compression codec so it can be used by a Writer.\nfunc RegisterCompressionCodec(codec func() CompressionCodec) {\n\tc := codec()\n\tcodecs[... | go | edit | 0 | 1 | mit | ee7d6544c7406ae92002c17e567f838384cc1fd1 | segmentio/kafka-go | compression.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage web\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/deferpanic/deferclient/deferstats\"\n)\n\nvar (\n\tdfs *deferstats.Client\n)\n\n// NewLogger configures defer panic error and starts capturing stats.\n// It... | go | edit | 0 | 2 | apache-2.0 | d505cbe8cb210e2dfae6e3a17d64c7c95eb2394f | GoIncremental/web | log.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage xlsx\n\nimport (\n\t\"testing\"\n)\n\nfunc TestMacExcel(t *testing.T) {\n\txlsxFile, error := OpenFile(\"macExcelTest.xlsx\")\n\tif error != nil {\n\t\tt.Error(error.Error())\n\t\treturn\n\t}\n\tif xlsxFile == nil {\n\t\tt.Error(\"OpenF... | go | edit | 3 | 4 | bsd-3-clause | 955d11a182cf9d78b86de81be34e53103a02b04c | ryho/xlsx | macExcel_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage all\n\nimport (\n\t_ \"github.com/SpirentOrion/metrics-service/telegraf/plugins/inputs/cloudstress_agent_consumer\"\n\t_ \"github.com/SpirentOrion/metrics-service/telegraf/plugins/inputs/cloudstress_host_consumer\"\n)\n\n```\n\nApply th... | go | edit | 0 | 0 | mit | 488d3581c187cc3a6151232202d484575f7fdec5 | SpirentOrion/telegraf,SpirentOrion/telegraf,SpirentOrion/telegraf,SpirentOrion/telegraf | plugins/inputs/all/all.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage binding\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestParseTimeErrorParsing(t *testing.T) {\n\tr := require.New(t)\n\t_, err := parseTime([]string{\"this is sparta\"})\n\tr.Error(err)... | go | edit | 6 | 3 | mit | 686cf12e54030e5f80e66f125d13e1346e6bf1ac | gobuffalo/buffalo,markbates/buffalo,gobuffalo/buffalo | binding/binding_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\n\t\"github.com/resumic/schema/cmd/resumic/validate\"\n)\n\nfunc main() {\n\tvar doc string\n\tflag.StringVar(&doc, \"doc\", \"../../examples/invalid/invalid_email.json\", \"Example file\")\n\tflag.Parse()... | go | edit | 0 | 8 | apache-2.0 | be6ec3695d430904e5d2992a541ac9007882b259 | resumic/schema,resumic/schema | cmd/resumic/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Mathieu MAST. All rights reserved.\n// Use of this source code is governed by a MIT style\n// license that can be found in the LICENSE file.\npackage container\n\nimport (\n\t\"reflect\"\n)\n\ntype Container interface {\n\tAdd... | go | edit | 0 | 0 | mit | 9846aecd66154be474d74c8108cf896d7c940f70 | goloc/container | interfaces.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"../../pkg/netutil\"\n\t\"flag\"\n\t\"log\"\n\t\"syscall\"\n)\n\nvar (\n\taddr string\n\tconf string\n)\n\nfunc init() {\n\tflag.StringVar(&addr, \"addr\", \"\", \"external address to bind (e.g. 'tcp://:80')\")\n\tf... | go | edit | 9 | 4 | mit | 40a61c28e7a6fdc3a157fffad804502081c1027f | pusher/crank,pusher/crank,pusher/crank | cmd/crank/main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Copyright 2018 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License ... | go | edit | 0 | 2 | apache-2.0 | 9668049fa85fcd9bff11a229be29baad24d7d8ce | markfisher/sk8s,markfisher/sk8s,markfisher/sk8s,markfisher/sk8s | riff-cli/global/riff_version.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage suite\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\ntype CallOrderSuite struct {\n\tSuite\n\tcallOrder []string\n}\n\nfunc (s *CallOrderSuite) call(method string) {\n\t//\ts.Mutex.Lock()\n\t... | go | edit | 9 | 1 | mit | e7b6c143052f6ca99c13a2eb07aebc3250cbe9bf | stretchr/testify,stretchr/testify | suite/suite_order_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clienttest\n\nimport (\n\tcheck \"gopkg.in/check.v1\"\n\n\t\"github.com/radanalyticsio/oshinko-cli/rest/version\"\n\t\"github.com/radanalyticsio/oshinko-cli/rest/helpers/info\"\n\t\"os\"\n)\n\nfunc (s *OshinkoRestTestSuite) TestServerIn... | go | edit | 3 | 1 | apache-2.0 | bde8802a3307899222a765a6ad484deee82d811e | radanalyticsio/oshinko-cli,tmckayus/oshinko-cli,tmckayus/oshinko-cli,crobby/oshinko-cli,tmckayus/oshinko-cli,crobby/oshinko-cli,crobby/oshinko-cli,radanalyticsio/oshinko-cli,radanalyticsio/oshinko-cli | rest/tests/client/server_client_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage monitor\n\nimport (\n\t\"time\"\n\n\tlog \"github.com/sirupsen/logrus\"\n)\n\nfunc Watch(directory string, deployments chan<- string) {\n\tdone := make(chan bool)\n\tdefer close(done)\n\n\twatcher, err := NewBatcher(5 * time.Second)\n\t... | go | edit | 3 | 5 | apache-2.0 | 5d66fa46e201e4989964815561a47ca484df33a2 | sascha-andres/tardeploy | tardeploy/monitor/watch.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2019 The Tekton Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/l... | go | edit | 0 | 1 | apache-2.0 | 1261340aea12cf23543d327cc1082febc4a282de | tektoncd/pipeline,tektoncd/pipeline | pkg/apis/pipeline/v1alpha1/types_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2014 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.... | go | edit | 6 | 3 | apache-2.0 | a0a47c6570e18e8f151989fc8f2af3c9436c42b7 | YuPengZTE/kubernetes,liggitt/kubernetes,timoreimann/kubernetes,sarat-k/kubernetes,HardySimpson/kubernetes,JulienBalestra/kubernetes,jianhuiz/kubernetes,apcera/kubernetes,koep/kubernetes,stu-gott/kubernetes,yuexiao-wang/kubernetes,maisem/kubernetes,olivierlemasle/kubernetes,intelsdi-x/kubernetes,cheapRoc/kubernetes,mica... | plugin/pkg/admission/deny/admission_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ansicfile\n\nimport \"testing\"\n\nfunc TestOpen(t *testing.T) {\n\tfp, err := Open(\"あ\", \"w\")\n\tif err == nil {\n\t\tPutc(byte('1'), fp)\n\t\tClose(fp)\n\t} else {\n\t\tt.Fatalf(\"NG: Open(\\\"あ\\\") Failed by %s\", err.Error())\n\... | go | edit | 6 | 3 | bsd-3-clause | 3864c09589044f3fdd54441069032276095a2f87 | tsuyoshicho/nyagos,nocd5/nyagos,tyochiai/nyagos,zetamatta/nyagos | dos/ansicfile/ansicfile_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ssh\n\nimport (\n\t\"testing\"\n)\n\nfunc TestAddPrompterVariablesNoPrompter(t *testing.T) {\n\tif e, err := addPrompterVariables([]string{\"SSH_ASKPASS=someprogram\"}, \"\"); err != nil {\n\t\tt.Fatal(\"failed to set prompter environme... | go | edit | 6 | 3 | mit | e44ef868c4de558aec010c062891422ffa4320a2 | havoc-io/mutagen,havoc-io/mutagen | pkg/ssh/prompt_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage loggo\n\nimport (\n\t\"path\"\n\t\"time\"\n)\n\n// TestLogValues represents a single logging call.\ntype TestLogValues struct {\n\tLevel Level\n\tModule string\n\tFilename string\n\tLine int\n\tTimestamp time.Time\n\tMessag... | go | edit | 6 | 2 | mit | fca9c1badb3721928e7b80a38af340b413e2a9d8 | cmars/tools,cmars/tools,cmars/tools,cmars/tools | testwriter.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stacktrace\n\nimport \"testing\"\n\nfunc captureFunc() Stacktrace {\n\treturn Capture(0)\n}\n\nfunc TestCaptureTestFunc(t *testing.T) {\n\tstack := captureFunc()\n\n\tif len(stack.Frames) == 0 {\n\t\tt.Fatal(\"expected stack frames to b... | go | edit | 0 | 5 | apache-2.0 | 3e46977ec15093ff8fcf84bf5d3e339c17a06630 | adrianreber/runc,wangkirin/runc,albertoleal/runc,sunyuan3/runc,runcom/runc,estesp/runc,opencontainers/runc,nkwilson/runc,justincormack/runc,mikebrow/runc,coolljt0725/runc,jhowardmsft/runc,kolyshkin/runc,dqminh/runc,runcom/runc,mheon/runc,WeiZhang555/runc,adrianreber/runc,mikebrow/runc,maxamillion/runc,docker/runc,alber... | libcontainer/stacktrace/capture_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t_ \"github.com/go-sql-driver/mysql\"\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/lib/pq\"\n)\n\n// TestDB initialize a db for testing\nfunc TestDB() *gorm.DB {\n\tdbuser, dbpwd, dbname := ... | go | edit | 0 | 4 | mit | 625b045b689c18f29adee606047ab54eb7a502f8 | qor/qor,qor/qor,qor/qor | test/utils/test_db.go | rejected_duplicate | Near-duplicate of sample 117105 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage data\n\nimport (\n\t\"time\"\n\n\t\"gopkg.in/mgo.v2\"\n\t\"gopkg.in/mgo.v2/bson\"\n)\n\ntype Organization struct {\n\tID bson.ObjectId `bson:\"_id\"`\n\tName string `bson:\"name\"`\n\tOwnerID bson.ObjectId `bson:... | go | edit | 12 | 3 | bsd-3-clause | 76e05fd54739165dcb9a451d41e3988807ce2d0f | FurqanSoftware/papyrus,FurqanSoftware/papyrus,FurqanSoftware/papyrus | data/organization.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\t\"github.com/spf13/pflag\"\n\t\"k8s.io/cloud-provider-gcp/cmd/kubectl-gke-exec-auth-plugin/provider\"\n\t\"k8s.io/component-base/version/verflag\"\n)\n\nfunc main() {\n\tpflag.Parse(... | go | edit | 0 | 3 | apache-2.0 | 1a44936a957c4b0075194a869895a24bae32117b | kubernetes/cloud-provider-gcp,kubernetes/cloud-provider-gcp | cmd/kubectl-gke-exec-auth-plugin/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage librariesio\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n)\n\n// Project that holds a name field\ntype Project struct {\n\tName string `json:\"name\"`\n}\n\n// GetProject returns information about a project and it's versions.\n// GET https:/... | go | edit | 3 | 3 | mit | 33362911d547548214a34ac0be71256700a31fb4 | hackebrot/go-librariesio | librariesio/projects.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage romannumerals\n\nimport \"errors\"\n\nfunc ToRomanNumeral(input int) (string, error) {\n\tif input <= 0 {\n\t\treturn \"\", errors.New(\"input must be greater than 0\")\n\t} else if input > 3000 {\n\t\treturn \"\", errors.New(\"input mu... | go | edit | 0 | 4 | mit | d2aecce5d5967012550490d4c30aa1aa01db7656 | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/roman-numerals/roman_numerals.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.