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\"net/http\"\n\t\"strings\"\n)\n\nvar (\n\t// Whitelist crawlers here\n\tcrawlerPatterns = [...]string{\n\t\t\"Googlebot\",\n\t\t\"bingbot\",\n\t\t\"MSNbot\",\n\t\t\"facebookexternalhit\",\n\t\t\"PlurkBot\",\n\t}\n)\...
go
edit
0
3
mit
4b21e735188370b9e328df073956c419af79d27d
ptt/pttweb
useragent.go
rejected_duplicate
Near-duplicate of sample 117384
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/relab/raft/raftgorums\"\n)\n\nfunc main() {\n\tvar path = flag.String(\"path\", \"\", \"path to bolt storage\")\n\tflag.Parse()\n\n\tif len(*path) == 0 {\n\t...
go
edit
0
6
mit
36fd44f3b088f9b9f1c75dbcb43bc51ecdcaa2c1
s111/rkv,s111/rkv
cmd/printboltdb/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build go_get\n\n// When assets.go is being excluded from the build, it's symbols are undefined\n// and 'go get' gets upset. Add this stub with inversed build condition to\n// compensate.\n\npackage main\n\ntype AssetBin struct {\n\troot str...
go
edit
0
1
bsd-2-clause
ceeae3bc2b6e575a3df90b2cf7c6a7ee64dae51b
rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog
src/assets_stub.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage errors\n\nimport \"errors\"\n\nvar (\n\t// ErrUserNotFound when not found.\n\tErrUserNotFound = errors.New(\"No user found\")\n\t// ErrUserNotUpdated when not updated.\n\tErrUserNotUpdated = errors.New(\"User not updated\")\n\t// ErrUse...
go
edit
0
0
mit
5dd14c1ffe9dd8419f63977107df2c15e9905e6f
thermokarst/bactdb,thermokarst/bactdb
errors/users.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/httputil\"\n\t\"net/url\"\n\n\tdocker \"github.com/fsouza/go-dockerclient\"\n)\n\ntype DestinationMap map[string]*Destination\n\ntype Destination struct {\n\ttargetUrl *url.URL\n\tproxy *htt...
go
edit
0
3
mit
8b6f66ebad4e2ce4bb48c54ede2b5a46f76690b8
sosedoff/docker-gateway
destination.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main_test\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os/exec\"\n\t\"testing\"\n\n\t\"github.com/onsi/gomega/gexec\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nfunc TestTrackercli(t *testing.T) {\n\tRegiste...
go
edit
27
1
mit
dead25b941238e970350cc0b0fb3af1e8f14f3f3
kkallday/tracker-cli,kkallday/tracker-cli
main_suite_test.go
rejected_lint
Too many lint violations: 27
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net\"\n\n\t\"github.com/paultag/go-dictd/database\"\n\t\"github.com/paultag/go-dictd/dictd\"\n)\n\nfunc main() {\n\tserver := dictd.NewServer(\"pault.ag\")\n\tlevelDB, err := database.NewLevelDBDatabase(...
go
edit
0
4
mit
c6ed4019f34a6de425c0023b50ce6df5569e1aba
paultag/go-dictd
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/albrow/scribble/util\"\n\t\"gopkg.in/alecthomas/kingpin.v1\"\n\t\"os\"\n)\n\nvar (\n\tapp = kingpin.New(\"scribble\", \"A tiny static blog generator written in go.\")\n\n\tserveCmd = app.Command(\"serve...
go
edit
15
4
mit
e5553423ab4d7070ccfcd5303e529869c7c46c5e
albrow/scribble,albrow/scribble
main.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage hostname\n\nimport (\n\t\"testing\"\n)\n\nfunc TestReverse(t *testing.T) {\n\tconst hostname_in, hostname_out = \"test.a.is.this\", \"this.is.a.test\"\n\n\tif x := Reverse(hostname_in); x != hostname_out {\n\t\tt.Errorf(\"Reverse(%v) = ...
go
edit
6
2
apache-2.0
ef9cd59b9d33131faaa321b406bc193520ffc6fa
imeyer/go-utilities
hostnameutils/hostnameutils_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sillyquill_rt\n\nimport \"fmt\"\n\ntype UnknownColumnError struct {\n\tIndex int\n\tName string\n}\n\nfunc (this UnknownColumnError) Error() string {\n\treturn fmt.Sprintf(\"unknown column %q at position %d\", this.Name, this.Index)\n}...
go
edit
0
1
bsd-2-clause
940167be14e98042bbcb89f45693424b253669cb
hydrogen18/sillyquill,hydrogen18/sillyquill
rt/errors.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !windows\n\npackage msi\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/itchio/butler/butler\"\n)\n\nfunc Info(ctx *butler.Context, msiPath string) {\n\treturn fmt.Errorf(\"msi-info is a windows-only command\")\n}\n\nfunc ProductInfo(ctx *bu...
go
edit
0
1
mit
b4cfe22bf39a0f9ae5e61abe99be0e28f0f7f3e2
itchio/butler,itchio/butler,itchio/butler
cmd/msi/impl_stub.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/hoisie/mustache\"\n \"github.com/hoisie/web\"\n \"github.com/russross/blackfriday\"\n \"io/ioutil\"\n \"log\"\n \"os\"\n)\n\ntype Entry struct {\n Title string\n Body string...
go
edit
0
3
bsd-2-clause
b4571a99d363aa2239451e516b21a18d6b83603b
rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog,rtfb/rtfblog
rtfblog.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"encoding/json\"\n)\n\ntype SSEString string\n\nfunc (s SSEString) ParseHystrixStream() (HystrixStream, error) {\n\t// The eventsource string isn't big short circuit\n\tif len(s) < 8 {\n\t\treturn Hyst...
go
edit
9
4
mit
44f30fbcacc4bd32ae93b68e4e80ec8a1d27420a
hatchery/cbdb,hatchery/cbdb
aggregator/sse.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nvar (\n\t// name of the application\n\tname = currentFolderName()\n\n\t// version of the application\n\tversion = gitVersion()\n)\n\nfunc main() {\n\tc := defaultConfig()\n\treadOrSaveConfig(c)\n\n\tfor _, targ...
go
edit
21
2
mit
f304caf15cb6a230c94de501e85caaa43ff04189
samherrmann/gowrap
main.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage atlas\n\nimport (\n\t\"fmt\"\n\t\"reflect\"\n)\n\nfunc Build(entries ...AtlasEntry) (Atlas, error) {\n\tatl := Atlas{\n\t\tmappings: make(map[uintptr]*AtlasEntry),\n\t}\n\tfor _, entry := range entries {\n\t\trtid := reflect.ValueOf(ent...
go
edit
15
3
mit
8d93bc04ad598c95ce9901a73eb7a6840c49fd78
polydawn/go-xlate,polydawn/refmt,polydawn/go-xlate,polydawn/refmt
obj2/atlas/atlasBuilding.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/* Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this fi...
go
edit
6
2
apache-2.0
2b7c194297dc87af6abd14338d885970926f206a
nwellnhof/lucy,kidaa/lucy,kidaa/lucy,pombredanne/apache-lucy,rbevers/lucy,rbevers/lucy,apache/lucy,kidaa/lucy,rbevers/lucy,nwellnhof/lucy,apache/lucy,rectang/lucy,nwellnhof/lucy,apache/lucy,rbevers/lucy,rbevers/lucy,pombredanne/apache-lucy,apache/lucy,nwellnhof/lucy,rectang/lucy,nwellnhof/lucy,pombredanne/apache-lucy,p...
go/lucy/lucy_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage app_test\n\nimport (\n\t\"github.com/julienbayle/jeparticipe/app/test\"\n\t\"github.com/stretchr/testify/assert\"\n\n\t\"testing\"\n)\n\nfunc TestApp(t *testing.T) {\n\tjeparticipe, handler, event := apptest.CreateATestApp()\n\tdefer ap...
go
edit
15
1
mit
409bdd79ef2b91673693f66282b66c9621a65aa1
julienbayle/jeparticipe,julienbayle/jeparticipe
app/app_test.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\ntype Counter int\n\nfunc Hook(n *Counter) {\n\t*n++\n\tfmt.Print(*n)\n}\n\n```\n\nApply this change: Remove type alias for int\n\nThe type alias doesn't add much to the program's clarity. Some readers\nmight t...
go
edit
0
1
unlicense
1c2859b3c72d7bc09c6f4fa037d224c588db68ae
Hookscript/lang-go,Hookscript/lang-go
t/state-counter.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage talks\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\tassert \"github.com/stretchr/testify/require\"\n)\n\nfunc TestCompile(t *testing.T) {\n\ttalk, err := Compile(\"../content\", \"../content/talks-drafts\", \"paradise-lost.yaml\", true)\n\...
go
edit
3
3
mit
3e788dd8d9ed64eabc3e88b810bc4122f0bab94a
brandur/sorg,brandur/sorg,brandur/sorg,brandur/sorg,brandur/sorg
talks/talks_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gamerules\n\nfunc init() {\n\tif err := LoadGameRules(\"blocks.json\", \"items.json\", \"recipes.json\", \"furnace.json\", \"users.json\", \"groups.json\"); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n```\n\nApply this change: Fix gamerules...
go
edit
3
2
mit
0fb1b9947b3720811a66f69e8f652a7257deea41
huin/chunkymonkey,huin/chunkymonkey
gamerules/gamerules_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage viz\n\nimport \"testing\"\n\nfunc Test_Show(test *testing.T) {\n\tShow(\"testgraph.json\", \"testgraph.010\", \"testgraph.010.dot\")\n}\n\n```\n\nApply this change: Update Show, for not opening" }, { "role": "assistant", "co...
go
edit
0
1
mit
583a543834ae22e62215d7e09246c6cb29201d9f
gale320/goraph,hsavit1/goraph,gyuho/goraph,gyuho/goraph
viz/viz_example_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright © 2017 Makoto Ito\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://www.apa...
go
edit
0
2
apache-2.0
413ba4fae778384cd5501767593c764ee4db54ac
ynqa/word-embedding,ynqa/word-embedding
utils/count.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mail\n\nimport (\n \"bytes\"\n \"text/template\"\n)\n\nconst emailTemplate = `{{range .Headers}}{{.}}\n{{end}}From: {{.From}}{{if .ReplyTo}}\nReply-To: {{.ReplyTo}}{{end}}\nTo: {{.To}}\nSubject: {{.Subject}}\nMIME-Version: 1.0\nCo...
go
edit
0
3
apache-2.0
b34c0d75777d42027a57bff9b172ee3ffd765e41
cloudfoundry-incubator/notifications,cloudfoundry-incubator/notifications
mail/message.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/jbowtie/ratago/xslt\"\n\t\"github.com/moovweb/gokogiri\"\n\t\"github.com/moovweb/gokogiri/xml\"\n\t\"io/ioutil\"\n)\n\nfunc xmlReadFile(filename string) (doc *xml.XmlDocument, err ...
go
edit
0
4
mit
3906d341c1eb707ef9684df55051682b83571147
jbuchbinder/ratago,jbowtie/ratago
ratago.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"flag\"\n \"fmt\"\n \"os\"\n \"github.com/lestrrat/go-xslate\"\n)\n\nfunc usage() {\n fmt.Fprintf(os.Stderr, \"usage: xslate [options...] [input-files]\\n\")\n flag.PrintDefaults()\n os.Exit(2)\n}\n\nfunc main...
go
edit
3
5
mit
8cbf5b0f35478eeb748c4593f583e4996f3da562
lestrrat/go-xslate,lestrrat/go-xslate
cli/xslate/xslate.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gopherchan\n\nimport (\n \"net\"\n \"net/url\"\n\n \"github.com/ohrite/gopher\"\n)\n\ntype Server struct {\n Port string\n Dispatcher func(net.Conn, *gopher.Request)\n\n gopherServer *gopher.Server\n}\n\nfunc NewServer(port string...
go
edit
0
2
mit
448b9181662341e1472283370ffa2c1a78d09ff2
ohrite/gopherchan
gopherchan/server.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nvar pathToKeyTests = []struct {\n\tkey string\n\tprefix string\n\texpected string\n}{\n\t{\"/nginx/port\", \"\", \"nginx_port\"},\n\t{\"/prefix/nginx/port\", \"/prefix\", \"nginx_port\"},\n\t...
go
edit
3
3
mit
96c8ffd790b147f309ad9c74e9e7a8a8169906fd
crandles/confd,Lineberty/confd,tomdee/confd,agilemobiledev/confd,elbidigital/confd,Flipkart/confd,Flipkart/confd,chendh521/confd,say5/confd,RichardKnop/confd,crunchywelch/confd,cloudnautique/confd,zytek/confd,Lineberty/confd,cloudnautique/confd,glerchundi/confd,bacongobbler/confd,blippar/confd,okushchenko/confd,mboersm...
etcd_client_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage newrelic\n\nimport \"github.com/newrelic/go-agent\"\n\n// NullNewRelic returns a disabled New Relic appliaction.\nfunc NullNewRelic() newrelic.Application {\n\tconfig := newrelic.NewConfig(\"smsprocessor\", \"\")\n\tconfig.Enabled = fal...
go
edit
9
1
mit
f7176693b242d5f3cd2c3638286145699db243f8
gofury/gofury
newrelic/helpers.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\"fmt\"\n\t\"time\"\n\t\"sync\"\n)\n\nfunc worker(id int, jobs <-chan int, results chan<- int) {\n\tfor j := range jobs {\n\t\tfmt.Println(\"worker\", id, \"processing job\", j)\n\t\ttime.Sleep(time.Second)\n\t\tresu...
go
edit
0
4
mit
d905929df63a61d3ceff524c0ce55dcccf538d75
icambridge/go-playground
goroutines.go
rejected_duplicate
Near-duplicate of sample 117667
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"testing\"\n\nfunc TestTree(*testing.T) {\n\tnodes := []treeNode{\n\t\t{\"F\", \"H\", []string{}},\n\t\t{\"F\", \"I\", []string{}},\n\t\t{\"F\", \"J\", []string{}},\n\t\t{\"A\", \"B\", []string{}},\n\t\t{\"A\", \"C\", []...
go
edit
6
1
apache-2.0
c497e66e9a2be4148884a5f7142c9a9946b92ca8
containers/storage,containers/storage,containers/storage
cmd/containers-storage/tree_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\t\"sync\"\n\n\t\"github.com/leoleovich/grafsy\"\n)\n\nfunc main() {\n\tvar configFile string\n\tflag.StringVar(&configFile, \"c\", \"/etc/grafsy/grafsy.toml\", \"Path to config file.\"...
go
edit
0
4
apache-2.0
d74fb5f88d9bbeabb87a501d11aac5e7c08aba3b
leoleovich/grafsy,leoleovich/grafsy
grafsy/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc main() {\n\tif len(os.Args) != 4 {\n\t\tlog.Fatalf(\"Usage: %s <user> <host:port> <command>\", os.Args[0])\n\t}\n\n\tclient, session, err := co...
go
edit
0
4
bsd-2-clause
6995df7f8a77cfc670b81bc97483d2352c08eaa8
Scalingo/go-ssh-examples,Scalingo/go-ssh-examples
client.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/voxelbrain/goptions\"\n\t\"os\"\n\t\"time\"\n)\n\nfunc main() {\n\toptions := struct {\n\t\tServers []string `goptions:\"-s, --server, obligatory, description='Servers to connect to'\"`\n\t\tPasswo...
go
edit
0
1
mit
906ada3541c2d001f7bbdd1a2ad7ca1f4d9f754b
MarsBighead/garden,MarsBighead/garden,MarsBighead/garden,MarsBighead/garden
demo/controller/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\teventsource \"../.\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc main() {\n\tes := eventsource.New(nil, nil)\n\tdefer es.Close()\n\thttp.Handle(\"/\", http.FileServer(http.Dir(\"./public\")))\n\thttp.Handle(\"/...
go
edit
3
2
mit
36f21a2c68d48e3fa3be9051d849c9031438b772
antage/eventsource,XuYunnan/eventsource,torfuzx/eventsource,XuYunnan/eventsource
examples/greeter.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"restic/repository\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nvar cmdRebuildIndex = &cobra.Command{\n\tUse: \"rebuild-index [flags]\",\n\tShort: \"build a new index file\",\n\tLong: `\nThe \"rebuild-index\" command c...
go
edit
18
3
bsd-2-clause
511278b66aa7871093845a6beab23ea2a0e4cb66
ar-jan/restic,kurin/restic,stuertz/restic,kurin/restic,middelink/restic,ar-jan/restic,stuertz/restic,restic/restic,byo/restic,middelink/restic,fawick/restic,fawick/restic,byo/restic,jayme-github/restic,jayme-github/restic,restic/restic
src/cmds/restic/cmd_rebuild_index.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage ast\n\nimport \"github.com/elpinal/coco3/extra/token\"\n\ntype Command struct {\n\tName string\n\tArgs []token.Token\n}\n\n```\n\nApply this change: Add List & its implementations, Cons & Empty" }, { "role": "assistant", "co...
go
edit
0
1
mit
5ea9c92c063fb7365eba4cb023e635057ca9d5b2
elpinal/coco3
extra/ast/ast.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage issue\n\nimport \"net/http\"\n\ntype HttpBody struct {\n\tContentEncoding string `json:\"contentEncoding\"`\n\tContent []byte `json:\"content,string\"`\n}\n\ntype HttpEntity struct {\n\tStatus string `json:\"status\"`\n\tHe...
go
edit
0
0
mit
3c90269cdfecf121d2771fd7e3ad9d37d42ea947
jack51706/bearded,cyberintruder/bearded,jack51706/bearded,bearded-web/bearded,bearded-web/bearded,cyberintruder/bearded,cyberintruder/bearded,bearded-web/bearded,jack51706/bearded,cyberintruder/bearded,bearded-web/bearded,jack51706/bearded
models/issue/vector.go
rejected_duplicate
Near-duplicate of sample 117169
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage floc\n\nimport (\n\t\"context\"\n\t\"sync\"\n)\n\ntype flowContext struct {\n\tcontext.Context\n\tsync.RWMutex\n}\n\nfunc NewContext() Context {\n\treturn &flowContext{\n\t\tContext: context.TODO(),\n\t\tRWMutex: sync.RWMutex{},\n\t}\n}...
go
edit
3
1
mit
55b05d5461d8404a45bf646665a4d757643731b9
workanator/go-floc
context_impl.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage go_sat_solver\n\nimport \"testing\"\n\n\nfunc TestPrint(t *testing.T) {\n\tcases := []struct {\n\t\texpr Expr\n\t\twant int\n\t}{\n\t\t{And{[]Expr{Symbol{\"x1\"}, Symbol{\"x2\"}}}, 2},\n\t\t{Or{[]Expr{Symbol{\"x1\"}, Symbol{\"x2\"}, Sym...
go
edit
0
3
mit
2eaa9ae73fac4056a8b9cc0509d2608eede0812b
bvcx/go_sat_solver
ast_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage helper\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n)\n\n// Asserts that the request did not return an error.\n// Optionally perform some checks only if the request did not fail\nfunc AssertRequestOk(t *testing.T, response interface...
go
edit
0
3
bsd-3-clause
8a1f91c38ae3fc109add03acc68ca5c6b1b839e0
weaviate/weaviate,weaviate/weaviate
test/acceptance/helper/assertions.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage scanner\n\nfunc (fs *FileSystem) rebuildPointers() {\n\tfs.Directory.rebuildPointers(fs)\n}\n\nfunc (directory *Directory) rebuildPointers(fs *FileSystem) {\n\tfor _, file := range directory.FileList {\n\t\tfile.rebuildPointers(fs)\n\t}...
go
edit
12
4
apache-2.0
d360d15bd850318b354dd7784d7d78990c6d875d
Symantec/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator
sub/scanner/rebuild.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cache\n\ntype SubsetMatcher struct {\n}\n\nfunc NewSubsetMatcher() *SubsetMatcher {\n\treturn &SubsetMatcher{}\n}\n\nfunc (sm *SubsetMatcher) Match(servers []*ForkServer, imports []string) (*ForkServer, []string, bool) {\n\tbest_fs := s...
go
edit
3
6
apache-2.0
e8c98556ba2e67eb46ec236a629ed9457086285b
open-lambda/open-lambda,open-lambda/open-lambda,open-lambda/open-lambda,open-lambda/open-lambda,open-lambda/open-lambda
worker/import-cache/subsetMatcher.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\n\t\"github.com/Sirupsen/logrus\"\n)\n\nfunc init() {\n\tlogrus.SetLevel(logrus.DebugLevel)\n}\n\nfunc main() {\n\targs := os.Args[1:]\n\tif len(args) == 0 {\n\t\targs = []string{os.Getenv(\"SHELL...
go
edit
3
3
mit
9aa86a9ebfb12bcea50edbb99d8388ad244d3cff
LK4D4/unc
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage preprocess\n\nimport (\n\t\"testing\"\n\n\t\"fmt\"\n\t\"io\"\n\n\tlocaltests \"github.com/practicum/sandbox/testing\"\n)\n\n// reflectionToy is a dummy type created in the preprocess package as a trick to\n// retrieve the package name. ...
go
edit
6
3
unlicense
246e8bcca34cb2f0b0504cc1eee466cdcac2135c
practicum/sandbox
parse/preprocess/contentscan_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 \"github.com/ricallinson/forgery\"\n)\n\nfunc CreateUser(req *f.Request, res *f.Response, next func()) {\n // res.Send(\"Not implemented yet.\")\n res.Send(\"Unknown error while trying to register user\", 400)\n}\n...
go
edit
9
5
mit
7ee8e946c522c3af50f9fe149516188dec9115ea
spacedock-io/index
user.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage tasks\n\nimport (\n\t\"github.com/headmade/backuper/backuper\"\n)\n\ntype backupDirectoryTask struct {\n\t*backupTask\n}\n\nfunc newBackupDirectoryTask(config *backuper.TaskConfig) BackupTaskInterface {\n\treturn &backupDirectoryTask{ne...
go
edit
12
2
mit
7456b0ed0c1197770559d01b1aa5a8120119f649
headmade/backuper,Twizty/backuper
agent/tasks/backup_directory_task.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\"github.com/pachyderm/pachyderm/src/cmd/pachctl/cmd\"\n\t\"github.com/spf13/cobra/doc\"\n\t\"go.pedge.io/env\"\n)\n\ntype appEnv struct {\n\tOutputDir string `env:\"OUTPUT_DIR,default=./doc/pachctl\"`\n}\n\nfunc mai...
go
edit
0
2
apache-2.0
9cd9673b39348a6cedbbf434d51d24c20ae491a1
pachyderm/pfs,pachyderm/pfs,pachyderm/pfs
src/cmd/doc/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright (c) 2010 The Grumble Authors\n// The use of this source code is goverened by a BSD-style\n// license that can be found in the LICENSE-file.\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar help *bool = flag.Bo...
go
edit
6
4
bsd-3-clause
a1bd184e50c7cf1f18e69259bdbd028c5fcd4821
colek42/grumble,colek42/grumble,colek42/grumble
grumble.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"syscall\"\n\n\t\"github.com/spf13/cobra\"\n)\n\nvar daemonStopCmd = &cobra.Command{\n\tUse: \"stop\",\n\tShort: \"Stop a daemon\",\n\tLong: \"\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\n\t\tsy...
go
edit
6
1
mit
68fe9c1000e3e6cf3fba586ee4f319f62feeecb3
nimona/go-nimona,nimona/go-nimona,nimona/go-nimona,nimona/go-nimona
cmd/nimona/cmd/daemonStop.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage lifecycle\n\nvar defaultManager *Manager\n\nfunc init() {\n\tdefaultManager = NewManager()\n}\n\n// Register registers the argument to the global default one.\nfunc Register(f func()) *Manager {\n\treturn defaultManager.Register(f)\n}\n...
go
edit
12
1
apache-2.0
5ed9573d163a60a7b50aefa12b0e2330cbd64eda
xgfone/go-tools
lifecycle/default.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage pow\n\n// TODO: Unwrap recursion\nfunc Mod(x, p, n int) int {\n\tswitch {\n\tcase p == 0:\n\t\treturn 1\n\tcase p == 1:\n\t\treturn x % n\n\tcase p%2 == 0:\n\t\treturn Mod((x*x)%n, p/2, n)\n\t}\n\treturn (x * Mod((x*x)%n, (p-1)/2, n)) %...
go
edit
0
4
apache-2.0
7ab36cbb37e8a7424080fb8b66edbc1631c1e131
ivankovic/go-competitive
pow/pow.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage binary\n\nimport \"testing\"\n\ntype binaryTest struct {\n\tbinary string\n\texpected int\n}\n\nvar binaryTests = []binaryTest{\n\t{\"1\", 1}, {\"10\", 2}, {\"11\", 3},\n\t{\"100\", 4}, {\"1001\", 9}, {\"10001101000\", 1128},\n\t{\"12...
go
edit
3
3
mit
b4a25e9972165a4417f05c54b53a316b3854ac44
robphoenix/exercism-go,exercism/xgo,pminten/xgo,leenipper/xgo,exercism/xgo,robphoenix/exercism-go,leenipper/xgo,pminten/xgo
assignments/go/binary/binary_test.go
rejected_duplicate
Near-duplicate of sample 117423
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sacloud\n\n// propIcon アイコン内包型\ntype propIcon struct {\n\tIcon *Icon // アイコン\n}\n\n// SetIconByID 指定のアイコンIDを設定\nfunc (p *propIcon) SetIconByID(id int64) {\n\tp.Icon = &Icon{Resource: NewResource(id)}\n}\n\n// SetIcon 指定のアイコンオブジェクトを設定\nf...
go
edit
9
2
apache-2.0
67c3bd8530227d9808c75623ddd356a02c6faa27
yamamoto-febc/libsacloud,sacloud/libsacloud
sacloud/prop_icon.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Code from my dotGo.eu 2014 presentation\n//\n// Copyright (c) 2014 John Graham-Cumming\n//\n// Implement a factory and a task. Call run() on your factory.\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"log\"\n\t\"os\"\n\t\"sync\"\n)\n\ntype t...
go
edit
0
3
bsd-3-clause
e515b222c25a00a674141e0d5fab138cdc9dabfa
cloudflare/jgc-talks,robertojrojas/jgc-talks
dotGo/2014/z.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar cmdRemove = &Command{\n\tRun: runRemove,\n\tUsageLine: \"remove NAME\",\n\tShort: \"Remove saved password\",\n\tLong: `Remove saved password by input name.`,\n}\n\nfunc ...
go
edit
18
7
mit
86ef4815527aaaeede24435b49a6f654da6d9979
pinzolo/spwd
cmd_remove.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage fizzbuzz\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc Generate(count int) ([]string, error) {\n\tif count <= 0 {\n\t\treturn nil, fmt.Errorf(\"fizzbuzz: Negative fizzbuzz count provided\")\n\t}\n\n\tfizzbuzz := make([]string, count)\n\n...
go
edit
0
6
isc
f136ebade93a5e070f8d57bd5ad53e5191874248
mulander/goexamples
fizzbuzz/fizzbuzz.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2016 Koichi Shiraishi. 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// nvim-go is a msgpack remote plugin for Neovim\npackage main\n\nimport (\n\t...
go
edit
0
1
bsd-3-clause
fed53c8bad5977f7f28bfde000285d16ec83983c
zchee/nvim-go,zchee/nvim-go
src/nvim-go/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage graval\n\nimport (\n\t. \"github.com/smartystreets/goconvey/convey\"\n\t\"os\"\n\t\"testing\"\n\t\"time\"\n)\n\ntype TestFileInfo struct{}\n\nfunc (t *TestFileInfo) Name() string {\n\treturn \"file1.txt\"\n}\n\nfunc (t *TestFileInfo) Si...
go
edit
21
1
mit
e3323a822fd7c666de0b8f90a9b02e63a89df565
yob/graval,yob/graval
listformatter_test.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage process\n\nimport (\n\t\"os/exec\"\n\n\t\"github.com/gonuts/go-shlex\"\n\t\"github.com/yosisa/pave/template\"\n)\n\ntype Command struct {\n\tTemplate string\n\tPrepareFunc func(*exec.Cmd)\n\tCmd *exec.Cmd\n}\n\nfunc NewComman...
go
edit
3
3
mit
225993926840edc55916fd16910e0f62a67d3794
yosisa/pave
process/command.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage boltdb\n\nimport (\n\t\"context\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/docker/containerd/snapshot/storage\"\n\t\"github.com/docker/containerd/snapshot/storage/testsuite\"\n)\n\nfunc BenchmarkSuite(b *testing.B) {\n\ttes...
go
edit
3
1
apache-2.0
397499c2882b49428107fded770c420ddda96fb1
crosbymichael/containerd,hqhq/containerd,docker/containerd,containerd/containerd,Wolphin-project/containerd,rajasec/containerd,AkihiroSuda/containerd,thaJeztah/containerd,mikebrow/containerd,estesp/containerd,xiekeyang/containerd,kunalkushwaha/containerd,thaJeztah/containerd,kunalkushwaha/containerd,vdemeester/containe...
snapshot/storage/boltdb/bolt_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage requirements\n\nimport (\n\t\"cf\"\n\t\"cf/configuration\"\n\t\"cf/terminal\"\n\t\"fmt\"\n)\n\ntype ApiEndpointRequirement struct {\n\tui terminal.UI\n\tconfig configuration.Reader\n}\n\nfunc NewApiEndpointRequirement(ui terminal.UI...
go
edit
0
2
apache-2.0
4c1189010453905be238298049a6ff245619a5a9
cf-routing/cli,nimbus-cloud/cli,cgvarela/cli,zhang-hua/cli,nttlabs/cli,18F/cli,srikanth88infy/cli,EngineerBetter/cli,simonleung8/cli,SrinivasChilveri/cli,HuaweiTech/cli,cgvarela/cli,rastasheep/trash-can,ofer43211/cli,xingzhou/cli,xingzhou/cli,18F/cli,pishro-cc/cli,nimbus-cloud/cli,saurabhguptasg/cli,nttlabs/cli,markstg...
src/cf/requirements/api_endpoint.go
rejected_duplicate
Near-duplicate of sample 118598
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"flag\"\n\n\t\"github.com/gorilla/mux\"\n)\n\nvar hostname = flag.String(\"hostname\", \"localhost\", \"The hostname - defaults to localhost\")\n\nfunc Serve() {\n\tfmt.Println(\"Startin...
go
edit
0
1
mit
9e0531caab4f0d178986927f7863bdbb0a685a75
stevemostovoy/cloudpiece,stevemostovoy/cloudpiece,stevemostovoy/cloudpiece
server/server.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/codegangsta/negroni\"\n\t\"github.com/gorilla/mux\"\n)\n\nfunc main() {\n\tr := mux.NewRouter()\n\tr.HandleFunc(\"/\", func(rw http.ResponseWriter, r *http.Request) {\n\t\tfm...
go
edit
0
1
mit
b4d41c1f7bd95d6dea9abc442f791942cc54b8ae
spesnova/iruka,spesnova/iruka,spesnova/iruka,spesnova/iruka
irukad/iruka.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage isogram\n\nimport \"strings\"\n\n// IsIsogram returns whether the provided string is an isogram.\n// In other words, whether the string does not contain any duplicate characters.\nfunc IsIsogram(s string) bool {\n\tparsed := strings.ToL...
go
edit
0
3
mit
34c466af0ffc077ffaf6ec6a9d357148f76d8303
rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism
go/isogram/isogram.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// A facebook graph api client in go.\n// https://github.com/huandu/facebook/\n//\n// Copyright 2012 - 2015, Huan Du\n// Licensed under the MIT license\n// https://github.com/huandu/facebook/blob/master/LICENSE\n\npackage facebook\n\n// Error r...
go
edit
0
1
mit
df76e95defab93e03bc8022bf083182b653901b9
huandu/facebook
error.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright © 2017 Swarm Market <<EMAIL>>\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// http://www...
go
edit
3
2
apache-2.0
9daa63cc652970e5d8255a895ffc010c946b1c8d
swarmdotmarket/perigord,swarmdotmarket/perigord
stub/cmd/migrate.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !windows\n\npackage main\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc restart() {\n\tsyscall.Kill(os.Getpid(), syscall.SIGHUP)\n\ttime.Sleep(10 * time.Millisecond)\n}\n\n```\n\nApply this change: Extend wait duration to...
go
edit
3
1
mit
c9ffb81dfa2102538868027932544517de8931f9
cybozu-go/cmd
test/restart/restart.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\tbmtestutils \"github.com/cloudfoundry/bosh-micro-cli/testutils\"\n)\n\nvar testCpiFilePath str...
go
edit
27
1
apache-2.0
273cd3dc935245619f90bc463dbf749bb1651f19
forrestsill/bosh-init,cloudfoundry/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init,allomov/bosh-init,forrestsill/bosh-init,cloudfoundry/bosh-init,allomov/bosh-init,forrestsill/bosh-init
integration/integration_suite_test.go
rejected_lint
Too many lint violations: 27
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage redlot\n\nimport \"errors\"\n\nconst (\n\ttypeKV = 'k'\n\ttypeHASH = 'h'\n\ttypeHSIZE = 'H'\n)\n\nvar (\n\terrNosArgs = errors.New(\"wrong number of arguments\")\n)\n\n```\n\nApply this change: Add error of not int." }, { "r...
go
edit
0
0
mit
40d339af252d2cd15fda69b076d707a3ca5eda3c
kofj/redlot
src/redlot/const.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage data\n\ntype WsError struct {\n\tCode int `json:\"code\"`\n\tMsg string `json:\"msg\"`\n}\n\ntype WsEvent struct {\n\tId int `json:\"id\"`\n\tType string `json:\"type\"`\n\tChannel string `json:\"channel\"`\n\tText ...
go
edit
0
0
unlicense
bbf42f40a22958456947cad238b2324b52f2a4d0
alinpopa/barvin
data/data.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage helpers\n\nimport (\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/onsi/gomega\"\n)\n\nvar DEFAULT_EVENTUALLY_TIMEOUT = 2 * time.Minute\nvar DEFAULT_CONSISTENTLY_DURATION = 5 * time.Second\n\nfunc RegisterDefaultTimeouts() {\n\tvar err error\n...
go
edit
0
5
apache-2.0
306db25769faa92d63db50b4f88fde5437f07ac9
cloudfoundry-incubator/inigo
helpers/timeouts.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/http\"\n\n\t\"github.com/gorilla/mux\"\n\t\"github.com/miraclesu/keywords-filter\"\n\t\"github.com/miraclesu/keywords-filter/listener/http.listen\"\n\t\"github.com/miraclesu/keywords-filt...
go
edit
9
2
mit
707d764842f21d05ce300c74012bd63f9fde9a45
miraclesu/keywords-filter
serve/main.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage ttl_hash_set_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\n\t\"testing\"\n)\n\nfunc TestTtlHashSet(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tRunSpecs(t, \"TtlHashSet Suite\")\n}\n\n```\n\nAppl...
go
edit
6
1
mit
362f173b69176ed41f52d3a67bffe9fc00af1acc
alphagov/govuk_crawler_worker
ttl_hash_set/ttl_hash_set_suite_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\"fmt\"\n\n\t\"github.com/caelifer/data-structures-in-go/btree/tree\"\n)\n\ntype IntNode int\n\nfunc (n IntNode) Less(other tree.Node) bool {\n\t// TODO: need to handle type assertion error\n\treturn n < other.(IntNo...
go
edit
0
1
bsd-2-clause
21efb2fc3363b15f7e5aee0d392757f43373e9f9
caelifer/data-structures-in-go
btree/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// The assistant functions of io.\npackage io2\n\nimport \"io\"\n\n// Must read and return n bytes from r. err is not nil, if failed.\nfunc ReadN(r io.Reader, n int) (result []byte, err error) {\n\tresult = make([]byte, n)\n\tfor m := 0; m < n;...
go
edit
0
3
apache-2.0
597eecbc69b086002e979d9731c991ed14a0d9d3
xgfone/go-tools
io2/io.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"os\"\n\n\t\"github.com/jvikstedt/alarm-bot/configuration\"\n\t\"github.com/jvikstedt/alarm-bot/mailer\"\n\t\"github.com/jvikstedt/alarm-bot/tracker\"\n)\n\nvar mail *mailer.Mailer\nvar conf *configurat...
go
edit
0
3
mit
f36c12a88ff84ee30415e047aa12dfc27b5d20eb
jvikstedt/alarm-bot
alarmbot/alarmbot.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build windows\n\npackage edgectl\n\nimport (\n\t\"github.com/pkg/errors\"\n\t\"github.com/spf13/cobra\"\n\n\t\"github.com/datawire/ambassador/pkg/supervisor\"\n)\n\n// GuessRunAsInfo attempts to construct a RunAsInfo for the user logged in ...
go
edit
3
1
apache-2.0
b126fcf3ad2d45ad58c76dfd317563d399bbc144
datawire/telepresence,datawire/telepresence,datawire/telepresence
pkg/edgectl/misc_noop.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage response\n\nimport (\n\t\"github.com/Vladimiroff/vec2d\"\n\n\t\"warcluster/entities\"\n)\n\ntype LoginSuccess struct {\n\tbaseResponse\n\tUsername string\n\tPosition *vec2d.Vector\n\tHomePlanet struct {\n\t\tName string\n\t\tPos...
go
edit
18
1
mit
d47820507122af1ccbd2f9d26c355a0587986f6e
WarCluster/warcluster-server,WarCluster/warcluster-server
server/response/login.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2016 Tom Thorogood. All rights reserved.\n// Use of this source code is governed by a\n// Modified BSD License license that can be found in\n// the LICENSE file.\n\npackage shm\n\nimport (\n\t\"os\"\n\n\t\"github.com/tmthrgd/go-shm...
go
edit
3
1
bsd-3-clause
7207ca97b290b1d9fab248a1e4c8f753bdc79086
tmthrgd/shm-go
unlink.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage stl\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\n// Write writes the triangle mesh to the writer using ASCII STL codec.\nzfunc Write(w io.Writer, t []Triangle) error {\n\tvar err error\n\n\tprintf := func(format string, a ...interface{}) {\n\...
go
edit
3
4
mit
69b5fef5e2601ed37e789dabc812b9cf0a19de7b
krasin/stl
writer.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage compute\n\ntype VolumePoolRepository interface {\n\tList() ([]*VolumePool, error)\n}\n\ntype VolumePool struct {\n\tName string\n\tSize uint64 // MiB\n\tUsed uint64 // MiB\n\tFree uint64 // MiB\n}\n\nfunc (pool *VolumePool) UsagePercent...
go
edit
0
1
mit
5714d21d90e2c5a4bdbb1077157cd4e41ddf4c54
subuk/vmango,subuk/vmango,subuk/vmango,subuk/vmango,subuk/vmango,subuk/vmango
compute/volume_pool.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// This file is autogenerated, see packaging/increment_build.sh\npackage libkb\n\nconst Version = \"1.0.5\"\nconst Build = 6\n\n```\n\nApply this change: Revert \"Bumping build number: 1.0.5-6\"\n\nThis reverts commit d765d9c66cfb0659f43c8bdc2d...
go
edit
0
1
bsd-3-clause
f8d9daefdc3201c718381e0106f1a748fc4fe73d
keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client
go/libkb/version.go
rejected_duplicate
Near-duplicate of sample 116860
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage mc\n\ntype ProjectDB interface {\n\tProject() *Project\n\tUpdateProject(project *Project) error\n\tInsertDirectory(dir *Directory) (*Directory, error)\n\tUpdateDirectory(dir *Directory) error\n\tDirectories() []Directory\n\tLs(dir Direc...
go
edit
24
0
mit
ecc8d1b6c34c60929ea1ec3f5b3606742ada9bb8
materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore
cmd/pkg/mc/interfaces.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage http\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc FixupCORSHeaders(downstream http.ResponseWriter, upstream *http.Response) {\n\thasCORSHeaders := false\n\tfor name := range upstream.Header {\n\t\tif strings.HasPrefix(name, \"A...
go
edit
0
13
apache-2.0
45a70b6a9b5395f9ecbe72919c714e81494c864f
SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server
pkg/core/http/cors.go
rejected_complexity
Cyclomatic complexity too high: 13
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright (c) 2014 Josh Rickmar.\n// Use of this source code is governed by an ISC\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"github.com/conformal/gotk3/gtk\"\n\t\"runtime\"\n)\n\nconst HomePage HTMLP...
go
edit
12
1
isc
76b96a7b23ec2679afe32a52616a701067ce4067
jrick/xombrero2
xombrero.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\"bytes\"\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"github.com/beard1ess/gauss/parsing\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/stretchr/testify/require\"\n\t\"io/ioutil\"\n\t\"reflect\"\n\t\"testing\"\...
go
edit
3
1
mit
8d540120084298983ba1f7b3bd5578fd1817157b
beard1ess/gauss
main_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"path\"\n\t\"strconv\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/brandur/sorg\"\n\t\"github.com/joeshaw/envdecode\"\n)\n\n// Conf contains configuration information for the command.\nty...
go
edit
0
4
mit
0a6fa2bc146c5e8684a1aa23092c6fc9bff19de2
brandur/sorg,brandur/sorg,brandur/sorg,brandur/sorg,brandur/sorg
cmd/sorg-serve/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage prgs\n\n// Prg is a Program, with all its data (no behavior)\ntype Prg struct{}\n\n// PGetter gets programs (from an internal config)\ntype PGetter interface {\n\tGet() []*Prg\n}\n\ntype defaultGetter struct{}\n\nvar dg defaultGetter\nv...
go
edit
0
1
mit
12e7913d3c1deaeae1fa76fb0897af48ea4b947b
VonC/senvgo,VonC/senvgo
prgs/prgs.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage core\n\ntype functionType struct {\n\tsignature Signature\n\tfunction func(...*Thunk) Value\n}\n\nfunc (f functionType) call(args Arguments) Value {\n\tts, err := f.signature.Bind(args)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tre...
go
edit
30
4
mit
d5369d03810eaed766d2d35eda2aaaa5cfa9bedc
raviqqe/tisp,tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp
src/lib/core/function.go
rejected_lint
Too many lint violations: 30
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage core\n\nimport (\n\t\"math\"\n)\n\ntype GeodeticSystem interface {\n\tToGeographic(point *Point) *Point\n\tToGeodetic(point *Point) *Point\n}\n\ntype EllipseGeodetic struct {\n\tellipseParam *EllipseParameters\n}\n\nfunc (eg *EllipseGeo...
go
edit
15
1
mit
4d827b5ee6927ca922d960b64ec60bea752a16ab
yageek/goproj,go-gis/goproj
core/geosystems.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\trouter := NewRouter()\n\n\t// By default, listen to port :9532 (:ykdb)\n\tfmt.Println(\"Listening on port 9532...\")\n\tlog.Fatal(http.ListenAndServe(\":9532\...
go
edit
3
1
mit
cdb6c521826a1576aacd45467b7b76628100fb65
needcaffeine/yakdb
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc optionsOk(next http.Handler) http.Handler {\n\tfn := func(w http.ResponseWriter, r *http.Request) {\n\t\tw.Header().Set(\"access-control-allow-origin\", \"*\")\n\t\tw.He...
go
edit
0
2
mit
141e64298eb5551f3141b8ebe067da951ae1d874
mforman/todo-backend-golang
middleware.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nThis package is just a collection of test cases\n */\npackage main\n\nimport (\n \"fmt\"\n \"os\"\n \"ripe-atlas\"\n)\n\nfunc main() {\n\tp, err := atlas.GetProbe(14037)\n\tif err != nil {\n\t\tfmt.Printf(\"err: %v\", err)\n\t\tos....
go
edit
6
2
mit
5647a87df12726c2b04bf5a09a89471f91a6c1b8
keltia/ripe-atlas
cmd/atlas/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\"bytes\"\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/cadena-monde/slackbot\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\tchannel, message string\n\tstdin bool\n\tslackURL = os.Getenv(\"SLACKBOT_URL\")\n\tt...
go
edit
0
4
mit
a880609eaacbff9a97b47ce73bd2a8ce7cbfac6d
monde-sistemas/slackbot
slackbot-console/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Package zapadapter provides a logger that writes to a go.uber.org/zap.Logger.\npackage zapadapter\n\nimport (\n\t\"context\"\n\n\t\"github.com/jackc/pgx/v4\"\n\t\"go.uber.org/zap\"\n\t\"go.uber.org/zap/zapcore\"\n)\n\ntype Logger struct {\n\...
go
edit
9
7
mit
aafa04c15675bca3c3d65d502a22e2a74b3fa664
jackc/pgx,jackc/pgx,jackc/pgx,jackc/pgx
log/zapadapter/adapter.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage vizzini_test\n\nimport (\n\t\"strings\"\n\n\t\"code.cloudfoundry.org/bbs/models\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Cells\", func() {\n\tIt(\"should return all cells\", func() {\n\t...
go
edit
18
1
apache-2.0
b1b1b1b40e4ade606a22f8550ec7c14c2692674d
cloudfoundry-incubator/vizzini,pivotal-cf-experimental/vizzini,cloudfoundry-incubator/vizzini,pivotal-cf-experimental/vizzini
cells_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage fhttp\n\nimport (\n\t\"github.com/jung-kurt/gofpdf\"\n\t\"net/http\"\n)\n\n// RegisterRemoteImage registers a remote image. Downloading the image from the\n// provided URL and adding it to the PDF but not adding it to the page. Use\n// ...
go
edit
0
4
mit
4258c2e0e7b3f57a5913e2983e316ad2b3e079a5
jung-kurt/gofpdf,jelmersnoeck/gofpdf,jelmersnoeck/gofpdf,ledongthuc/gofpdf
contrib/fhttp/fhttp.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\t\"net/http\"\n\n\tutils \"github.com/shurcooL/github_flavored_markdown\"\n)\n\nfunc main() {\n\thttp.HandleFunc(\"/\", Handler)\n\tlog.Printf(\"Listening on port %d\\n\", 8080)\...
go
edit
0
2
mit
b1b2a876812af3705c180677b7309bbe66b65bf7
mongrelion/mdp
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2016 Martijn Croonen. All rights reserved.\n// Use of this source code is governed by the MIT license, a copy of which can\n// be found in the LICENSE file.\n\npackage ece\n\nimport (\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n\t\"err...
go
edit
3
5
mit
06796ae471e297dfd34f7a26983735bf1a4979b2
Martijnc/gowebpush,Martijnc/gowebpush,Martijnc/gowebpush
ece/encrypt.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sink\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\n// GetSink ...\nfunc GetSink() (Sink, error) {\n\tsinkType := os.Getenv(\"SINK_TYPE\")\n\tif sinkType == \"\" {\n\t\treturn nil, fmt.Errorf(\"Missing SINK_TYPE: amqp, kafka,kinesis or stdout\"...
go
edit
18
8
bsd-3-clause
57d2e92aa2960640063cab007baaaca12050f960
seatgeek/nomad-firehose
sink/helper.go
rejected_lint
Too many lint violations: 18
true