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 model\n\nimport (\n\t\"errors\"\n\t\"time\"\n)\n\n// UserInfo holds the parameters returned by the backends.\n// This information will be serialized to build the JWT token contents.\ntype UserInfo struct {\n\tSub string `json:\"sub\...
go
edit
0
2
mit
65a77154929c1ab41755121e92264cdddefd7788
tarent/loginsrv,tarent/loginsrv,tarent/loginsrv
model/user_info.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cli\n\nimport (\n\t\"github.com/qiniu/log\"\n\t\"qshell\"\n\t\"strconv\"\n)\n\nfunc QiniuUpload(cmd string, params ...string) {\n\tif len(params) == 1 || len(params) == 2 {\n\t\tvar uploadConfigFile string\n\t\tvar threadCount int64\n\t...
go
edit
3
7
mit
15d346e3c9572f3e7b72351d8553be589d068a7e
qiniu-lab/qshell,liangchao07115/qshell,qiniu-lab/qshell,jemygraw/qshell,liangchao07115/qshell,qiniu/qshell,jemygraw/qshell
src/cli/qupload.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"github.com/alanctgardner/gogen-avro/example/avro\"\n)\n\n// Use a go:generate directive to build the Go structs for `example.avsc`\n// Source files will be in a package called `avro`\n\n//go...
go
edit
0
2
mit
332475f27f78b694a0ea78baa2c228f11212f704
alanctgardner/gogen-avro,alanctgardner/gogen-avro
example/example.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"github.com/gin-gonic/gin\"\n\t\"gopkg.in/mgo.v2\"\n)\n\n// RegisterRoutes registers all routes needed to serve the patient merging service.\nfunc RegisterRoutes(router *gin.Engine, session *mgo.Session, dbname st...
go
edit
6
1
apache-2.0
dcb040897dbb65d073d0e40bee1a32fba9db1dea
mitre/ptmerge
server/routing.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\"bufio\"\n\t\"github.com/Symantec/Dominator/lib/mdb\"\n\t\"io\"\n\t\"log\"\n\t\"strings\"\n)\n\nfunc loadText(reader io.Reader, logger *log.Logger) (*mdb.Mdb, error) {\n\tscanner := bufio.NewScanner(reader)\n\tvar n...
go
edit
0
7
apache-2.0
5cf7879419d7dbb61e3aaeb7ab0002dbf908a4b8
keep94/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator
cmd/mdbd/loadText.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage asciidocgo\r\n\r\nimport \"testing\"\r\nimport . \"github.com/smartystreets/goconvey/convey\"\r\n\r\nfunc TestAsciidocgo(t *testing.T) {\r\n\tLoad(nil)\r\n\tConvey(\"Asciidocgo takes a Reader and return a Document\", t, func() {\r\n\t\t...
go
edit
0
1
mit
7b680c07ac57d9d6484979301f6f395ede0c36c8
bep/asciidocgo,VonC/asciidocgo
asciidocgo_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"net/http\"\n)\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n fmt.Fprintf(w, \"It puts the meeple in the basket\")\n}\n\nfunc main() {\n http.HandleFunc(\"/\", handler)\n http.ListenAndSer...
go
edit
0
2
mit
c04f473fd63fad6145965f143c76f25684af60f6
rkbodenner/meeple_mover,rkbodenner/meeple_mover
meeple_mover.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage merkle\n\ntype Tree interface {\n\tSize() (size int)\n\tHeight() (height int8)\n\tHas(key []byte) (has bool)\n\tProof(key []byte) (value []byte, proof []byte, exists bool) // TODO make it return an index\n\tGet(key []byte) (index int, v...
go
edit
0
0
apache-2.0
c75298e3594a0d5f0c88112fbc0543edb6212d5b
tendermint/tendermint,tendermint/tendermint,tendermint/tendermint,tendermint/tendermint
merkle/types.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// FindCompilerLanuncher probes compiler launcher if exists.\n// Currently only probes SN-DBS launcher.\nfunc FindCompilerLauncher() string {\n\tdir, ok := os.LookupEnv(\"SCE_SDK_ROO...
go
edit
0
3
mit
aee2ec6a8097021180c3904c3201946294afe55c
zsuzuki/gobuild
compiler_launcher.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nvar testcases = []struct {\n\thands string\n\texpected bool\n}{\n\t{\"123456789m123p1s\", true},\n\t{\"111222333m111p1s\", true},\n\t{\"EEESSSWWWNNNW\", true},\n\t{\"13579m2468p1357s\", false},\n...
go
edit
0
3
apache-2.0
b315c20035a823378729f50586fc2f27d1177b2f
tanaka51/tenpai-wakaru-man
src/main_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage api\n\nimport \"google.golang.org/grpc\"\n\n// DialOptions are the gRPC dial options for discovery calls\n// TODO: disable insecure connections\nvar DialOptions = []grpc.DialOption{\n\tgrpc.WithInsecure(),\n}\n\n```\n\nApply this change...
go
edit
0
0
mit
c11c69d6c07073f4cefcab78809962e21cecb80e
TheThingsNetwork/ttn,TheThingsNetwork/ttn,jvanmalder/ttn,jvanmalder/ttn,TheThingsNetwork/ttn,jvanmalder/ttn,mgranberry/ttn,mgranberry/ttn,mgranberry/ttn
api/api.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2013 SteelSeries ApS. All rights reserved.\n// No license is given for the use of this source code.\n\n// This package impliments a basic LISP interpretor for embedding in a go program for scripting.\n// This file provides a repl\n...
go
edit
0
9
bsd-3-clause
34f8fce3674f610cd4edcb5c81772486c444f018
SteelSeries/golisp,ToadKing/golisp,SteelSeries/golisp,SteelSeries/golisp
src/github.com/steelseries/golisp/main/repl.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage fzf\n\nimport (\n\t\"time\"\n\n\t\"github.com/junegunn/fzf/src/util\"\n)\n\nconst (\n\t// Current version\n\tVersion = \"0.10.1\"\n\n\t// Core\n\tcoordinatorDelayMax time.Duration = 100 * time.Millisecond\n\tcoordinatorDelayStep time.D...
go
edit
0
0
mit
5e90f0a57bf21393a12ffc05e022760a71098d92
qiemem/fzf,pokey/fzf,jebaum/fzf,infokiller/fzf,janusnic/fzf,jebaum/fzf,hyiltiz/fzf,tomfitzhenry/pkg-fzf,mhartington/fzf,janlazo/fzf,stevenqzhang/fzf,wilywampa/fzf,NgaNguyenDuy/fzf,noscript/fzf,hyiltiz/fzf,mjwestcott/fzf,alerque/fzf,jebaum/fzf,janlazo/fzf,stevenqzhang/fzf,janlazo/fzf,junegunn/fzf,noscript/fzf,d4ndo/fzf,...
src/constants.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !(linux | darwin)\n\npackage water\n\nimport \"errors\"\n\nfunc newTAP(ifName string) (ifce *Interface, err error) {\n\treturn nil, errors.New(\"tap interface not implemented on this platform\")\n}\n\nfunc newTUN(ifName string) (ifce ...
go
edit
6
1
bsd-3-clause
393a203dd0b05f7d7ba902db994241c14de1126f
ArroyoNetworks/water,songgao/water
syscalls_other.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\t\"log\"\n\t\"net\"\n\t\"strings\"\n)\n\nfunc main() {\n\tl, err := net.Listen(\"tcp\", \":2000\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer l.Close()\n\tfor {\n\t\t\n\t\tconn, err := l.Accept()\...
go
edit
6
6
mit
ca6d60bfdcd711f0ea913b4ea37f979890c4ccd9
icambridge/go-playground
sockets.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage TLSHandshakeDecoder\n\nimport (\n\t_ \"bytes\"\n\t\"errors\"\n\t\"fmt\"\n)\n\ntype TLSRecordLayer struct {\n\tcontentType uint8\n\tversion uint16\n\tlength uint16\n\tFragment []byte\n}\n\nfunc DecodeRecord(p *TLSRecordLayer,...
go
edit
0
3
mit
8f6399a58f4e0fe59512c55e65349eee346fe021
rahulsom/TLSHandshakeDecoder,rahulsom/TLSHandshakeDecoder
DecodeRecordProtocol.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gitbook\n\nimport (\n\t\"github.com/GitbookIO/go-gitbook-api/api\"\n\t\"github.com/GitbookIO/go-gitbook-api/client\"\n)\n\ntype API struct {\n\t// Authentication API client\n\tAccount *api.Account\n\t// Individual book API client\n\tBoo...
go
edit
3
1
apache-2.0
fe4d603dbbe54efb625ef0134094e0f97bd6bd53
GitbookIO/go-gitbook-api
api.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage testutils\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc Test_exampleData(t *testing.T) {\n\tst, err := exampleData(\"check01\")\n\tif err != nil {\n\t\tt.Error(\"error reading check01\")\n\t}\n\texpLen := 644\n\tif len(st) == expLen ...
go
edit
6
3
apache-2.0
d22d0a9a24252ba277d06c53a408ea428b65056f
bobtfish/sensuplugingo
testutils_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"github.com/nlopes/slack\"\n)\n\ntype SlackNotifierPhase struct {\n\tClient *slack.Client\n\tChannel string\n\tFormat func(Deployment) (string, error)\n}\n\nfunc (snp *SlackNotifierPhase) HasExecuted(deployment ...
go
edit
21
4
mit
ac0188e42ab3ed804605063dbd2f6c4ecb18da5d
Everlane/evan
config/phase_slack_notifier.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage netlink\n\n//import \"bytes\"\n//import \"encoding/binary\"\nimport \"os\"\nimport \"syscall\"\n\ntype Socket struct {\n fd int\n}\n\nfunc toErr(eno int)(err os.Error){\n if eno != 0 { err = os.NewError(syscall.Errstr(eno))}\n return...
go
edit
24
2
bsd-3-clause
3f6c538dd1af6ac31ed8f112edbb21e76b9c973b
abneptis/GoNetlink
socket/socket.go
rejected_lint
Too many lint violations: 24
true
[ { "role": "user", "content": "Here is the current file:\n```go\n//go:build js\n\npackage syscall\n\nimport (\n\t\"syscall/js\"\n)\n\n// fsCall emulates a file system-related syscall via a corresponding NodeJS fs\n// API.\n//\n// This version is similar to the upstream, but it gracefully handles missing fs\n...
go
edit
0
5
bsd-2-clause
aad4eda9d7e114c720abd1b5a899028374b58bfa
gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs
compiler/natives/src/syscall/fs_js.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage devices\n\ntype Device interface {\n\tInit()\n\tDestroy()\n\tRead() Measurement\n}\n\nvar Devices = map[string]func(uint8, int) (Device, error){\n\t\"adxl345\": NewAdxl345,\n}\n\n```\n\nApply this change: Add itg3200 constructor to LUT"...
go
edit
9
1
isc
95bdf67e863055eebcc3853a20a8036ee96902d0
dmelani/data_logger
devices/device.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage gof1\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\n// GetRaces queries the Ergast api and returns the details of every completed race in the F1 season specified\nfunc GetRaces(year int) []Race {\n\turl := ...
go
edit
0
4
mit
12b399a0d8d82df12ce4bf04da229c9af1dbd110
meenie216/gof1
gof1.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage curses\n\n// Handles all output.\n\nimport (\n\t\"code.google.com/p/goncurses\"\n\t\"github.com/discoviking/roguemike/io\"\n)\n\nvar screen *goncurses.Window\nvar Input chan *io.UpdateBundle\n\nfunc Init() error {\n\ts, err := goncurses...
go
edit
0
2
mit
67414dd968fe19234658385b3ef1fca06240ef55
DiscoViking/roguemike
io/curses/output.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage sqlcond_test\n\nimport (\n\t\"database/sql\"\n\t\"fmt\"\n\t\"sqlcond\"\n\t\"time\"\n\n\t_ \"github.com/go-sql-driver/mysql\"\n)\n\nfunc mustExec(db *sql.DB, query string) {\n\tif _, err := db.Exec(query); err != nil {\n\t\tpanic(err)\n\...
go
edit
0
4
mit
edc4918236028e37f77838726183e0b9ee047db1
WatchBeam/sqlcond
example_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"path/filepath\"\n\n\tc \"github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/go-check\"\n)\n\ntype RedisSuite struct {\n\tHelper\n}\n\nvar _ = c.ConcurrentSuite(&RedisSuite{})\n\nfunc (s *RedisSuite) Test...
go
edit
21
1
bsd-3-clause
0d144d70e7a83968c6f829c89a9f89f6ed6f3abc
philiplb/flynn,lmars/flynn,benbjohnson/flynn,flynn/flynn,lmars/flynn,lmars/flynn,benbjohnson/flynn,philiplb/flynn,benbjohnson/flynn,flynn/flynn,lmars/flynn,philiplb/flynn,benbjohnson/flynn,flynn/flynn,benbjohnson/flynn,benbjohnson/flynn,flynn/flynn,philiplb/flynn,lmars/flynn,philiplb/flynn,flynn/flynn
test/test_redis.go
rejected_lint
Too many lint violations: 21
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage objectclient\n\nimport (\n\t\"bytes\"\n\t\"github.com/Symantec/Dominator/lib/hash\"\n\t\"github.com/Symantec/Dominator/proto/objectserver\"\n\t\"io\"\n)\n\ntype myReadCloser struct {\n\treader io.Reader\n}\n\nfunc (reader *myReadCloser)...
go
edit
3
2
apache-2.0
b47a459bb1f149e3e0dfaa051f39b59a4d01c1e2
keep94/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator
lib/objectclient/getObject.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage markdown_test\n\nimport (\n\t\"os\"\n\n\t\"github.com/russross/blackfriday\"\n\t\"github.com/shurcooL/go/markdown\"\n)\n\nfunc Example() {\n\tinput := []byte(`Title\n=\n\nThis is a new paragraph. I wonder if I have too many space...
go
edit
0
2
mit
127d22a477f7ed4791d7b97b40adbfe5cafced81
shurcooL/go
markdown/main_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage assets\n\nimport (\n\t\"bytes\"\n\t\"crypto/md5\"\n\t\"encoding/hex\"\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\n// Fingerprint is a filter that sets asset filenames to include a md5 hash\n// of the file contents. This c...
go
edit
15
3
mit
326529c3603b1e99070f8ecc5274408c6a6999c0
jbowens/assets
fingerprint.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage myaws\n\nimport (\n\t\"os\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc NewConfig() *aws.Config {\n\treturn &aws.Config{\n\t\tCredentials: newCredentia...
go
edit
0
2
mit
b0857eb2c02e539b1813b531247822cb0a08d089
minamijoyo/myaws
myaws/config.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n//\n// Written by Maxim Khitrov (June 2013)\n//\n\npackage mock\n\nimport (\n\t\"testing\"\n\n\t\"code.google.com/p/go-imap/go1/imap\"\n)\n\nfunc TestNewClientOK(T *testing.T) {\n\tC, t := Client(T,\n\t\t`S: * OK Test server ready`,\n\t\t`C: A1...
go
edit
0
3
bsd-3-clause
876a88b63c155ed97b093821876fcd9d17e92a21
mxk/go-imap,tjyang/go-imap,boxer/go-imap,bluzye/go-imap,simia-tech/go-imap
go1/mock/imap_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2017 Frédéric Guillot. All rights reserved.\n// Use of this source code is governed by the Apache 2.0\n// license that can be found in the LICENSE file.\n\npackage api // import \"miniflux.app/api\"\n\nimport (\n\t\"net/http\"\n\n\...
go
edit
6
4
apache-2.0
715575001a2b5a96fa0cfc4402d29c959f1f48a0
miniflux/miniflux,xqin/miniflux,xqin/miniflux,miniflux/miniflux,xqin/miniflux,miniflux/miniflux,xqin/miniflux
api/subscription.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\nCopyright (c) 2014 VMware, Inc. All Rights Reserved.\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...
go
edit
9
3
apache-2.0
c72543acbae9ab33657d5715823b2b90378c88be
runner-mei/govmomi,cgtexmex/govmomi,vmware/govmomi,dougm/govmomi,l1jiang/govmomi,daxgames/govmomi,excilsploft/govmomi,bruceadowns/govmomi,casualjim/govmomi,ilikejam/govmomi,ilikejam/govmomi,jrmycanady/govmomi,higebu/govmomi,cgtexmex/govmomi,bruceadowns/govmomi,excilsploft/govmomi,pietern/govmomi,cgtexmex/govmomi,vmware...
govc/cli/register.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage db\n\nimport \"github.com/jmoiron/sqlx\"\n\n// Setup setup the database connection and init the Writer\nfunc Setup(uri string) error {\n\tdb, err := sqlx.Connect(\"postgres\", uri)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tWriter = d...
go
edit
3
2
mit
2e860c557cd85ffe324df315829edb247c1a2259
ml-tv/tv-api,ml-tv/tv-api
src/core/storage/db/setups.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage redis\n\nimport (\n\t\"testing\"\n\n\t\"gopkg.in/redis.v5\"\n)\n\nvar defaultAddr = \"127.0.0.1:6379\"\n\nfunc Test_CheckpointLifecycle(t *testing.T) {\n\tclient := redis.NewClient(&redis.Options{Addr: defaultAddr})\n\n\tc := &Checkpoin...
go
edit
9
4
mit
b0245d688b93d66794e509d977d444d6f3cc0086
harlow/kinesis-connectors
checkpoint/redis/redis_test.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// This downloads and installs the protobuf compiler\n\n//go:generate rm -rf include\n//go:generate rm -rf bin\n//go:generate rm -rf readme.txt\n//go:generate rm -rf protoc.zip\n//go:generate ./downloadProtoc.sh\n//go:generate unzip protoc.zip ...
go
edit
0
0
apache-2.0
5403544d97f1af357772baa4f73e1a4202f2b6b7
grafeas/grafeas,Grafeas/Grafeas,grafeas/grafeas
protoc/generate.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\n// TimeoutError is error returned after timeout occured.\ntype TimeoutError struct {\n\tafter time.Duration\n}\n\n// Error implements the Go error interface.\nfunc (t *TimeoutError) Error() ...
go
edit
0
3
apache-2.0
74a86c1b5e13feab29a7b1c4ed10e62d33109f42
php-coder/source-to-image,coreydaley/source-to-image,PI-Victor/source-to-image,dobbymoodge/source-to-image,csrwng/source-to-image,PI-Victor/source-to-image,csrwng/source-to-image,coreydaley/source-to-image,php-coder/source-to-image,mfojtik/source-to-image,guangxuli/source-to-image,openshift/source-to-image,rhcarvalho/s...
pkg/util/timeout.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage piglowservice\n\nimport (\n\t\"log\"\n\n\tpb \"github.com/didrocks/grpc-piglow/proto\"\n\tcontext \"golang.org/x/net/context\"\n)\n\nfunc (s *service) SetLED(ctx context.Context, in *pb.LedRequest) (*pb.Ack, error) {\n\ts.p.SetLED((int8...
go
edit
3
4
mit
7ce6676f1efbcebd5d16c292947187bee7cf9df3
didrocks/grpc-piglow
piglowservice/piglow.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage server\n\nvar shouldShutdown = make(chan bool, 1)\n\n// RunForever runs for ever.\nfunc RunForever() {\n\t<-shouldShutdown\n}\n\n// Shutdown shutdowns the server gracefully.\nfunc Shutdown() {\n\tshouldShutdown <- true\n}\n\n```\n\nAppl...
go
edit
0
2
apache-2.0
9e7c6f942e2414e9efdfb4e4cf0d25457312ffcc
xgfone/go-tools
lifecycle/server/shutdown.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/dherbst/septa\"\n)\n\n// NextToArrive takes a \"from\" station name and a \"to\" station name and returns the expected trains.\nfunc NextToArrive(ctx context.Context...
go
edit
0
3
mit
0d3e26e96f28288978329b936a5b8f75beb0df4e
dherbst/go-septa
cmd/septa/next.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2013 The Bufferpool Authors. All rights reserved.\n// Use of this source code is governed by the BSD 2-Clause license,\n// which can be found in the LICENSE file.\n\npackage bufferpool_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"...
go
edit
0
2
bsd-2-clause
7c9cc10e47ff4e7cba4c678f12aa079866ad61ab
pushrax/bufferpool
bufferpool_test.go
rejected_duplicate
Near-duplicate of sample 117584
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/netlify/netlify-auth/conf\"\n\t\"github.com/netlify/netlify-auth/models\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar migrateCmd = cobra.Command{\n\tUse: \"migrate\",\n\tLon...
go
edit
3
2
mit
438e897eb9e1d9dd8e9eeffed36a9a636ce752d2
netlify/gotrue,netlify/gotrue
cmd/migrate_cmd.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// project problem_005 main.go\n// Solution for Project Euler Problem #005, Smallest multiple.\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k int\n\tfor i := 1; true; i++ {\n\t\t// Let the user know we are still in search of the solu...
go
edit
0
6
unlicense
b0d24e0843195685b3942de931116b4f30930d2f
petergloor/euler
problem_005/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cryptopals\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"testing\"\n)\n\nfunc TestDecryptRsaParityOracle(t *testing.T) {\n\tpriv := generateRsaPrivateKey(1024)\n\tpub := priv.public()\n\n\tencoded := \"VGhhdCdzIHdoe...
go
edit
9
1
mit
b0f1382bb1e8e0c34b2cf42a17a8e4a58a01ad56
Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go
challenge46_test.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\"regexp\"\n\t\"testing\"\n)\n\nvar genMatcherTests = []struct {\n\tsrc string\n\tdst *regexp.Regexp\n}{\n\t{\"abc\", regexp.MustCompile(`abc`)},\n\n\t{\"a,b\", regexp.MustCompile(`(a|b)`)},\n}\n\nfunc...
go
edit
0
4
mit
81e0b8ff7074d90473fc6a2887173c97d1394f0c
kusabashira/msub
subvert_test.go
rejected_duplicate
Near-duplicate of sample 117537
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage start\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\nfunc TestCommand(t *testing.T) {\n\tSkipConvey(\"When setting up a command\", t, func() {\n\n\t\tCommands.Add(&Command{\n\t\t\tName: ...
go
edit
18
1
bsd-3-clause
aa58475324e1f1579827152687b3186fa28cadc2
christophberger/start
command_test.go
rejected_lint
Too many lint violations: 18
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2015 The Cockroach Authors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http...
go
edit
0
1
apache-2.0
f6017185f73ffb7c6160c0fa2c9c3fa105bc2adf
vaibhavarora/cockroach,arjun4084346/cockroach,slavau/cockroach,maxlang/cockroach,cockroachdb/cockroach,nieyy/cockroach,jess-edwards/cockroach,jamesgraves/cockroach,bg451/cockroach,jgautheron/cockroach,hassyma/cockroach,chrisseto/cockroach,slavau/cockroach,jamesgraves/cockroach,ngaut/cockroach,vaibhavarora/cockroach,pet...
acceptance/util.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2016 Keybase Inc. All rights reserved.\n// Use of this source code is governed by a BSD\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage dokan\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc Test...
go
edit
6
2
bsd-3-clause
ac435a55b8a6491a4223610ac38d0b1a83b6ff9d
keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/kbfs,keybase/kbfs,keybase/client,keybase/kbfs,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/kbfs
dokan/dokan_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage dsl\n\nimport (\n\t\"testing\"\n\n\t\"github.com/goadesign/goa/design\"\n\t\"github.com/goadesign/goa/eval\"\n)\n\nconst (\n\tdescription = \"test description\"\n)\n\nfunc TestDescription(t *testing.T) {\n\tcases := map[string]struct {\...
go
edit
3
1
mit
b9068c56bd52f75b1c68a6b141a50b6da291013c
goadesign/goa,raphael/goa
design/dsl/description_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage exchange\n\nimport \"github.com/qp/go/utils\"\n\n// Request defines all the fields and information\n// in the standard qp request object. It is used\n// as part of the RequestHandler callback.\ntype Request struct {\n\t*Response\n\tTo [...
go
edit
0
1
mit
57b6f7c1d37c5c5d0abbd4a4b74f1b3e60f9e640
qp/go,qp/go
exchange/request.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage controller\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gilcrest/errs\"\n\t\"github.com/rs/xid\"\n)\n\n// RequestID is the unique Request ID for each request\ntype RequestID struct {\n\txid.ID\n}\n\n// StandardResponseFields is meant t...
go
edit
0
1
mit
4bc09c06c10b11de6a395f2ccdcc0fa66e5fd9a7
gilcrest/go-API-template,gilcrest/go-API-template
controller/controller.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cf_http_test\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/cloudfoundry-incubator/cf_http\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"CfHttp\", func() {\n\tDescribe(\"NewClien...
go
edit
0
1
apache-2.0
db1bf7202e706de8d7460c1b54494ac7ab481a59
cloudfoundry-incubator/cf_http,cloudfoundry-incubator/cf_http
cf_http_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage machines\n\nimport (\n\t\"bytes\"\n\t\"encoding/base64\"\n\t\"text/template\"\n\n\t\"github.com/pkg/errors\"\n)\n\nvar userDataListTmpl = template.Must(template.New(\"user-data-list\").Parse(`\nkind: List\napiVersion: v1\nmetadata:\n r...
go
edit
0
3
apache-2.0
d7a4edc76af7f376eb7f05b332053c684e0a3c73
derekhiggins/installer,derekhiggins/installer
pkg/asset/machines/userdata.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\npackage nvim\n\nimport (\n\t\"encoding/binary\"\n\n\t\"github.com/garyburd/neo...
go
edit
0
7
bsd-3-clause
87c8707f7faf1083006a7b2046cb3014ae4dc6f8
zchee/nvim-go,zchee/nvim-go
src/nvim-go/nvim/buffer.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage types\n\nimport sdk \"github.com/cosmos/cosmos-sdk/types\"\n\nfunc (upgrade ProposedUpgrade) HasApprovalFrom(address sdk.AccAddress) bool {\n\taddrStr := address.String()\n\tfor _, approval := range upgrade.Approvals {\n\t\tif approval....
go
edit
6
3
apache-2.0
1be067ae18f7bcd7be30856dd1149d58d1cea8bb
zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger
x/dclupgrade/types/proposed_upgrade.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage prefer\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestLoadCreatesNewConfiguration(t *testing.T) {\n\ttype Mock struct {\n\t\tName string `json:\"name\"`\n\t\tAge int `json:\"age\"`\n\t}\n\n\tmock := Mock{}\n\n\tconfigurati...
go
edit
15
4
mit
69d4dd3f26cb03ef8c5171bc661725fc12304282
LimpidTech/prefer.go
prefer_test.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\"io\"\n\t\"net/http\"\n)\n\ntype Postit struct {\n\tId string\n\tTitle string\n\tCoords [2]int\n\tBoard_id string\n\t//FIXME : corners \n}\n\n\n\nfunc ListPostits(w http.ResponseWriter, req *http.Request) {\n\tboard...
go
edit
0
3
mit
99cfacecefa730f7f8b6317abff267bdaf190b5f
AF83/koalab,AF83/koalab
api/postits.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage ingester\n\nimport (\n\t\"sync\"\n\t\"sync/atomic\"\n\t\"time\"\n)\n\ntype ewmaRate struct {\n\tnewEvents int64\n\talpha float64\n\tinterval time.Duration\n\tlastRate float64\n\tinit bool\n\tmutex sync.Mutex\n}\n\nfunc ne...
go
edit
0
2
apache-2.0
00ab1bb968d1444d2fe1daa6defd2682c082d361
tomwilkie/cortex,tomwilkie/cortex,tomwilkie/cortex
ingester/rate.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"flag\"\n\t\"os\"\n\n\t\"github.com/google/subcommands\"\n)\n\nvar serverAddress = flag.String(\"address\", \"\", \"The address of the server\")\n\nfunc main() {\n\tsubcommands.ImportantFlag(\"address...
go
edit
9
1
mit
ef3957501951e02a9a2df304808b9cde31114de3
MohamedBassem/godge
cmd/godge/main.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// Copyright 2013 The GoGL2 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.mkd file.\npackage wgl\n\n// #cgo windows LDFLAGS: -lopengl32\n// #define WIN32_LEAN_A...
go
edit
3
1
bsd-3-clause
6d991a22994aa9fd96d62f60cba00f291c75dbc0
chsc/gogl2
procaddr/wgl/wgl.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc defaultDirectory() string {\n\tbase := filepath.Base(os.Args[0])\n\text := filepath.Ext(base)\n\n\tdrv := os.Getenv(\"SystemDrive\")\n\tpdDir := \"ProgramData\"\n\tname := bas...
go
edit
0
1
mit
dc4007005dabaa1e9284e81d0bedcaba683ea269
codemodus/config
defdir_windows.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage envconfig_test\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/vrischmann/envconfig\"\n)\n\nfunc ExampleInit() {\n\tvar conf struct {\n\t\tMySQL struct {\n\t\t\tHost string\n\t\t\tPort int\n\t\t\tDatabase struct {\n\t\t\t\tUs...
go
edit
0
2
mit
952c2b91c9f72ecabf7194a1e0385fbbafe9bcaa
vrischmann/envconfig
example_test.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\n\t\"github.com/ghthor/engine/rpg2d\"\n\t\"github.com/ghthor/engine/rpg2d/quad\"\n)\n\ntype inputPhase struct{}\ntype narrowPhase struct{}\n\nfunc (inputPhase) ApplyInputsIn(c quad.Chunk) quad.Ch...
go
edit
3
3
mit
6e4546b6820738580d8a30bb1d1719abd12dd41c
ghthor/aodd,ghthor/aodd
main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build integration\n\npackage memory\n\nimport (\n\t\"context\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestMemoryAllocationAttack(t *testing.T) {\n\tassert := assert.New(t)\n\tvar siz...
go
edit
6
1
apache-2.0
36bb6f98f800cf2b42502e02afa594ab20d56feb
slok/ragnarok,slok/ragnarok
attack/memory/alloc_integration_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage groupme\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/nelsonleduc/calmanbot/service\"\n\t\"github.com/nelsonleduc/calmanbot/utility\"\n)\n\nconst postDelayMilliseconds = 500\nconst...
go
edit
0
2
mit
8ba2379b83f8bd52444b9a1b9628a916bdc67ea4
NelsonLeDuc/CalmanBot,NelsonLeDuc/CalmanBot
groupme/gmservice.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage http\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/leancloud/satori/master/g\"\n\t\"github.com/leancloud/satori/master/state\"\n)\n\nfunc addHandlers() {\n\thttp.HandleFunc(\"/state\", func(w http.Respons...
go
edit
0
2
apache-2.0
6c698df81a208c4deb25044cde8e49d94ec1cf00
kadashu/satori,kadashu/satori,kadashu/satori,kadashu/satori,kadashu/satori,kadashu/satori
master/http/http.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage binstore\n\nimport \"github.com/boltdb/bolt\"\n\n// BoltDB store.\ntype BoltDB struct {\n\tdb bolt.DB\n}\n\n```\n\nApply this change: Add BoltDB binary store backend" }, { "role": "assistant", "content": "package binstore\n\...
go
edit
3
3
apache-2.0
7bd6df6add30571140f6d8aafccc6e6af7099c6a
deejross/dep-registry
binstore/boltdb.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage srpc\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"os\"\n\t\"path\"\n\t\"strings\"\n)\n\nfunc loadCertificates(directory string) ([]tls.Certificate, error) {\n\tdir, err := os.Open(directory)\n\tif err != nil {\n\t\treturn nil, err\n\t}...
go
edit
0
7
apache-2.0
cb1f88ae032e8f8010d1fe997ff2e0366b27f2af
rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator
lib/srpc/load.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage scraper\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/pachyderm/pachyderm/src/client/pkg/require\"\n)\n\nfunc TestScraper(t *testing.T) {\n\twd, err := os.Getwd()\n\trequire.NoError(t, err)...
go
edit
0
1
apache-2.0
6cab290e2c4e9da87a5c115e845cd4afc1dd18a5
pachyderm/pfs,pachyderm/pfs,pachyderm/pfs
examples/scraper/scraper_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/*\n Demonstrate how to use channels and goroutines to keep the program alive.\n Iterate over a slice of numbers, passing each each i to a function\n that calculates the base10 log of i.\n We don't actually care what the return value is.\n ...
go
edit
0
2
bsd-3-clause
19a0ec601e30cebc35e172e7e061540e05d68d3b
ewk/nclug-go,ewk/nclug-go
Demo1.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cloudflare\n\ntype ResourceGroup struct {\n\tID string `json:\"id\"`\n\tName string `json:\"name\"`\n\tMeta map[string]string `json:\"meta\"`\n\tScope Scope `json:\"scope\"`\n}\n\ntype Scope struct...
go
edit
6
1
bsd-3-clause
61f081fd35288bb195bfaea54b8080f2b2dbdc47
cloudflare/cloudflare-go,cloudflare/cloudflare-go
resource_group.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\"reflect\"\n\t\"regexp\"\n\t\"testing\"\n)\n\nvar genMatcherTests = []struct {\n\tsrc string\n\tdst *regexp.Regexp\n}{\n\t{\"abc\", regexp.MustCompile(`(abc)`)},\n\t{\"abcdef\", regexp.MustCompile(`(abcdef)`)},\n\n\...
go
edit
3
4
mit
00ed1a162ef149064fd4f409a3e8441578731fab
kusabashira/msub
subvert_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n/* Copyright (c) 2015, Daniel Martí <<EMAIL>> */\n/* See LICENSE for licensing information */\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/mvdan/xurls\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.St...
go
edit
0
4
bsd-3-clause
0ec39644a6e2b17a33d419fe1464a93b7a700b50
digideskio/xurls,mvdan/xurls
cmd/xurls/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage channels\n\ntype DemandState struct {\n\tRated *float64 `json:\"rated,omitempty\"` // rated maximum power, in Watts\n\tObservedMax *float64 `json:\"observedMax,omitempty\"` // the observed max current power for this devi...
go
edit
9
1
mit
d39bb230fd0b01fb94a948e58f1800f9dc51f715
ninjasphere/go-ninja,ninjasphere/go-ninja
channels/Demand.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage projects\n\nimport \"time\"\n\nconst (\n\t// GetSbomEndpoint is the current endpoint for retrieving an organization's SBOMs\n\tGetSbomEndpoint = \"v1/project/getSBOM\"\n\t// GetSbomsEndpoint is the current endpoint for retrieving an org...
go
edit
3
0
apache-2.0
41f48b4306e50a2f3d42169b5a7f97a8b91fec01
ion-channel/ionic,ion-channel/ionic
projects/sboms.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage base\n\n// IDInferable represents models that have IDs that can be infered by names.\ntype IDInferable interface {\n\tInferID(cn Connection) error\n\tGetNames(cn Connection, name string) ([]string, error)\n}\n\n```\n\nApply this change:...
go
edit
6
0
apache-2.0
4a348d466b954cf028e8a23735e702668c7cc5ff
CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli
base/id_inferable.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage prgs\n\nimport (\n\t\"testing\"\n\n\t. \"github.com/VonC/godbg\"\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\ntype testGetter struct{}\n\nfunc (tg testGetter) Get() []Prg {\n\treturn []Prg{&prg{}}\n}\nfunc TestMain(t *testing...
go
edit
45
2
mit
ea41efa3672fceeaa1151fa9d042b49a3bc7e5ef
VonC/senvgo,VonC/senvgo
prgs/prgs_test.go
rejected_lint
Too many lint violations: 45
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport \"code.google.com/p/gcfg\"\n\n// Config is config\ntype Config struct {\n\tTelegram struct {\n\t\tToken string\n\t\tUsername string\n\t}\n}\n\nfunc getConfig() (Config, error) {\n\tvar cfg Config\n\terr := gcfg.ReadFil...
go
edit
3
1
mit
330114d17efbaa3acf11c6bec6a114c14d660bb6
sanchopanca/irrverbs
irrverbs/config.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build amd64,darwin\n\npackage copy\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc getTimeSpec(info os.FileInfo) timespec {\n\tstat := info.Sys().(*syscall.Stat_t)\n\ttimes := timespec{\n\t\tMtime: info.ModTime(),\n\t\tAtime: ti...
go
edit
12
1
mit
c8b97052dfbb80daf49ffd43ec10993c33aaba11
otiai10/copy,otiai10/copy
stat_times_darwin.go
rejected_lint
Too many lint violations: 12
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage crypt\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n)\n\nconst (\n\tpassphrase = \"testingpassphrase\"\n\tfilecontents = \"woweezowee\"\n\tfiletestpath = \"/tmp/encryptdecrypttest\"\n)\n\nfunc TestEncryptDecrypt(t *testing.T)...
go
edit
0
6
apache-2.0
e32f97cbad97305145b4f3879b305eddc75f32bc
pshima/consul-snapshot,pshima/consul-snapshot
crypt/crypt_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage battery\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nvar (\n\tmodkernel32 = syscall.NewLazyDLL(\"kernel32\")\n\tprocGetSystemPowerStatus = modkernel32.NewProc(\"GetSystemPowerStatus\")\n)\n\ntype SYSTEM_POWER_STATUS struc...
go
edit
3
4
mit
0e788a4a2c8a859ac638143a2d95c5a5961b87f3
Code-Hex/battery
battery_windows.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model\n\nimport \"regexp\"\n\ntype Route struct {\n\tId int64 `json:\"-\"`\n\tName string `json:\"name\"`\n\tPattern string `json:\"pattern\"`\n\tBroker string `json:\"broker\"`\n\tFrom string `json:\"from\" db:\"fromN...
go
edit
9
2
mit
4cd80fc744507cc9c2eba328da5777e6f184447f
minchao/smsender,minchao/smsender,minchao/smsender,minchao/smsender
smsender/model/route.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage maker\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc check(value, pattern string, t *testing.T) {\n\tif value != pattern {\n\t\tt.Fatalf(\"Value %s did not match expected pattern %s\", value, pattern)\n\t}\n}\n\nfunc TestLines(t *...
go
edit
6
2
apache-2.0
07f1d94bdb9b961ae76432a23de8919ab96a6d72
vburenin/ifacemaker
maker/maker_test.go
rejected_lint
Too many lint violations: 6
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage transports\n\nimport (\n \"log\"\n)\n\ntype DummyMarshaler struct {\n}\n\nfunc (marshaler DummyMarshaler) Marshal(i *interface{}) (error, interface{}) {\n log.Println(\"** DummyMarshaler, input\", *i)\n var err error\n\treturn err, [...
go
edit
0
1
mit
1cb3c147fa9e8916b885c95d743b455db6c83908
matiasinsaurralde/transports
marshalers/dummy.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"crypto/tls\"\n\t\"crypto/x509\"\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"io/ioutil\"\n\t\"os\"\n)\n\nfunc setupTls() {\n\tif *caFile == \"\" || *certFile == \"\" || *keyFile == \"\" {\n\t\tretu...
go
edit
0
7
apache-2.0
08d47cdc838240ed5517cdf98307c5d897f53599
keep94/Dominator,Symantec/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator,keep94/Dominator
cmd/subd/tls.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build !windows\n\npackage gottyclient\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"golang.org/x/sys/unix\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n)\n\nfunc notifySignalSIGWINCH(c chan<- os.Signal) {\n\tsignal.Notify(c, syscall.SIGWI...
go
edit
3
3
mit
a7be1467bfd712922e9f58e0c4ea61e3de12f4d0
moul/gotty-client,moul/gotty-client,moul/gotty-client,moul/gotty-client
arch.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage hackedu\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"appengine\"\n)\n\ntype School struct {\n\tName string `json:\"latitude,omitempty\"`\n\tLocation Location\n}\n\ntype Location struct {\n\tLatitude float32 `j...
go
edit
3
2
mit
d080a32aa618961a48042dfaa48c1e5277a64e8a
hackedu/website,zachlatta/website,hackedu/website,zachlatta/website,hackedu/website,zachlatta/website
hackedu/schools.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage options\n\nimport (\n\t\"github.com/spf13/pflag\"\n)\n\ntype Config struct {\n\tMaster string\n\tKubeConfig string\n\tProviderName string\n\tClusterName string\n\tLoadbalancerImageName string...
go
edit
0
1
apache-2.0
f307d74d3ace796a60b80d98ae6dd71e1fd94951
appscode/voyager,appscode/voyager,appscode/voyager
cmd/voyager/app/options/options.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage entrevista_test\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/hoop33/entrevista\"\n)\n\nfunc Example() {\n\tinterview := entrevista.NewInterview()\n\tinterview.ReadAnswer = func(question *entrevista.Question) (string, error) {\n\t\treturn qu...
go
edit
0
2
mit
8de6bfe333c1f26124245d2d0aeffd18720f3110
hoop33/entrevista
entrevista_test.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage models\n\nimport (\n\t\"gopkg.in/yaml.v2\"\n\t\"io/ioutil\"\n)\n\ntype Setting struct {\n\tDatabase struct {\n\t\tHost string\n\t\tDbName string\n\t\tTokenTable string\n\t\tUserTable string\n\t}\n}\n\nvar Set Setting\n\nfunc ...
go
edit
3
3
mit
946342bf0d34850bec4be1cd5ac94977112edc8e
herald-it/goncord
models/settings.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage medtronic\n\nimport (\n\t\"log\"\n\t\"time\"\n)\n\nconst (\n\tWakeup CommandCode = 0x5D\n)\n\nfunc (pump *Pump) Wakeup() {\n\tpump.Model()\n\tif pump.Error() == nil {\n\t\treturn\n\t}\n\tlog.Printf(\"waking pump\")\n\tconst (\n\t\t// Ol...
go
edit
9
3
mit
f740ab9b8c6801e16ec3f290a62a09df51045c8f
ecc1/medtronic,ecc1/medtronic
wakeup.go
rejected_lint
Too many lint violations: 9
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage livestatus\n\nimport (\n\t\"net\"\n)\n\nconst bufferSize = 1024\n\n// Client represents a Livestatus client instance.\ntype Client struct {\n\tnetwork string\n\taddress string\n\tdialer *net.Dialer\n\tconn net.Conn\n}\n\n// NewClien...
go
edit
3
4
bsd-3-clause
8a8d0404ce817ec490cf7995468ce5ffba8fc3ea
vbatoufflet/go-livestatus
client.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage buildlog\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/mattes/migrate\"\n\t\"github.com/mattes/migrate/database/postgres\"\n\t_ \"github.com/mattes/migrate/source/file\"\n)\n\ntype migrationLogger struct {\n}\n\nfunc (m migrationL...
go
edit
3
5
mit
2b58b1f68d60aaf8fb524551f4ce2e0d36c5656c
fajran/buildlog
pkg/buildlog/db-migration.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage model\n\n// Customer is a model in the \"customers\" table.\ntype Customer struct {\n\tID int `json:\"id\"`\n\tName *string `json:\"name\" gorm:\"not null\"`\n}\n\n// Order is a model in the \"orders\" table.\ntype Order struct {\...
go
edit
0
0
apache-2.0
b3dbcfb2989b29d211b58d2e87c7de4a9d434207
cockroachdb/examples-orms,cockroachdb/examples-orms,cockroachdb/examples-orms,cockroachdb/examples-orms,cockroachdb/examples-orms,cockroachdb/examples-orms,cockroachdb/examples-orms
go/gorm/model/models.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage ssh\n\nimport \"os\"\n\ntype C struct {\n\tUser string\n\tHost string\n\tHostKeyFun func([]byte)os.Error\n\tPasswordFun func()string\n}\n\nfunc New(C C) (*Client,os.Error) {\n\tc,e := connect(C.Host)\n\tif e != nil { return nil,e }\n\t...
go
edit
36
8
mit
6d8e70fb65d890ddd15fc09a8f89d40f2e71e005
albertjin/ssh
client.go
rejected_lint
Too many lint violations: 36
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage cache\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\ntype LocalFsCache struct {\n\tcacheDir string\n}\n\nconst (\n\tDefaultCacheDir = \"/tmp/risu/cache\"\n)\n\nfunc NewLocalFsCache() Cache {\n\tvar cacheDir string\n\n\tif os.Getenv(\"...
go
edit
0
4
mit
062236bb410a8c1d7bb999d5db398308f7a953e5
koudaiii/risu,wantedly/risu,koudaiii/risu,wantedly/risu,koudaiii/risu,wantedly/risu,koudaiii/risu,wantedly/risu
cache/local_fs.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/katnegermis/pocketmine-rcon\"\n)\n\nfunc main() {\n\tif len(os.Args) < 2 {\n\t\tfmt.Printf(\"Usage: ./rcon address password\")\n\t\treturn\n\t}\n\taddr ...
go
edit
3
8
mit
8d453096f9be0c37094074e60365e96316c5d044
katnegermis/pocketmine-rcon
cli/main.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// +build windows,unit\n\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"). You may\n// not use this file except in compliance with the License. A copy...
go
edit
15
1
apache-2.0
d8cf7ed293a62e21229b7234eae227ebe2e6de39
kiranmeduri/amazon-ecs-agent,swipely/amazon-ecs-agent,swipely/amazon-ecs-agent,swipely/amazon-ecs-agent,aws/amazon-ecs-agent,aws/amazon-ecs-agent,kiranmeduri/amazon-ecs-agent,swipely/amazon-ecs-agent,kiranmeduri/amazon-ecs-agent,aws/amazon-ecs-agent,kiranmeduri/amazon-ecs-agent,aws/amazon-ecs-agent
agent/config/parse_windows_test.go
rejected_lint
Too many lint violations: 15
true
[ { "role": "user", "content": "Here is the current file:\n```go\npackage lru1\n\nimport \"container/list\"\n\ntype Item struct {\n\tkey string\n\tvalue string\n}\n\ntype Cache struct {\n\tcapacity int\n\tdata map[string]*list.Element\n\tlst *list.List\n}\n\nfunc NewCache(capacity int) *Cache {\n\t...
go
edit
0
2
mit
2cbd819b353e8a6cde818ffb4e98dc5239eae44d
krasoffski/gomill,krasoffski/gomill
lru1/lru1.go
accepted
null
true
[ { "role": "user", "content": "Here is the current file:\n```go\n// goslow is a slow HTTP server that responds with errors.\n// Visit https://github.com/alexandershov/goslow for more details.\npackage main\n\nimport (\n\t\"log\"\n)\n\n// main starts a slow HTTP server that responds with errors.\nfunc main() ...
go
edit
6
1
mit
99e70cb75f5fa8e1911325373aeea57206fe8a71
alexandershov/goslow,alexandershov/goslow
goslow.go
rejected_lint
Too many lint violations: 6
true