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 main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"os\"\n\t\"runtime\"\n\n\t\"bitbucket.org/tebeka/nrsc\"\n\t\"github.com/alexcesaro/log\"\n\t\"github.com/alexcesaro/log/golog\"\n)\n\nvar logger *golog.Logger\n\nvar storage storageHandler... | go | edit | 9 | 2 | apache-2.0 | ac32c28191724d75d45f2fed855ab5b701762888 | pavel-paulau/perfdb,pavel-paulau/perfdb,pavel-paulau/perfkeeper | main.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\"reflect\"\n\t\"testing\"\n)\n\nvar parseIndexesListTests = []struct {\n\tlist string\n\tindexes []int\n}{\n\t// Only one index\n\t{\n\t\tlist: \"10\",\n\t\tindexes: []int{10},\n\t},\n\t{\n\t\tlist: \"120\"... | go | edit | 0 | 4 | mit | 3bdd4a4ec850eed0494d007fd41b665173415039 | kusabashira/csvp | csvp_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage graph\n\nimport (\n//\t\"os\"\n)\n\ntype Invitation struct {\n\tName string\n\tID string\n\t// rsvp_status, not_replied, attending, unsure or declined\n\tRSVPStatus string\n}\n/*\nfunc GetInvitations(URL string) (invs []Invitation, er... | go | edit | 6 | 3 | mit | 5c22f1f14629a4e3396833c2c6dd52634ebcd43e | mattn/go-facebook | src/graph/invitation.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handler\n\nimport (\n\t\"github.com/materials-commons/config/cfg\"\n)\n\ntype loaderHandler struct {\n\thandler cfg.Handler\n\tloader cfg.Loader\n}\n\n// Loader returns a handler that reads the keys in from a loader.\nfunc Loader(loade... | go | edit | 3 | 2 | mit | e1d45906ed38c71831fe61720f3df9d8a7061c98 | materials-commons/config,materials-commons/config | handler/loader.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage medtronic\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nconst (\n\tmaxBolus = 25000 // milliUnits\n)\n\n// Bolus delivers the given amount of insulin as a bolus.\nfunc (pump *Pump) Bolus(amount Insulin) {\n\tif amount < 0 {\n\t\tpump.SetError... | go | edit | 12 | 6 | mit | 492976aee59cf1b87150381a2733bb88bc7c12a1 | ecc1/medtronic,ecc1/medtronic | bolus.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage openzwave\n\nimport \"fmt\"\n\n// A logger interface. Modelled on github.com/juju/loggo so that can be used substituted by default.\ntype Logger interface {\n\t// Log an info message.\n\tInfof(message string, args ...interface{})\n\t// ... | go | edit | 0 | 1 | mit | c837377a7d0839c08c60b746cb7b826cdd3cca94 | ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave | logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc main() {\n\tticker := time.NewTicker(10 * time.Second)\n\tgo func() {\n\t\tfor _ = range ticker.C {\n\t\t\tlog.Println(\"ping google.com -c 5\"... | go | edit | 3 | 3 | mit | 8d5b4250acac0edd78a23ab869df64fd33f206d6 | grahamrhay/go-ping,grahamrhay/go-ping | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/nightlyone/lockfile\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// Get name of lock file, which is derived from the monitoring event name\nfunc getLockfileName() string {\n\treturn filepath.Join(os.TempDir(),... | go | edit | 3 | 2 | mit | d61adc880ea85c1adc4585afb2aac40ab1602f28 | Jimdo/periodicnoise,Jimdo/periodicnoise | cmd/pn/locking.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"testing\"\n\nfunc TestDockerize(*testing.T) {\n\tconst expected = \"/c/users/Foo\"\n\n\tvar dockerized string\n\tdockerized, err := dockerize(`C:\\users\\Foo`)\n\n\tif err != nil {\n\t\tt.Error(\"Unexpected error: \", e... | go | edit | 3 | 3 | apache-2.0 | a2bb8bc323d62d7b534160fd30d46408d1f3e040 | coduno/piper,coduno/compute | engine_windows_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"github.com/gocraft/web\"\n\t\"runtime\"\n)\n\ntype serverStatus struct {\n\t*APIContext\n}\n\nfunc SetUpServerStatusRouter(prefix string, router *web.Router) {\n\troot := router.Subrouter(serverStatus{}, \"/runti... | go | edit | 0 | 1 | mit | a067b0b7ac91706b464911da1b0ad52ee7ebfa6b | sensorbee/sensorbee,sensorbee/sensorbee | server/server_status.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"github.com/nsf/termbox-go\"\nimport \"time\"\nimport \"flag\"\n\nfunc main() {\n\tloops := flag.Int(\"loops\", 0, \"number of times to loop (default: infinite)\")\n\tflag.Parse()\n\n\terr := termbox.Init()\n\tif err != ... | go | edit | 15 | 9 | mit | 188a638e568a00a1f4e338a677c0820d5ddbc4a6 | jmhobbs/terminal-parrot | parrot.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nvar (\n\tname string = \"Чочко\"\n\tage uint8 = 27\n\tp_name *string\n)\n\nfunc main() {\n\tp_name = &name\n\tfmt.Printf(\"name е на адрес %p и има стойност %s\\n\", p_name, name)\n\tfmt.Printf(\"age е на... | go | edit | 0 | 1 | mit | 545cfdd75fed18e70592602ff3fc1214ea165600 | fmi/go-lectures,fmi/go-lectures,fmi/go-lectures,fmi/go-lectures | code/02/pointers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage telegraph\n\nimport (\n\tgojson \"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"net/url\"\n\n\tjson \"github.com/pquerna/ffjson/ffjson\"\n\thttp \"github.com/valyala/fasthttp\"\n)\n\n// Response represents a response from the Telegram A... | go | edit | 0 | 5 | mit | f02b706066774ea0c380d11a93049b3ae1e4217a | toby3d/go-telegraph,toby3d/telegraph | request.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hub\n\nimport (\n\t\"sync\"\n\n\t\"github.com/gorilla/websocket\"\n)\n\nvar mutex sync.Mutex\n\ntype WSClient struct {\n\tID string\n\tChannel string\n\tConn *websocket.Conn\n}\n\nvar (\n\tpool map[string]map[string]*WSClient\n)... | go | edit | 3 | 2 | mit | fa58c74213de3b193dfba428c1efd08cb1e2a775 | rafaelsq/roar | hub/hub.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/markbates/goth\"\n)\n\n// Message emitted by a client and broadcasted to the channel\ntype Message struct {\n\tUser string `json:\"user\"`\n\tContent string... | go | edit | 3 | 3 | mit | 6137a9cbaaad766305faa3cf9157362d014d28b7 | AntonioVdlC/chat,AntonioVdlC/chat,AntonioVdlC/chat | src/client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage git\n\nimport (\n\t\"errors\"\n\t\"regexp\"\n)\n\ntype GitRemote struct {\n\tName string\n\tURL string\n}\n\nfunc Remotes() ([]GitRemote, error) {\n\tr := regexp.MustCompile(\"(.+)\\t(.+github.com.+) \\\\(push\\\\)\")\n\toutput, err :=... | go | edit | 3 | 5 | mit | 27d6322eda35d7eefe79eb2a1a5cd26fa36ab155 | jingweno/gh,jingweno/gh,beni55/gh,beni55/gh,beni55/gh,jingweno/gh | git/remote.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage opts\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\n// IPOpt holds an IP. It is used to store values from CLI flags.\ntype IPOpt struct {\n\t*net.IP\n}\n\n// NewIPOpt creates a new IPOpt from a reference net.IP and a\n// string representation ... | go | edit | 3 | 2 | apache-2.0 | ac76967dbac4e98ffea03a2a1f35a322a4cc88de | redpanda/cli,e11137/cli,riyazdf/cli,allencloud/cli,Zebrilee/cli,docker/cli,e11137/cli,docker/cli,cpuguy83/cli,redpanda/cli,riyazdf/cli,thaJeztah/cli,Zebrilee/cli,ashfall/cli,ashfall/cli,cpuguy83/cli,thaJeztah/cli,dnephin/cli,dnephin/cli,allencloud/cli | opts/ip.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration\n\nimport (\n\t\"os\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nconst previousKismaticVersion = \"v1.2.0\"\n\n// Test a specific released version of Kismatic\nvar _ = Describe(\"Installing with ... | go | edit | 42 | 1 | apache-2.0 | ab6c05839f3fb72bec5b0ec3cc2fdac275bc41ed | apprenda/kismatic,apprenda/kismatic,apprenda/kismatic | integration/install_released_test.go | rejected_lint | Too many lint violations: 42 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Marc-Antoine Ruel. All rights reserved.\n// Use of this source code is governed under the Apache License, Version 2.0\n// that can be found in the LICENSE file.\n\n// +build go1\n// +build !go1.6\n\npackage gb\n\nconst (\n\tsh... | go | edit | 0 | 0 | apache-2.0 | f798c3e07c1e0764cc2e61b18ba1350a64a3138b | maruel/panicparse,maruel/panicparse | internal/goversion1.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage events\n\nimport (\n\t\"gpio\"\n\t\"time\"\n)\n\ntype EdgeEvent struct {\n\tBeforeEvent int\n\tAfterEvent int\n\tTimestamp time.Time\n}\n\nfunc edgeTrigger(pin gpio.GPIO, eventCh chan EdgeEvent, ctrlCh chan bool) (error) {\n\tlastState,... | go | edit | 0 | 6 | bsd-3-clause | 9f345e7f4f3e82ac254d5f419ad26a6a0c5ddb68 | fraburnham/gpio | events/edge.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\ntype File struct {\n\tID string\n\tFilename string\n\tContent []byte\n}\n\ntype Entry struct {\n\tID string `json:\"id\"`\n\tTitle string `json:\"title\"`\n\tTimestamp int64 `json:\"timestamp\"`\n\tMarkdown ... | go | edit | 0 | 0 | mit | f51c211b9d3648d41c37334071669fb2099fa227 | amassanet/gopad | model/entry.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage otgrpc\n\nimport (\n\t\"strings\"\n\n\topentracing \"github.com/opentracing/opentracing-go\"\n\t\"github.com/opentracing/opentracing-go/ext\"\n\t\"google.golang.org/grpc/metadata\"\n)\n\nvar (\n\t// Morally a const:\n\tgRPCComponentTag ... | go | edit | 0 | 5 | bsd-3-clause | 8fa31758f85ff84c4f21071a156e7a5539a93795 | grpc-ecosystem/grpc-opentracing,grpc-ecosystem/grpc-opentracing,grpc-ecosystem/grpc-opentracing | go/otgrpc/shared.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bitfinex\n\ntype CreditsService struct {\n\tclient *Client\n}\n\ntype Credit struct {\n\tId int\n\tCurrency string\n\tStatus string\n\tRate float64\n\tPeriod float64\n\tAmount float64\n\tTimestamp string\n}\n\n// R... | go | edit | 3 | 3 | mit | 1af7346ca1dc87df2e9e2eae59f94b504060bda7 | bitfinexcom/bitfinex-api-go | v1/credits.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage testutil\n\nimport \"sync/atomic\"\n\nvar nextPort uint32 = 40000\n\n// UniquePort generates a likely unique port, so that multiple servers can run\n// concurrently. Note that it does not actually check that the port is free,\n// but us... | go | edit | 0 | 2 | apache-2.0 | 0813e64388ec107581a3cfeea495a276d95a0db9 | pachyderm/pfs,pachyderm/pfs,pachyderm/pfs | src/server/pkg/testutil/ports.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pd1_test\n\nimport (\n\t// \"math/rand\"\n\t// \"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t// \"github.com/influxdb/influxdb/tsdb/engine/pd1\"\n)\n\nfunc TestEncoding_FloatBlock(t *testing.T) {\n\t// valueCount := 100\n\t// times := get... | go | edit | 0 | 3 | mit | 5e59cb93932eeb6b3f725e721d34c596192f7e62 | Mindera/influxdb,mre/influxdb,jipperinbham/influxdb,lgpeterson/influxdb,nickrobinson/influxdb,CVTJNII/influxdb-tjnii,jipperinbham/influxdb,linearb/influxdb,Mindera/influxdb,Mindera/influxdb,joaopedrotaveira/influxdb,sudabon/influxdb,benbjohnson/influxdb,bluebreezecf/influxdb,mark-rushakoff/influxdb,apigee/influxdb,blue... | tsdb/engine/pd1/encoding_test.go | rejected_duplicate | Near-duplicate of sample 117025 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/* Unmarshal\n */\n\npackage main\n\nimport (\n \"go/bandersnatch\"\n\t\"encoding/xml\"\n\t\"fmt\"\n\t\"os\"\n\t//\"strings\"\n)\n\ntype Person struct {\n\tXMLName Name `xml:\"person\"`\n\tName Name `xml:\"name\"`\n\tEmail []Email... | go | edit | 0 | 1 | mit | 0cfe33a2b9554ff3395dba82cfad5ed7a78bde75 | 5outh/bandersnatch | examples/basic.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logouthandler\n\nimport (\n\t\"net/url\"\n\n\t\"golang.org/x/net/context\"\n\n\t\"github.com/flimzy/jqeventrouter\"\n\t\"github.com/flimzy/log\"\n\t\"github.com/gopherjs/gopherjs/js\"\n\t\"github.com/gopherjs/jquery\"\n\n\t\"github.com/... | go | edit | 0 | 2 | mit | 9d339268b019e7cf30818b5073899071aa39bf42 | flimzy/flashback,FlashbackSRS/flashback,flimzy/flashback,flimzy/flashback,FlashbackSRS/flashback,FlashbackSRS/flashback | webclient/handlers/logout/logout.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logrus\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\n\t\"testing\"\n)\n\nfunc TestQuoting(t *testing.T) {\n\ttf := new(TextFormatter)\n\n\tcheckQuoting := func(q bool, value interface{}) {\n\t\tb, _ := tf.Format(WithField(\"test\", value))\... | go | edit | 6 | 3 | mit | 98ee5434ef02856cc9289f546c38d12a3244fe15 | devopstaku/logrus,tianon/debian-golang-logrus,Sirupsen/logrus,orvice/logrus,Barberrrry/logrus,marcosnils/logrus,Dal-Papa/logrus,torfuzx/logrus,yxd-hde/logrus,seatgeek/logrus,ryanfaerman/logrus,penhauer-xiao/logrus,snowsnail/logrus,sirupsen/logrus,lixin9311/logrus,xyliuke/logrus,EmileVauge/logrus,Arkan/logrus,yawn/logru... | text_formatter_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jsonschema\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\n// normalizeNumber accepts any input and, if it is a supported number type,\n// converts it to either int64 or float64. normalizeNumber raises an error\n// if the input is an explic... | go | edit | 0 | 14 | bsd-3-clause | 82b35fcdfba1184a8d2d176aa52e883ea5dd0afe | cupcake/jsonschema | utils.go | rejected_complexity | Cyclomatic complexity too high: 14 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport \"log\"\n\ntype SomaUtil struct {\n\tLog *log.Logger\n}\n\nfunc (u *SomaUtil) SetLog(l *log.Logger) {\n\tu.Log = l\n}\n\n// vim: ts=4 sw=4 sts=4 noet fenc=utf-8 ffs=unix\n\n```\n\nApply this change: Kill last old logger f... | go | edit | 0 | 0 | bsd-2-clause | 35686867c302bb155ed0f44f0a1d39975fa5c3c4 | 1and1/soma | util/struct_somautil.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os/exec\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestMakefont(t *testing.T) {\n\tconst expect = \"Font definition file successfully generated\"\n\tout, err := exec.Command(\"./makefont\", \"--dst=../font\", \"--e... | go | edit | 0 | 4 | isc | b3e554e5eaf9454cc02a9f09dc3aab9e132eb0ca | ledongthuc/gofpdf,jelmersnoeck/gofpdf,roblillack/gofpdf,tgulacsi/gofpdf,jung-kurt/gofpdf,jelmersnoeck/gofpdf,StefanSchroeder/ondekoza-contributions,lkesteloot/gofpdf-old,josuehennemann/gofpdf,Lostmyname/gofpdf | makefont/makefont_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jump\n\nimport \"testing\"\n\nfunc TestHashInBucketRange(t *testing.T) {\n\th := Hash(1, 1)\n\tif h != 0 {\n\t\tt.Error(\"expected bucket to be 0, got\", h)\n\t}\n\n\th = Hash(42, 57)\n\tif h != 43 {\n\t\tt.Error(\"expected bucket to be... | go | edit | 9 | 6 | mit | a031385a2e67be2ca180abec15a53f8245c9ef8d | renstrom/go-jump-consistent-hash | jump_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage downloads\n\nimport (\n\t\"github.com/itchio/butler/buse\"\n\t\"github.com/itchio/butler/cmd/operate\"\n)\n\nfunc DownloadsRetry(rc *buse.RequestContext, params *buse.DownloadsRetryParams) (*buse.DownloadsRetryResult, error) {\n\tconsum... | go | edit | 3 | 2 | mit | 2179a20afcb1eb4ea11dc3b130b89b04df3a8a59 | itchio/butler,itchio/butler,itchio/butler | endpoints/downloads/downloads_retry.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\npackage proto defines a set of structures used to negotiate an update between an\nan application (the client) and an Equinox update service.\n*/\npackage proto\n\nimport \"time\"\n\ntype PatchKind string\n\nconst (\n\tPatchNone PatchKind ... | go | edit | 0 | 0 | mit | 74c3706d8e49b5c0bb31425a34d7051a5908bab5 | equinox-io/equinox | proto/proto.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"os/signal\"\n\t\"warcluster/config\"\n\t\"warcluster/entities/db\"\n\t\"warcluster/server\"\n)\n\nvar cfg config.Config\n\nfunc main() {\n\tgo final()\n\tdefer final()\n\n\tcfg.Load(\"config/config.gcfg\"... | go | edit | 0 | 1 | mit | 18c550cae2ed9778e4f1201be47b220561e0537b | WarCluster/warcluster-server,WarCluster/warcluster-server | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/lohmander/webapi\"\n)\n\nfunc handler(rw http.ResponseWriter, req *http.Request) {\n\tfmt.Fprintf(rw, \"Hello there\")\n}\n\nfunc main() {\n\tapi := webapi.NewAPI()\n\tapi.Ap... | go | edit | 0 | 1 | mit | 93c5d4600dbb6f41a739a30004876cd70b19b2a5 | lohmander/webapi | example/app.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stringutils\n\nimport (\n\t\"testing\"\n)\n\nvar forwardStrings = [...]string{`Hello`, `The quick brown 狐 jumped over the lazy 犬`, `1234567890`, `~!@#$%^&*()_+|\\`}\nvar backwardStrings = [...]string{`olleH`, `犬 yzal eht revo depmuj 狐 n... | go | edit | 3 | 3 | apache-2.0 | 31529fb556841790c5a7d8cdf3c5cf76e98706ba | rodneyxr/gohelper | stringutils/stringutils_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/helphone/importer/job\"\n\t\"github.com/robfig/cron\"\n)\n\nfunc refresh() {\n\tjob.PullRepo()\n\tjob.Refresh()\n}\n\nfunc main() {\n\tlog.Info(\"Importer stared\")\... | go | edit | 0 | 1 | mit | 53ec43d6cc4beb9c37dbd4a711dee1e254df3268 | helphone/importer,helphone/importer | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t_ \"github.com/gliderlabs/logspout/adapters/raw\"\n\t_ \"github.com/gliderlabs/logspout/adapters/syslog\"\n\t_ \"github.com/gliderlabs/logspout/httpstream\"\n\t_ \"github.com/gliderlabs/logspout/routesapi\"\n\t_ \"gi... | go | edit | 0 | 0 | mit | 0d29dc9d4953758779245515e69294d03f327cfc | iamatypeofwalrus/logspout-loggly,tbossert/logspout-loggly,iamatypeofwalrus/logspout-loggly,JohannWeging/logspout-loggly | modules.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 Jayson Grace. 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 main\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"strings\"\n\t\"... | go | edit | 6 | 2 | mit | 189c4bbc3cb2925cd40ff51af8bc7af6a09c59ab | l50/mass-wpscan,l50/mass-wpscan | common.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build darwin\n\npackage daemon\n\n/*\n#define __DARWIN_UNIX03 0\n#define KERNEL\n#define _DARWIN_USE_64_BIT_INODE\n#include <dirent.h>\n#include <fcntl.h>\n#include <sys/param.h>\n*/\nimport \"C\"\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)... | go | edit | 9 | 2 | mit | 298c54b0e0ae32ec2c6674fee8b60d2fefa4ae7e | sevlyar/go-daemon | lock_file_darwin.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright IBM Corp All Rights Reserved.\n\nSPDX-License-Identifier: Apache-2.0\n*/\n\npackage helpers\n\nimport (\n\t\"encoding/base32\"\n\t\"fmt\"\n\t\"strings\"\n\n\tdocker \"github.com/fsouza/go-dockerclient\"\n\t\"github.com/hyperledger... | go | edit | 9 | 3 | apache-2.0 | 16e1cbc2457fc62cc432909b611eb734f48beeab | stemlending/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric,manish-sethi/fabric,manish-sethi/fabric-sidedb,stemlending/fabric,manish-sethi/fabric-sidedb,jimthematrix/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric-sidedb,jimthematrix/fabric,hyperledger/fabric,hyperledger/fabric,manish-sethi/fabric-sidedb,ma... | integration/helpers/images.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 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 | 0 | 0 | apache-2.0 | 08b1b1da49c386bcb40df117aff00416ea36f392 | kubernetes-retired/cluster-registry,kubernetes-retired/cluster-registry | apis/federation/v1beta1/doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage http\n\nimport stdhttp \"net/http\"\n\n// HostProvider describes something which can yield hosts for transactions,\n// and record transaction success against a yielded host.\ntype HostProvider interface {\n\tGet() (host string, err erro... | go | edit | 6 | 3 | mit | 778dd0c3dc2a5428e581ab9c1f7b04d5b49c8ca9 | peterbourgon/srvproxy | http/proxying.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage socks5\n\nimport (\n\t\"net\"\n)\n\n// RuleSet is used to provide custom rules to allow or prohibit actions\ntype RuleSet interface {\n\t// AllowConnect is used to filter connect requests\n\tAllowConnect(dstIP *net.IPAddr, dstPort int, ... | go | edit | 0 | 1 | mit | 3c27508400dcf95b4db400ec2cdda76e76899e3e | armon/go-socks5,liuchg5/go-socks5,liuchg5/go-socks5,FlexibleBroadband/go-socks5,terry39/go-socks5,v2e4lisp/go-socks5,xiaokangwang/go-socks5,hvnsweeting/go-socks5 | ruleset.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build js\n\npackage select_menu\n\nimport (\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/gopherjs/gopherjs/js\"\n\t\"github.com/shurcooL/go/gopherjs_http/jsutil\"\n\t\"honnef.co/go/js/dom\"\n)\n\nfunc init() {\n\tjs.Global.Set(\"SelectMe... | go | edit | 0 | 3 | mit | 765c4a1e8b12aed5b110e6a0b0dc67a191f8cfd8 | shurcooL/frontend,shurcooL/frontend | select_menu/frontend.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage termite\n\nimport (\n\t\"fmt\"\n\t\"http\"\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\ntype masterStats struct {\n\tcounterMutex sync.Mutex\n\treceived *MultiResolutionCounter\n\n\trunning int32\n}\n\nfunc newMasterStats() *mas... | go | edit | 0 | 1 | bsd-3-clause | 2e40f383eb2bf9c4441cf69b0ae0c9f878b5eabb | hanwen/termite,hanwen/termite,hanwen/termite | termite/masterstats.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gocipher\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc TestVigenere(t *testing.T) {\n\ttext := \"TKSYMWRJGHKBPTEIKCYRWXIELQUPSUTLLGYFIKYIAVFNRLQFKVVSMBMJOCZGILSEAPZRGCVVHTVQYKXJSHARVIPCOGHXGZCGLQNEEXLPDQVXWBLVKCTRSVXYWUORPNEJKVYBROGI... | go | edit | 6 | 2 | mit | d5db3591c3c013b9fc575bb7e244bf3435527d6d | andrewarchi/gocipher | gocipher/vigenere_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage parser\n\nimport \"fmt\"\n\nfunc auto(input []byte) (interface{}, error) {\n\tfor _, name := range parseOrder() {\n\t\tif parsed, err := parsers[name].parse(input); err == nil {\n\t\t\treturn parsed, err\n\t\t}\n\t}\n\n\treturn nil, fmt... | go | edit | 9 | 3 | mit | 03a13bdbce7440955dab615aa2890338a21271a2 | stilvoid/please,stilvoid/please | parser/auto.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage defaults\n\nvar (\n\tPodTestImage = \"rancher/systemd-node:v0.0.2\"\n\tSomeK8sVersion = \"v1.21.1-rc1+k3s1\"\n\tWatchTimeoutSeconds = int64(60 * 10)\n\tCommonClusterConfig = map[string]interface{}{\n\t\t\"service-cidr\": \"1... | go | edit | 0 | 0 | apache-2.0 | 57ba39c3a59e02dfc3e6a4001451c7f6927d4467 | rancher/rancher,rancher/rancher,rancher/rancher,rancher/rancher | tests/integration/pkg/defaults/defaults.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage magicsql\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"./assert\"\n)\n\ntype Foo struct {\n\tONE string\n\tTwO int `sql:\",primary\"`\n\tThree bool `sql:\"tree\"`\n\tFour int\n\tFive int `sql:\"-\"`\n\tsix string\n}\n\nfunc n... | go | edit | 6 | 1 | cc0-1.0 | 403af2e6908dc997cda9731af13af8f5bac107d2 | Nerdmaster/magicsql | magic_table_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux darwin freebsd\n\npackage pb\n\nimport (\n\t\"runtime\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst (\n\tTIOCGWINSZ = 0x5413\n\tTIOCGWINSZ_OSX = 1074295912\n)\n\nfunc bold(str string) string {\n\treturn \"\\033[1m\" + str + \"\... | go | edit | 3 | 3 | bsd-3-clause | 28269e185376080856b4af26fb3ed069c47f922a | charignon/pb,satelliz/pb,sevki/pb,cheggaaa/pb,0x00evil/pb,mvo5/golang-pb,guaiguaihw/pb,gaowenbin/pb,harshavardhana/pb,yh453926638/pb | pb_nix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage user\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/asaskevich/govalidator\"\n\t\"github.com/vardius/go-api-boilerplate/internal/errors\"\n)\n\n// EmailAddress is an email address value object\ntype EmailAddress string\n\nfunc (e *E... | go | edit | 0 | 2 | mit | b2036e9206b61b4546def2ab35b83398e1046c43 | vardius/go-api-boilerplate,vardius/go-api-boilerplate,vardius/go-api-boilerplate | cmd/user/internal/domain/user/models.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t_ \"github.com/lib/pq\"\n\t\"log\"\n\t\"time\"\n)\n\nfunc connectToDatabase() {\n\tvar err error\n\tdriver := \"postgres\"\n\n\tconnect := fmt.Sprintf(\"dbname='%s' user='%s' password='... | go | edit | 18 | 3 | bsd-2-clause | 3b81151cba36032f175d3e21eca47995cb1bd810 | 1and1/soma | database_connection.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Albert Nigmatzianov. 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.\n\npackage id3v2\n\nimport (\n\t\"io\"\n\n\t\"github.com/bogem/id3v2/util\"\n)... | go | edit | 3 | 1 | mit | 1e106de4ea1789a593dfc207470e844f7b911e0a | bogem/id3v2 | unknown_frame.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage flagtypes\n\nimport (\n\t\"flag\"\n\n\t\"github.com/golang/glog\"\n\t\"github.com/spf13/pflag\"\n)\n\n// GLog binds the log flags from the default Google \"flag\" package into a pflag.FlagSet.\nfunc GLog(flags *pflag.FlagSet) {\n\tfrom ... | go | edit | 0 | 5 | apache-2.0 | 82aeb4d2bd62f964636ba0b3e69a0354b139780f | rajatchopra/origin,mkumatag/origin,maxamillion/origin,linzhaoming/origin,kargakis/origin,liangxia/origin,goern/origin,goern/origin,hferentschik/origin,imcsk8/origin,ironcladlou/origin,luciddreamz/origin,aveshagarwal/origin,soltysh/origin,mdshuai/origin,liggitt/origin,wjiangjay/origin,csrwng/origin,gabemontero/origin,mi... | pkg/cmd/flagtypes/glog.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"encoding/json\"\n \"fmt\"\n \"github.com/gwwfps/lolconf-probe/display\"\n \"github.com/natefinch/npipe\"\n \"log\"\n \"net/http\"\n)\n\ntype handler func(http.ResponseWriter, *http.Request)\ntype inner func() ... | go | edit | 0 | 3 | mit | 8d7da78a9a3322371bfbd34f6a2451c5a455197e | gwwfps/lolconf-probe | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage router\n\nimport (\n\t\"net/http\"\n\t\"log\"\n\t\"io/ioutil\"\n)\n\nfunc testRequest(targetUrl string, expectedResponse string) {\n\tresp, err := http.Get(targetUrl)\n\tif (err != nil) {\n\t\tlog.Panic(\"failed make get request\")\n\t}... | go | edit | 0 | 5 | apache-2.0 | 322ca405f6f08b72fd36e826b8f650eb7076905a | fission/fission,ktrance/fission,life1347/fission,ktrance/fission,ktrance/fission,life1347/fission,life1347/fission,life1347/fission,fission/fission,fission/fission,life1347/fission,platform9/fission,life1347/fission,fission/fission,platform9/fission,life1347/fission,ktrance/fission,life1347/fission,ktrance/fission,plat... | src/router/util_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n fmt.Println(\"Initializing Octave CPU...\")\n\n file, err := os.Open(\"hello.bin\")\n\n if err != nil {\n return\n }\n\n defer file.Close()\n\n sta... | go | edit | 0 | 9 | mit | 4c85696bfeba91b47eed13b07be47428920a7cac | campaul/octave,campaul/octave | octave.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage verstr\n\nimport (\n\t\"testing\"\n)\n\nfunc TestLess(t *testing.T) {\n\tvar tests = []struct {\n\t\tleft, right string\n\t\twant bool\n\t}{\n\t\t{\"file.0.ext\", \"file.1.ext\", true},\n\t\t{\"file.1.ext\", \"file.0.ext\", false... | go | edit | 3 | 3 | apache-2.0 | fc6a90f42586220e08330441c26bbf7028adf3c9 | Symantec/Dominator,rgooch/Dominator,keep94/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator | lib/verstr/less_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage helpers_test\n\nimport (\n\t\"crypto/rand\"\n\t\"errors\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/pivotal-cf-experimental/bosh-bootloader/fakes\"\n\t\"github.com/pivotal-cf-experimental/bosh-boo... | go | edit | 24 | 1 | apache-2.0 | f5bd9eb728b0ce6a0e68440b37ee2ffd4547762b | pivotal-cf-experimental/bosh-bootloader,niroyb/bosh-bootloader,niroyb/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader | helpers/env_id_generator_test.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage renderer_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/diyan/assimilator/testutil/fixture\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestServerSideTemplateRenderer_Get(t *testing.T) {\n\tclient, factory := fixture.Setup(... | go | edit | 0 | 1 | mit | 1144b7a41b6c7479d13385ea328148517fa52664 | diyan/assimilator,diyan/assimilator,diyan/assimilator | web/renderer/renderer_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage template\n\nimport (\n\t\"bytes\"\n\t\"text/template\"\n\n\t\"github.com/Masterminds/sprig\"\n)\n\nfunc Apply(contents []byte, variables map[string]string) ([]byte, error) {\n\tt, err := template.New(\"template\").Funcs(sprig.TxtFuncMap... | go | edit | 0 | 4 | apache-2.0 | 5d1e17aa1be766623114ba05d35299d926e29445 | carolynhu/rancher-compose-executor,carolynhu/rancher-compose-executor,carolynhu/rancher-compose-executor,rancher/rancher-compose-executor,rancher/rancher-compose-executor,rancher/rancher-compose-executor | template/template.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ehttp\n\nimport (\n\t\"net/http\"\n\t\"sync/atomic\"\n)\n\n// ResponseWriter wraps http.ResponseWriter and holds\n// a flag to know if the headers have been sent as well has\n// the http code sent.\ntype ResponseWriter struct {\n\thttp.... | go | edit | 0 | 2 | mit | 1f610e66faf5898f8b020be139acb83a3c674175 | creack/ehttp | responsewriter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport ()\n\ntype statistics struct {\n\tinDummy int\n\tinMail int\n\tinEnc int\n\tinRemFoo int\n\toutDummy int\n\toutMail int\n\toutEnc int\n\toutLoop int\n\toutRandhop int\n\toutPlain int\n}\n\nfunc... | go | edit | 0 | 1 | mit | 619222b5366b34ebc22844e4b61620d3219cefe5 | crooks/yamn,crooks/yamn | stats.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2012 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\npackage main\n\nimport (\n \"flag\"\n\t\"log\"\n\t\"syscall\"\n)\n\nvar... | go | edit | 0 | 4 | bsd-3-clause | 91e0646aa5c401def8a8430b6ffd56b83fe13181 | rminnich/u-root,hugelgupf/u-root,u-root/u-root,hugelgupf/u-root,hugelgupf/u-root,rminnich/u-root,GanShun/u-root,rminnich/u-root,GanShun/u-root,GanShun/u-root,rminnich/u-root,u-root/u-root,u-root/u-root,hugelgupf/u-root | src/cmds/mount/mount.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage setup\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n\n\t\"github.com/mholt/caddy/config/parse\"\n\t\"github.com/mholt/caddy/middleware\"\n\t\"github.com/mholt/caddy/server\"\n)\n\n// NewTestController creates a new *Controller ... | go | edit | 6 | 1 | apache-2.0 | 3d1cac313c0a47b82969ebbdca0bec1e0afae10f | hackintoshrao/caddy,mem/caddy,tw4452852/caddy,liufuqiang/caddy,evermax/caddy,Karthic-Hackintosh/caddy,pschlump/caddy,dusty/caddy,yukimochi/caddy,tobya/caddy,cez81/caddy,mem/caddy,guilhermebr/caddy,Karthic-Hackintosh/caddy,pschlump/caddy,pedronasser/caddy,cez81/caddy,pyed/caddy,lukw00/caddy,yukimochi/caddy,dusty/caddy,b... | config/setup/controllertest.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sh\n\nimport \"testing\"\n\nfunc TestFunctionsClosures(t *testing.T) {\n\tfor _, test := range []execTestCase{\n\t\t{\n\t\t\tdesc: \"simpleClosure\",\n\t\t\texecStr: `\n\t\t\t\tfn func(a) {\n\t\t\t\t\tfn closure() {\n\t\t\t\t\t\tprint($... | go | edit | 6 | 2 | apache-2.0 | cf19de96d7bd4fb27507457ed5c66d6a88390e40 | NeowayLabs/nash,NeowayLabs/nash | internal/sh/functions_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handlers\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\n\t\"github.com/sirupsen/logrus\"\n\n\t\"github.com/ivan1993spb/snake-server/connections\"\n)\n\nconst URLRouteGetCapacity = \"/capacity\"\n\nconst MethodGetCapacity = http.Met... | go | edit | 3 | 2 | bsd-2-clause | 1c1c9163721967838cbfe31c425ff134b92d68c8 | ivan1993spb/clever-snake | handlers/get_capacity_handler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage uniq\n\nimport \"sort\"\n\ntype Interface sort.Interface\n\nfunc Ue(data Interface) int {\n\tlen := data.Len()\n\ti, j := 0, 1\n\t// find the first duplicate\n\tfor j < len && data.Less(i, j) {\n\t\ti++\n\t\tj++\n\t}\n\t// this loop is ... | go | edit | 0 | 6 | mit | ea9e6806e8f708aee08267b358de0cb6e9990925 | infogulch/uniq | uniq.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 Canonical Ltd.\n// Licensed under the AGPLv3, see LICENCE file for details.\n\npackage utils\n\nimport (\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"launchpad.net/juju-core/juju/osenv\"\n)\n\n// NormalizePath replac... | go | edit | 0 | 5 | bsd-3-clause | 397443bc34f1cfa19deb9f393814f427b54ebb37 | rogpeppe/juju-utils,dimitern/utils | file.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage extension\n\nimport (\n\t\"fmt\"\n\t\"github.com/kayex/sirius\"\n\t\"golang.org/x/net/context\"\n\t\"googlemaps.github.io/maps\"\n)\n\ntype Geocode struct {\n\tAPIKey string\n}\n\nfunc (x *Geocode) Run(m sirius.Message, cfg sirius.Exten... | go | edit | 0 | 4 | mit | 419fdd21b5a201768c880ac88411bc753e3d529a | kayex/sirius | extension/geocode.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright © 2009-2010 Esko Luontola <www.orfjackal.net>\n// This software is released under the Apache License 2.0.\n// The license text is at http://www.apache.org/licenses/LICENSE-2.0\n\npackage gospec\n\nimport (\n\t\"fmt\"\n\tfilepath \"... | go | edit | 0 | 2 | apache-2.0 | 11f364e365f79267087c6769ed90969bf4509bf4 | orfjackal/gospec,orfjackal/gospec,orfjackal/gospec | src/gospec/location.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"crypto\"\n\t\"crypto/ecdsa\"\n\t\"crypto/elliptic\"\n\t\"crypto/rand\"\n\t\"crypto/x509\"\n\t\"encoding/pem\"\n\t\"errors\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc generatePrivateKey(file string) (crypto.PrivateKey, ... | go | edit | 0 | 4 | mit | d46b0db199079c884fbca77f5928c0e7c3f2ab0c | xenolf/lego,fxposter/lego,xenolf/lego | crypto.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/urfave/cli\"\n)\n\nvar (\n\trmiDescription = \"Removes one or more locally stored images.\"\n\trmiCommand = cli.Command{\n\t\tName: \"rmi\",\n\t\tUsage: \"Removes one or mor... | go | edit | 3 | 5 | apache-2.0 | 3b51b1092964758473c57e0cf8044bb19ba881cf | TomSweeneyRedHat/buildah,nalind/buildah,projectatomic/buildah,nalind/buildah-1,nalind/buildah-1,nalind/buildah,ipbabble/buildah,rhatdan/buildah,rhatdan/buildah,TomSweeneyRedHat/buildah,nalind/buildah-1,projectatomic/buildah,projectatomic/buildah,rhatdan/buildah,TomSweeneyRedHat/buildah,ipbabble/buildah | cmd/buildah/rmi.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n)\n\n// Create a logger with the given prefix\nfunc CreateLogger(prefix string) *log.Logger {\n\treturn CreateLoggerWithWriter(os.Stderr, prefix)\n\t// return log.New(os.Stderr... | go | edit | 0 | 2 | mit | 3396a1fd483909794ac12651b6f04541581ae680 | gruntwork-io/terragrunt,gruntwork-io/terragrunt,tamsky/terragrunt,tamsky/terragrunt | util/logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\nvar (\n\tconfigPath string\n)\n\nfunc init() {\n\tflag.StringVar(\n\t\t&configPath,\n\t\t\"config\",\n\t\t\"config.toml\",\n\t\t\"path to configuration file; support... | go | edit | 9 | 5 | apache-2.0 | 5d939572d7fa28f6a95c5d4f2bdd0c6a92181976 | HuKeping/notary,HuKeping/notary,docker/notary,HuKeping/notary,docker/notary,docker/notary | cmd/escrow/main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2020 Georg Großberger <<EMAIL>>\n// This is free software; it is provided under the terms of the MIT License\n// See the file LICENSE or <https://opensource.org/licenses/MIT> for details\n\npackage browser\n\nvar files = []string{\... | go | edit | 0 | 0 | mit | b816d6dc57896aa718dff4fb1c38b7fb39ad3857 | garfieldius/t3ll,garfieldius/t3ll,garfieldius/t3ll | browser/lookup_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage kata\n\nimport \"testing\"\n\nfunc TestGutterGame(t *testing.T) {\n\tvar game Game = Game {0}\n\tfor i := 0; i < 20; i++ {\n\t\tgame.roll(0)\n\t}\n\tif game.score() != 0 {\n\t\tt.Errorf(\"Game.score() for a 0 pins game expect 0, got %d\... | go | edit | 6 | 2 | mit | 87cbefb8049aff3dbe761a093ad15e65f9ac6a46 | darkrodry/3languages2months,darkrodry/3languages2months,darkrodry/3languages2months,darkrodry/3languages2months | go/kata/game_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\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tflHelp bool\n)\n\nfunc main() {\n\tflag.BoolVar(&flHelp, \"h\", false, \"Print this message and quit\")\n\tflag.BoolVar(&flHelp, \"-help\", false, \"Print this message and... | go | edit | 3 | 2 | mit | 82403a1886b4797fc72b9aea41fa3d6d00c85010 | kubosho/md2ghost | md2ghost.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage MySQLProtocol\n\ntype Context struct {\n\tcapability uint64\n}\n\n```\n\nApply this change: Add in the session prepared_statements into the context object"
},
{
"role": "assistant",
"content": "package MySQLProtocol\n\ntype ... | go | edit | 3 | 0 | mit | 8e113dd2d95953f6035dda3710d03aee1f584053 | MPjct/GoMP | MySQLProtocol/Context.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lib\n\nimport \"testing\"\n\nfunc TestReverse(t *testing.T) {\n\tvar got, expect string\n\tgot = Reverse(\"asdf\")\n\texpect = \"fdsa\"\n\tif got != expect {\n\t\tt.Error(\"Expected \", expect, \", got \", got)\n\t}\n}\n\n```\n\nApply t... | go | edit | 3 | 3 | apache-2.0 | 224bd188d1fb0dab3684f4ddd973b73439b66c86 | freiny/go-show | lang/test/testFunc/lib_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux !cgo !seccomp\n\npackage patchbpf\n\nimport (\n\t\"errors\"\n\n\t\"github.com/opencontainers/runc/libcontainer/configs\"\n\n\tlibseccomp \"github.com/seccomp/libseccomp-golang\"\n)\n\nfunc PatchAndLoad(config *configs.Seccomp, ... | go | edit | 0 | 0 | apache-2.0 | c4bc3b080eaf57ed3558200d0ca386e18c2331f7 | rhatdan/runc,dqminh/runc,dqminh/runc,rhatdan/runc,estesp/runc,kolyshkin/runc,rhatdan/runc,opencontainers/runc,opencontainers/runc,opencontainers/runc,kolyshkin/runc,opencontainers/runc,rhatdan/runc,dqminh/runc,estesp/runc,estesp/runc,kolyshkin/runc,dqminh/runc,kolyshkin/runc | libcontainer/seccomp/patchbpf/enosys_unsupported.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 Arne Roomann-Kurrik\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://... | go | edit | 0 | 4 | apache-2.0 | ea39027b0f11f3d18c30f9107308f940732e1f35 | kurrik/twodee,pikkpoiss/twodee,kurrik/twodee,pikkpoiss/twodee | geometry.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nuget\n\nconst Description = \"Run NuGet.\"\n\nvar Usage = []string{`jfrog rt nuget [command options] <nuget args> <source repository name>`}\n\nconst Arguments string = `\tnuget args\n\t\tArguments to run with NuGet command.\t\n\n\tsou... | go | edit | 0 | 0 | apache-2.0 | c5d3f318324df370c4d30c249e39cd0675d0d7ae | JFrogDev/jfrog-cli-go,JFrogDev/jfrog-cli-go,JFrogDev/jfrog-cli-go,JFrogDev/jfrog-cli-go | jfrog-cli/docs/artifactory/nuget/help.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage formatter\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/docker/docker/api/types/swarm\"\n)\n\n//FormatPorts returns the string representation of the given PortConfig\nfunc FormatPorts(ports []swarm.PortConfig) string {\n\tresu... | go | edit | 0 | 2 | mit | 519db61795ec27a909dd67809e36d63b980ecc83 | moncho/dry,moncho/dry | docker/formatter/swarm.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The Hugo Authors. All rights reserved.\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\... | go | edit | 3 | 2 | apache-2.0 | 0946630715088d486ab8b7204f0945e755e9b934 | mitchchn/hugo,mdhender/hugo,gohugoio/hugo,anthonyfok/hugo,fedelibre/hugo,mdhender/hugo,anthonyfok/hugo,mdhender/hugo,fedelibre/hugo,mitchchn/hugo,digitalcraftsman/hugo,gohugoio/hugo,digitalcraftsman/hugo,fedelibre/hugo,gohugoio/hugo,anthonyfok/hugo,mdhender/hugo,fedelibre/hugo | hugolib/path_separators_windows_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 The goyy Authors. 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.\n\npackage entity\n\nimport (\n\t\"gopkg.in/goyy/goyy.v0/util/bytes\"\n)\n\ntype... | go | edit | 9 | 3 | mit | 76763538b8b6665a13640fd448eabf0321676b09 | goyy/goyy,goyy/goyy,goyy/goyy,goyy/goyy | data/entity/core_type_string.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage polynomial\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"strings\"\n)\n\ntype Point struct {\n\tx, y *big.Int\n}\n\ntype Points []Point\n\nfunc (p Point) String() string {\n\treturn fmt.Sprintf(\"(%v, %v)\", p.x, p.y)\n}\n\nfunc (ps Point... | go | edit | 0 | 2 | mit | 899d607a80d53ba648cee816089fddbb00acc9a7 | jongukim/polynomial | point.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright © 2009--2013 The Web.go Authors\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage web\n\nimport (\n\t\"encoding/json\"\n\t\"encoding/xml\"\n\t\"io\"\n)\n\n// Encode... | go | edit | 0 | 1 | mit | a32ab04e934de851e94092b831d8f88531de6371 | hraban/web | encoders.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage matchers\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/onsi/gomega/format\"\n)\n\ntype HaveOccurredMatcher struct {\n}\n\nfunc (matcher *HaveOccurredMatcher) Match(actual interface{}) (success bool, err error) {\n\t// is purely nil?\n\tif ac... | go | edit | 6 | 3 | mit | e0d4387cf37d6cc3baeb80f61bd24a37e5dfae26 | onsi/gomega | matchers/have_occurred_matcher.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sqlxurl\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\t\"github.com/jmoiron/sqlx\"\n)\n\nfunc Connect() (*sqlx.DB, error) {\n\treturn ConnectToURL(os.Getenv(\"DATABASE_URL\"))\n}\n\nfunc ConnectToURL(s string) (c *sql... | go | edit | 0 | 6 | mit | 7571155920b16b3715906952b6da53276dd7c6aa | josegonzalez/go-sqlxurl | sqlxurl.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2019 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 | 0 | 3 | apache-2.0 | bdf6934665294667d1355baeb2d688cf450b1ed6 | BenTheElder/test-infra,jessfraz/test-infra,fejta/test-infra,monopole/test-infra,fejta/test-infra,brahmaroutu/test-infra,monopole/test-infra,cblecker/test-infra,brahmaroutu/test-infra,michelle192837/test-infra,cblecker/test-infra,fejta/test-infra,kubernetes/test-infra,pwittrock/test-infra,dims/test-infra,BenTheElder/tes... | config/tests/lint/config_lint_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2012 Apcera Inc. All rights reserved.\n\npackage nats\n\nimport (\n\t\"encoding/json\"\n)\n\n// A JSON Encoder implementation for EncodedConn\n// This encoder will use the builtin encoding/json to Marshal\n// and Unmarshal most typ... | go | edit | 0 | 5 | mit | 4dc0d5b364f9e85d5786e974805dafe2ba1ad8b2 | ZebinKang/go-nats,wallyqs/go-nats,Lanzafame/nats,ActiveState/nats,apcera/nats,nats-io/go-nats,dnascimento/nats,the-control-group/nats,nats-io/nats,the-control-group/nats,nats-io/nats,apcera/nats,wallyqs/nats,wallyqs/go-nats,ZebinKang/go-nats,nats-io/go-nats,chzyer-dev/nats,aforward/nats,dnascimento/nats,pires/nats,pire... | json_enc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"log\"\n\t\"net/url\"\n\t\"os/exec\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tflag.Parse()\n\n\t//If the number of arguments is zero, exit the main() function\n\tif flag.NArg() == 0 {\n\t\t... | go | edit | 0 | 7 | mit | 7dcd6ece9f1eca850a3b0080babc9e79ead42b31 | hariharan-uno/google | google.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage thrift\n\nimport (\n\t\"github.com/cyberdelia/statsd\"\n\t\"log\"\n\t\"os\"\n)\n\nvar (\n\tMetrics *Metric = NewMetric(os.Getenv(\"STATSD_URL\"))\n)\n\ntype Metric struct {\n\tclient *statsd.Client\n}\n\nfunc NewMetric(statsdURL string)... | go | edit | 0 | 3 | apache-2.0 | 96b6a23c8ff08ebf02d3365dde450957029ec02a | upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift,upfluence/thrift | lib/go/thrift/metrics.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bagutil\n\nimport (\n\t\"crypto/md5\"\n\t\"crypto/sha1\"\n\t\"crypto/sha256\"\n\t\"crypto/sha512\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\n// Takes a filepath as a string and produces a checksum.\nfunc File... | go | edit | 0 | 5 | apache-2.0 | f89309fd5a7d91c3e05cfb4af328ca20b25ff160 | APTrust/bagins | bagutil/files.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage chat\n\ntype (\n\tTextComponent struct {\n\t\tText string `json:\"text\"`\n\n\t\tComponent\n\t}\n\n\tTranslateComponent struct {\n\t\tTranslate string `json:\"translate\"`\n\t\tWith []string `json:\"with\"`\n\n\t\tComponent\n\t}\... | go | edit | 9 | 0 | mit | b061d164bbf304307420c8f546868000338957df | ttaylorr/minecraft | chat/component.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage conf\n\nimport (\n\t\"github.com/namsral/flag\"\n)\n\nvar Port int\n\nfunc Init() {\n\tflag.IntVar(&Port, \"port\", 3000, \"port of brandy\")\n\tflag.IntVar(&Port, \"p\", 3000, \"port of brandy\")\n\tflag.Parse()\n}\n\n```\n\nApply this... | go | edit | 0 | 3 | mit | a4de2c82f0d680f06b9c840ff710d014f75e7e36 | miclle/brandy | src/brandy/conf/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"flag\"\n\n\t\"github.com/driusan/dgit/git\"\n)\n\nfunc DiffIndex(c *git.Client, args []string) error {\n\tflags := flag.NewFlagSet(\"diff-index\", flag.ExitOnError)\n\n\toptions := git.DiffIndexOptions{}\n\tflags.Bo... | go | edit | 6 | 4 | mit | fc009925671c235be04231476629f29118302039 | driusan/dgit,driusan/dgit | cmd/diffindex.go | rejected_lint | Too many lint violations: 6 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.