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 middleware\n\nimport (\n\t\"time\"\n\n\tlog \"github.com/sirupsen/logrus\"\n\t\"gopkg.in/gin-gonic/gin.v1\"\n)\n\nfunc Logger() gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\trequestID, _ := c.Get(\"request_id\")\n\t\tlogger :=... | go | edit | 6 | 1 | mit | 36f181474e42aa9c82ab8f63a2bfdbf3986e1736 | jingweno/jqplay,jingweno/jqplay,jingweno/jqplay | server/middleware/logger.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bot\n\nimport (\n\t\"regexp\"\n)\n\ntype Bot struct {\n\tadapter Adapter\n\tHandlers map[*regexp.Regexp]func(msg *Message)\n}\n\nfunc New(adapter Adapter) *Bot {\n\treturn &Bot{\n\t\tadapter,\n\t\tmap[*regexp.Regexp]func(msg *Message){... | go | edit | 15 | 4 | mit | 9cdaaa37c68472b496f804cf5d9b72bc4e57981d | esoui/lexicon,esoui/lexicon | bot/bot.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"fmt\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar minCommits, maxCommits int\n\nvar randomCmd = &cobra.Command{\n\tUse: \"random\",\n\tShort: \"Random will add commits throughout the past 365 days.\",\n\tLong: `R... | go | edit | 6 | 1 | mit | e9082ab817309f126a3bd623e2f1d43f0ddeea8b | 0xfoo/punchcard | commands/random.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"sync\"\n\n\tss \"github.com/Jigsaw-Code/outline-ss-server/shadowsocks\"\n)\n\nvar pool = sync.Pool{\n\tNew: func() interface{} {\n\t\treturn make([]byte, ss.MaxUDPPacketSize)\n\t},\n}\n\n// newBuffer retrieves a ... | go | edit | 3 | 1 | apache-2.0 | e44d8f60835d14705cf459986b30876f19de3a8e | Jigsaw-Code/outline-ss-server | client/udp_buffer_pool.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\"net/http\"\n\t\"os\"\n\t\"time\"\n)\n\nfunc main() {\n\tfor _, arg := range os.Args[1:] {\n\t\tfmt.Println(\"address was \" + arg)\n\t\tfetch(arg)\n\t}\n}\n\nfunc fetch(arg string) {\n\t... | go | edit | 0 | 3 | mit | fcc1481079908c44a58fa670e7eede6b7ed6ffba | cwaltken-edrans/goad,betabrand/goad,goadapp/goad,cwaltken-edrans/goad,cwaltken-edrans/goad,zeph/goad,betabrand/goad,goadapp/goad,zeph/goad,goadapp/goad,zeph/goad | lambda/lambda.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\"io\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/ChimeraCoder/gitgo\"\n)\n\nfunc main() {\n\targs := os.Args\n\tmodule := args[1]\n\tswitch module {\n\tcase \"cat-file\":\n\t\thash := args[2]\n\t... | go | edit | 0 | 7 | apache-2.0 | de2acc09a72eef33252c3dcc2fb0865d553dc990 | ChimeraCoder/gitgo,ChimeraCoder/gitgo,ChimeraCoder/gitgo | gitgo/gitgo.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\n\t\"github.com/gorilla/mux\"\n\t\"github.com/shurcooL/go/github_flavored_markdown\"\n)\n\nfunc DiffHandler(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\n\tfile := vars... | go | edit | 3 | 2 | mit | 96885d09d7fb51738c42af368424911235c3b61a | dushmis/go-wiki,dushmis/go-wiki,dushmis/go-wiki | api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gorand\n\nimport (\n\t\"testing\"\n)\n\nfunc TestID(t *testing.T) {\n\tid, err := ID()\n\tif err != nil {\n\t\tt.Error(err.Error())\n\t}\n\n\tif len(id) != 128 {\n\t\tt.Error(\"Length of UUID isn't 128\")\n\t}\n}\n\nfunc TestUUID(t *tes... | go | edit | 21 | 5 | mit | 80b71c1d4e233f7ea3055399f63169f447038ebf | leonelquinteros/gorand | id_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tunnelserver\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/rancher/remotedialer\"\n\t\"github.com/sirupsen/logrus\"\n)\n\ntype Authorizers struct {\n\tchain []remotedialer.Authorizer\n}\n\nfunc ErrorWriter(rw http.ResponseWriter, req *h... | go | edit | 0 | 5 | apache-2.0 | 60541d1b4958ba69a913b4d0d548bc25b4aa74f4 | rancher/rancher,rancher/rancher,rancher/rancher,rancher/rancher | pkg/tunnelserver/chain.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 Vic Demuzere\n//\n// Use of this source code is governed by the MIT license.\n\n// Package irc allows your application to speak the IRC protocol.\n//\n// The Message and Prefix structs provide translation to and from raw IRC m... | go | edit | 0 | 0 | mit | ecf3a6281a81ca8eb790bb77515627e0431ec095 | sorcix/irc,belak/sorcix-irc,Kimau/irc,MorpheusXAUT/irc | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2018 The Skaffold Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org... | go | edit | 0 | 5 | apache-2.0 | e4fdba6ce8ecb4148d639c412e35990b96afc332 | GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold | pkg/skaffold/config/options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !appengine\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc helloWorld(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Hello World!\")\n}\n\nfunc startPage(w http.ResponseWriter, r *http.Request) {\n\tfm... | go | edit | 0 | 1 | mit | 5991d1e01fdc036109313223b99c9bac29529bfc | GreyLabsDev/GoTests,GreyLabsDev/GoTests | hw.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage read\n\n// Fk scores the Flesch-Kincaid Grade Level.\n// See https://en.wikipedia.org/wiki/Flesch%E2%80%93Kincaid_readability_tests.\nfunc Fk(text string) float64 {\n\tsylCnt := float64(CntSyls(text))\n\twordCnt := float64(CntWords(text... | go | edit | 6 | 1 | mit | 4781b2c2ffbb021f7a1b7311c23dfe4d76320f00 | BluntSporks/readability | fk.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\"github.com/spf13/cobra\"\n\n\t\"vitess.io/vitess/go/cmd/rulesctl/common\"\n)\n\nfunc List() *cobra.Command {\n\tvar listOptName string\n\tvar listOptNamesOnly bool\n\tlistCmd := &cobra.Command{\n\t\tUse: \"list\",... | go | edit | 0 | 7 | apache-2.0 | f15e7a6c1626b77462f266ea7e6f94384ce5ef9b | mahak/vitess,vitessio/vitess,mahak/vitess,vitessio/vitess,mahak/vitess,vitessio/vitess,vitessio/vitess,vitessio/vitess,mahak/vitess,mahak/vitess,mahak/vitess,vitessio/vitess,vitessio/vitess,mahak/vitess,mahak/vitess,vitessio/vitess | go/cmd/rulesctl/cmd/list.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !php7\n\npackage engine\n\n// #cgo CFLAGS: -Iinclude/php5\n// #cgo LDFLAGS: -lphp5\nimport \"C\"\n\n```\n\nApply this change: Add necessary include directives for PHP 5 path\n\nCertain distributions, such as Debian, ship include files... | go | edit | 0 | 0 | mit | 0882169cff2bc982773234e7f85c774a8cb015df | deuill/go-php,taowen/go-php7,deuill/go-php,deuill/go-php,taowen/go-php7 | engine/php5.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage synchk\n\nimport (\n\t\"go/parser\"\n\t\"go/scanner\"\n\t\"go/token\"\n\t\"gosubli.me/mg\"\n)\n\ntype SynChk struct {\n\tFiles []FileRef\n}\n\ntype FileRef struct {\n\tFn string\n\tSrc string\n}\n\ntype Error struct {\n\tFn string... | go | edit | 0 | 3 | mit | 63b7488113665199259bc117e03b879a24a54a1c | DisposaBoy/GoSublime-next,DisposaBoy/GoSublime-next,DisposaBoy/GoSublime-next | src/gosubli.me/mg/meth/synchk/synchk.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage isolated\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t. \"github.com/onsi/gomega/gbytes\"\n\t. \"github.com/onsi/gomega/gexec\"\n\n\t\"code.cloudfoundry.org/cli/integration/helpers\"\n)\n\nvar _ = Descr... | go | edit | 30 | 1 | apache-2.0 | 4a0e50ddd5da0ad298b0807f3ea0cb5adc4693b5 | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | integration/shared/isolated/set_org_role_command_test.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Write go code for the following: Add some basic tests for the base `Resource`"
},
{
"role": "assistant",
"content": "package client\n\nimport (\n\t\"testing\"\n\n\t\"github.com/akamai/AkamaiOPEN-edgegrid-golang/jsonhooks-v1\"\n\t\"github.com/stretchr/testify/assert\... | go | new_file | 12 | 1 | apache-2.0 | c6b62311e4e894cea470aa1e52265df8ffde316d | akamai-open/AkamaiOPEN-edgegrid-golang | client-v1/api_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage eventnotifier\n\nimport (\n\t\"net/http\"\n\t\"sync\"\n\n\t\"github.com/Symantec/Dominator/lib/log\"\n\t\"github.com/Symantec/keymaster/proto/eventmon\"\n)\n\ntype EventNotifier struct {\n\tlogger log.DebugLogger\n\tmutex sync.Mutex\n\... | go | edit | 18 | 1 | apache-2.0 | e45e7692e526bd490c9f35df17cd6a9846140081 | rgooch/keymaster,Symantec/keymaster,Symantec/keymaster,rgooch/keymaster,Symantec/keymaster,rgooch/keymaster | keymasterd/eventnotifier/api.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cliedit\n\nimport (\n\t\"testing\"\n\n\t\"github.com/elves/elvish/cli/el/codearea\"\n\t\"github.com/elves/elvish/edit/ui\"\n\t\"github.com/elves/elvish/eval\"\n\t\"github.com/elves/elvish/styled\"\n\t\"github.com/elves/elvish/util\"\n)\... | go | edit | 15 | 1 | bsd-2-clause | e378de4981112c0d7b42aafcaaa65a316f2874e6 | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | cliedit/completion_test.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage testutils\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"time\"\n\n\t\"github.com/onsi/ginkgo\"\n\t\"github.com/onsi/gomega/gexec\"\n)\n\nfunc BuildExecutable() error {\n\treturn BuildExecutableForArch(\"\")\n}\n\nfunc BuildExecutableForArc... | go | edit | 0 | 3 | apache-2.0 | 5ce684ac44ad60a1880afe6e058daa7d9ffcf46e | allomov/bosh-init,forrestsill/bosh-init,forrestsill/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init,forrestsill/bosh-init,cloudfoundry/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init | testutils/run.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright © 2015-2020 Hilko Bengen <<EMAIL>>\n// All rights reserved.\n//\n// Use of this source code is governed by the license that can be\n// found in the LICENSE file.\n\npackage yara\n\n// #cgo !yara_no_pkg_config,!yara_static pkg-conf... | go | edit | 2 | 0 | bsd-2-clause | 5d1982aba581815d58dcc29c288d5cd553b49c36 | hillu/go-yara,hillu/go-yara | cgo.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clock\n\nimport \"time\"\n\ntype Clock interface {\n\tNewTicker(time.Duration) Ticker\n\tNow() time.Time\n}\n\nfunc New() Clock {\n\treturn clock{}\n}\n\ntype clock struct{}\n\nfunc (c clock) NewTicker(d time.Duration) Ticker {\n\tretur... | go | edit | 0 | 2 | mit | ef5dbe3c47a240ea1c07331e206e3bab43a9074d | jeremija/peer-calls,jeremija/peer-calls,jeremija/peer-calls | server/clock/clock.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage forge\n\nimport (\n\t\"github.com/sclevine/forge/engine\"\n)\n\ntype Loader interface {\n\tLoading(message string, progress <-chan engine.Progress) error\n}\n\ntype Colorizer func(string, ...interface{}) string\n\ntype AppConfig struct ... | go | edit | 3 | 0 | apache-2.0 | f652bf726b2fde487912f21f821a7d3b3a5d8be7 | sclevine/forge,sclevine/forge | forge.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/logplex/logplexc\"\n)\n\nfunc lineWorker(die dieCh, r *bufio.Reader, cfg logplexc.Config, sr *serveRecord) {\n\tcfg.Logplex = sr.u\n\n\ttarget, err := logp... | go | edit | 3 | 7 | bsd-2-clause | ac28e919d444f4a9caed968d4f0fab03bee49e44 | heroku/pg_logplexcollector | logfile.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/itsankoff/gotcha/server\"\n \"time\"\n \"log\"\n)\n\nfunc main() {\n s := server.New()\n wss := server.NewWebSocket()\n s.AddTransport(\"127.0.0.1:9000\", &wss)\n done := make(chan in... | go | edit | 0 | 2 | mit | b65c58d2e3d2e69fe3ff88524823e6d4f486fa5c | itsankoff/gotcha,itsankoff/gotcha | cmd/server/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage regressions\n\nimport (\n\t\"math\"\n\t\"testing\"\n)\n\nfunc TestMaxCombinedLogExp(t *testing.T) {\n\tr := NewCombined(math.Max, NewLogarithmic(), NewExponential())\n\terr := r.Fit(testDataPoints...)\n\tif err != nil {\n\t\tt.Fatal(err... | go | edit | 0 | 2 | mit | 3506051d9948eb6d3c0c75d62fbf7e097c5da392 | nubbel/go-regressions | combined_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage steps\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"regexp\"\n\n\t\"github.com/Originate/git-town/src/git\"\n)\n\n// Step represents a dedicated activity within a Git Town command.\n// Git Town commands are comprised of a number of steps that ... | go | edit | 0 | 2 | mit | 44f65247623dfde6da09c7ccccc8b7aa8078f129 | Originate/git-town,Originate/git-town,Originate/git-town,Originate/git-town,Originate/git-town | src/steps/step.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rpcd\n\nimport (\n\t\"encoding/gob\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"github.com/Symantec/Dominator/proto/objectserver\"\n\t\"io\"\n\t\"runtime\"\n)\n\nfunc (t *srpcType) AddObjects(conn *srpc.Conn) {\n\tdefer runtime.... | go | edit | 3 | 8 | apache-2.0 | 47e846e4b02fb137d8d237113c010206b729d210 | Symantec/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator | objectserver/rpcd/addObjects.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage release\n\nimport (\n\t\"path/filepath\"\n)\n\n// Factory is responsible for instantiating slices\n// of Releases based upon queries given from the API.\ntype Factory struct {\n\tmodulepath string\n\tfileurl string\n}\n\n// NewFactor... | go | edit | 9 | 3 | apache-2.0 | 5d23995d24b60cf3b045b690e55ed38e93d9ae26 | jolshevski/chester | release/factory.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nsinit\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t. \"github.com/smartystreets/goconvey/convey\"\n\t\"polydawn.net/repeatr/executor/tests\"\n\t\"polydawn.net/repeatr/testutil\"\n)\n\nfunc Test(t *testing.T) {\n\tConvey(\"Spec Compliance:... | go | edit | 0 | 1 | apache-2.0 | 250721a2cd531adef4273270934c3ec07d248dfa | kkroening/repeatr,polydawn/repeatr,subuser-security/repeatr,kkroening/repeatr,polydawn/repeatr,subuser-security/repeatr | executor/nsinit/nsinit_executor_test.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\n\t\"github.com/jeffail/gabs\"\n\t\"github.com/mitchellh/packer/packer\"\n)\n\nfunc UpdateJsonFile(file string, paths []string, value string, ui packer.Ui) error {\n\n\tcontent, err := iout... | go | edit | 0 | 4 | bsd-3-clause | 96afb454f71d4948bacc37bdca46190f28f0b891 | cliffano/packer-post-processor-json-updater | updater.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage routes\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Converts patterns like \"/users/:id\" to \"/users/(?P<id>\\d+)\"\nfunc convertSimplePatternToRegexp(pattern string) string {\n\tparts := strings.Split(pattern, \"/\")\n... | go | edit | 0 | 4 | mit | 919f6892f2f7c1323e4cbb6696444d471b1d0247 | DVI-GI-2017/Jira__backend | routes/helpers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/gexec\"\n\n\t\"testing\"\n)\n\nfunc TestBinaries(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tRunSpecs(t, \"Binaries Su... | go | edit | 30 | 1 | apache-2.0 | 657a9e6d12e5375a8ecf61b13cf884852d6b68fe | pivotal-cf/cred-alert,pivotal-cf/cred-alert | src/cred-alert/cmd/binaries_test.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage algoholic\n\nimport \"testing\"\n\nfunc TestInsertionSortSortsReversedInts(t *testing.T) {\n\tcorrectlySortsReversedInts(t, 1e4, func(ns []int) []int {\n\t\tInsertionSort(ns)\n\t\treturn ns\n\t})\n}\n\n```\n\nApply this change: Add triv... | go | edit | 6 | 1 | mit | 9c4cd6ff1a565c3e294b0a72f68bd7d3c312715b | lorenzo-stoakes/algoholic | sort/isort_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bittrex\n\ntype Order struct {\n\tOrderUuid string `json:\"OrderUuid\"`\n\tExchange string `json:\"Exchange\"`\n\tTimeStamp string `json:\"TimeStamp\"`\n\tOrderType string `json:\"OrderType\"`\n\tLim... | go | edit | 3 | 0 | mit | aadbde30454166a412835661a7108dbe5c7e3cb5 | toorop/go-bittrex,jyap808/go-bittrex,yangou/go-bittrex | order.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2020 DSR Corporation\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... | go | edit | 0 | 0 | apache-2.0 | 66e0d54c023596c02e0a6e01a3a46d6e9ffcd295 | 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/dclauth/types/constants.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage vm\n\nimport \"github.com/mediocregopher/seq\"\n\ntype Dictionary struct{ hashMap *seq.HashMap }\n\nfunc NewDictionary(ks []Object, vs []*Thunk) *Thunk {\n\tif len(ks) == len(vs) {\n\t\treturn NewError(\"Number of keys doesn't match wit... | go | edit | 15 | 3 | mit | 3bb0dd0322d84fdca6405192216718b61a3cc439 | raviqqe/tisp,tisp-lang/tisp,tisp-lang/tisp,raviqqe/tisp,raviqqe/tisp | src/lib/vm/dictionary.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\"github.com/zetamatta/nyagos/dos\"\n)\n\nfunc main() {\n\tindent := 1\n\tvar callback func(*dos.NetResource) bool\n\n\tcallback = func(node *dos.NetResource) bool {\n\t\tfmt.Printf(\"%*s%s\\n\", indent*2,... | go | edit | 0 | 3 | bsd-3-clause | 7b1e8908a28c702fbcac8531b98fcbd5c956e5bc | nocd5/nyagos,tsuyoshicho/nyagos,zetamatta/nyagos | dos/netest/main.go | accepted | null | 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\nfu... | go | edit | 3 | 4 | mit | de3df45c55a6f7ff4dd620310a3a3afd45b90604 | kusabashira/msub | subvert_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage repo\n\ntype SettingsData struct {\n\tPaymentDataInQR *bool `json:\"paymentDataInQR\"`\n\tShowNotifications *bool `json:\"showNotificatons\"`\n\tShowNsfw *bool `json:\"showNsfw\"`\n\t... | go | edit | 0 | 0 | mit | 8915665d9ce20efa9952a9d585b808452d7c6979 | hoffmabc/openbazaar-go,jackkleeman/openbazaar-go,cpacia/openbazaar-go,duomarket/openbazaar-test-nodes,cpacia/openbazaar-go,duomarket/openbazaar-test-nodes,gubatron/openbazaar-go,jackkleeman/openbazaar-go,gubatron/openbazaar-go,duomarket/openbazaar-test-nodes,yurizhykin/openbazaar-go,JustinDrake/openbazaar-go,OpenBazaar... | repo/settings.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rmq\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar (\n\tErrorNotFound = errors.New(\"entity not found\") // entitify being connection/queue/delivery\n\tErrorAlreadyConsuming = errors.New(\"must not call StartConsuming() multiple... | go | edit | 3 | 1 | mit | 6a233b9dafc81205ba22a851ab1c2d62aba9dcba | adjust/rmq | errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage v1\n\nimport (\n\t\"github.com/codegangsta/martini\"\n\t\"github.com/coopernurse/gorp\"\n\t\"github.com/hackedu/backend/v1/model\"\n\t\"github.com/hackedu/backend/v1/route\"\n\t\"github.com/martini-contrib/binding\"\n)\n\nfunc Setup(m *... | go | edit | 3 | 1 | mit | 8fb49dc9153c4593b739a5950ae2bc8cbddc758f | hackedu/website,hackedu/website,hackedu/website,zachlatta/website,zachlatta/website,zachlatta/website | v1/v1.go | rejected_duplicate | Near-duplicate of sample 116727 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"time\"\n)\n\n// Deployment describes a deployment\ntype Deployment struct {\n\tID string `json:\"id\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tImageName string `json:\"image_name\"`\n\tVersion ... | go | edit | 0 | 0 | apache-2.0 | c86fd3d5bd376918ba05760a19858b8692ca8d34 | paulbellamy/scope,alban/scope,weaveworks/scope,paulbellamy/scope,weaveworks/scope,paulbellamy/scope,weaveworks/scope,kinvolk/scope,kinvolk/scope,weaveworks/scope,kinvolk/scope,paulbellamy/scope,alban/scope,alban/scope,alban/scope,alban/scope,weaveworks/scope,kinvolk/scope,alban/scope,kinvolk/scope,kinvolk/scope,paulbel... | cmd/wcloud/types.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\nfunc check_main(args []string) {\n\tallCarr, err := allCarriersWithErrors()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to open library: %s\", err)\n\t}\n\n\texitStatus := 0\n\n\tfor _, pc := ... | go | edit | 6 | 7 | bsd-3-clause | cf90ef6151aa2883a9f5ae7b6f414f322f9baacf | thijzert/speeldoos | cmd/speeldoos/cmd-check.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\"github.com/itsankoff/gotcha/client\"\n)\n\nfunc main() {\n\tc := client.New()\n\tc.Connect(\"wss://127.0.0.1:9999\")\n}\n\n```\n\nApply this change: Add simple show case of client usage"
},
{
"role": "assis... | go | edit | 0 | 1 | mit | ad6e64e4a69ff4516851354792befa874692f3c6 | itsankoff/gotcha,itsankoff/gotcha | cmd/client/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\t\"strings\"\n)\n\n// Returns the client's IP address.\nfunc echoRemoteAddr(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"text/plain; charset=UTF-8\")\n\tw.... | go | edit | 0 | 1 | apache-2.0 | 7e9605c807b950af279c2bc05dc6ab81750f5083 | dolph/go-skeleton,dolph/go-skeleton | handlers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gocql\n\nimport (\n\t\"testing\"\n)\n\nfunc TestErrorsParse(t *testing.T) {\n\tsession := createSession(t)\n\tdefer session.Close()\n\n\tif err := session.Query(`CREATE TABLE errors_parse (id int primary key)`).Exec(); err != nil {\n\t\... | go | edit | 9 | 5 | bsd-3-clause | 0a1aa59798140d55345c4c4484cc1962d418da62 | gus/gocql,vrischmann/gocql,maticz/gocql,brandscreen/gocql,revinate/gocql,tux21b/gocql,hackintoshrao/gocql,relops/gocql,mailgun/gocql,ChannelMeter/gocql,retailnext/gocql,nikandfor/gocql,retailnext/gocql,CrowdSurge/gocql,gus/gocql,matope/gocql,adamweiner/gocql,Zariel/gocql,gocql/gocql,tux21b/gocql,znly/gocql,Zariel/gocql... | errors_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2013 Kelsey Hightower. All rights reserved.\n// Use of this source code is governed by the Apache License, Version 2.0\n// that can be found in the LICENSE file.\npackage config\n\nimport (\n\t\"fmt\"\n)\n\n// Nodes is a custom... | go | edit | 0 | 1 | mit | 91f4cbc6e40d53b349eb58161771e8edbc23c2a1 | Fitbit/confd,gautamk/confd,okushchenko/confd,kgrvamsi/confd,bacongobbler/confd,blippar/confd,mboersma/confd,Fitbit/confd,shencan/confd,nevermosby/confd,beni55/confd,RichardKnop/confd,layerhq/confd,axingblog/confd,jnummelin/confd,agilemobiledev/confd,axingblog/confd,zytek/confd,openedbox/confd,Flipkart/confd,jnummelin/c... | config/node_var.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gogist\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/gorilla/mux\"\n)\n\nconst t = `\n<html>\n <head>\n <meta name=\"go-import\" content=\"%s git https://gist.github.com/%s.git\" />\n <script>window.location='https://g... | go | edit | 0 | 1 | apache-2.0 | 60ef124bfbda07b61f52431decdba3289141aee6 | ImJasonH/go-gist | app.go | rejected_duplicate | Near-duplicate of sample 117071 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage registry\n\nimport (\n\t\"log\"\n\n\t\"github.com/arigatomachine/cli/daemon/envelope\"\n)\n\n// KeyringMemberClient represents the `/keyring-members` registry end point for\n// accessand creating memberships related to a set of Keyrings... | go | edit | 3 | 3 | bsd-3-clause | 31d32580b8bfe64e639b08693d74532e775b3858 | manifoldco/torus-cli,manifoldco/torus-cli,luizbranco/torus-cli,luizbranco/torus-cli,manifoldco/torus-cli,luizbranco/torus-cli | daemon/registry/keyring_member.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage terraform\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\n\t\"github.com/docker/machine/libmachine/log\"\n)\n\n// Scan STDOUT and STDERR pipes for a process.\n//\n// Calls the supplied PipeHandler once for each line encountered.\nfunc scanProcess... | go | edit | 6 | 3 | mit | 8c31ec3b8c7fc0083fdbea1262404e930b048f2f | tintoy/docker-machine-driver-terraform,tintoy/docker-machine-driver-terraform | terraform/utils.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage icmd\n\n// CmdOp is an operation which modified a Cmd structure used to execute commands\ntype CmdOp func(*Cmd)\n\n```\n\nApply this change: Add some CmdOps to make `RunCmd` more useful\n\nadding WithTimeout, WithEnv, Dir and WithStdin ... | go | edit | 9 | 1 | apache-2.0 | 6476d9a733cb89edb380a47f17f94eb5fc50500d | gotestyourself/gotestyourself,gotestyourself/gotestyourself | icmd/ops.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage h2spec\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc Http2ConnectionPrefaceTestGroup(ctx *Context) *TestGroup {\n\ttg := NewTestGroup(\"3.5\", \"HTTP/2 Connection Preface\")\n\n\ttg.AddTestCase(NewTes... | go | edit | 33 | 8 | mit | 3d78e31d70e89f16af82e0a0b82f802bbcb59f9a | shane-kearns/h2spec,summerwind/h2spec,rmoorman/h2spec | 3_5.go | rejected_lint | Too many lint violations: 33 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage autosignr\n\nimport (\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"gopkg.in/fsnotify.v1\"\n)\n\nfunc WatchDir(conf Config) {\n\twatcher, err := fsnotify.NewWatcher()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer watcher.Close()\n\n... | go | edit | 15 | 6 | mit | 336e0bd51e788c14868d695e029a703a70b39c5d | jasonhancock/autosignr | watcher.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage google\n\n// Asset is the CAI representation of a resource.\ntype Asset struct {\n\t// The name, in a peculiar format: `\\\\<api>.googleapis.com/<self_link>`\n\tName string\n\t// The type name in `google.<api>.<resourcename>` format.\n\... | go | edit | 0 | 0 | apache-2.0 | b2e4eb0673de9fab36c5e9e472e1079878426d1f | GoogleCloudPlatform/terraform-google-conversion | google/cai.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\n\t\"github.com/sachaos/todoist/lib\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestEval(t *testing.T) {\n\tr, _ := Eval(Filter(\"p1\"), todoist.Item{Priority: 1})\n\tassert.Equal(t, r, true,... | go | edit | 9 | 1 | mit | f6cf282fdcf0af6609047fa373938c3350866c7e | sachaos/todoist,sachaos/todoist | filter_eval_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\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc main() {\n\tSetTmuxStatusColor(\"yellow\")\n\targs := os.Args[1:]\n\n\tif len(args) == 0 {\n\t\tlog.Fatalln(\"Not enough arguments\")\n\t}\n\n\tcmd := ... | go | edit | 21 | 3 | mit | 6b484f8ba0ae4d4bb63492bdd11e712136cdb667 | andy4thehuynh/traffic | main.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handlers\n\nimport (\n\t\"testing\"\n\n\t\"github.com/rancherio/go-rancher/client\"\n)\n\nfunc TestBuildContainerConfig(t *testing.T) {\n\tmachine := new(client.Machine)\n\n\tmachine.ExternalId = \"externalId\"\n\tlabels := make(map[str... | go | edit | 3 | 4 | apache-2.0 | aa803766174db2067a263b3354f7e748de0b0037 | rancher/go-machine-service,cloudnautique/go-machine-service,ibuildthecloud/go-machine-service,rancher/go-machine-service,cloudnautique/go-machine-service,rancherio/go-machine-service,rancherio/go-machine-service,ibuildthecloud/go-machine-service | handlers/bootstrap_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage analyze\n\ntype ValidMicro struct {\n\tMicro int64\n\tValid bool\n}\n\ntype ValidFloat struct {\n\tValue float64\n\tValid bool\n}\n\n```\n\nApply this change: feat: Add custom json marshalling for indicators"
},
{
"role": "assis... | go | edit | 0 | 2 | mit | 798ab6b05fa3df3c1786d582e876f3e3af837d2e | t73liu/crypto-trading,t73liu/crypto-trading | lib/technical-analysis/types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage httpie\n\nimport (\n \"testing\"\n \"strings\"\n \"bufio\"\n \"bytes\"\n)\n\nvar delimData = []string{\n \"Hello\",\n \"World\",\n \"This\",\n \"Is\",\n \"A\",\n \"Test\",\n};\n\nfunc TestDelim(t *testing.T... | go | edit | 3 | 4 | mit | 09ac39ffd21dabbd44f2d09c62c3142e755552b5 | brettbuddin/httpie | consumer_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage emu\n\nconst (\n\tmemorySize = 4096\n\tvramSize = 64 * 32\n\tregistersNumber = 16\n\tstackSize = 16\n)\n\n// Chip8 is the main struct holding all data relevant to the emulator.\n// This includes registers (V0 to VF, PC... | go | edit | 0 | 1 | mit | 21ab86365bed31ec75adaac42743fe1d304531ed | valep27/GChip8 | emu/core.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"log\"\n\n\t\"github.com/bradylove/envstruct\"\n)\n\ntype Config struct {\n\tAddr string `env:\"ADDR,required\"`\n\tIntraAddr string `env:\"INTRA_ADDR,required\"`\n\tTalariaNodeAddr ... | go | edit | 0 | 4 | mit | 1b7216d434faa82ab084c6d07dbb10926009c457 | apoydence/loggrebutterfly,apoydence/loggrebutterfly | analyst/internal/config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage raftor\n\n// ClusterChangeNotifier notifies the receiver of the cluster change.\ntype ClusterChangeNotifier interface {\n\n\t// NotifyChange sends ClusterChangeEvents over the given channel when a node joins, leaves or is updated in the... | go | edit | 3 | 0 | apache-2.0 | 8fb93d67c13265437003a8794ad4c54c0d93f284 | eliquious/raftor,blacklabeldata/raftor | notifier.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage check_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/gexec\"\n\n\t\"testing\"\n)\n\nvar fakeBin string\n\nfunc TestCheck(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tRunSp... | go | edit | 15 | 1 | apache-2.0 | 71e9d0daac52cd46f365a17c2f51df71ec30733c | st3v/waitfor | check/check_suite_test.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nlgids\n\nimport (\n\t\"testing\"\n\n\t\"github.com/miekg/nlgids/email\"\n\t\"github.com/miekg/nlgids/webcontact\"\n)\n\nfunc newContact() *webcontact.Contact {\n\treturn &webcontact.Contact{\n\t\tName: \"Miek Gieben\",\n\t\tEmail: ... | go | edit | 0 | 6 | bsd-3-clause | 0d4b18cea86547c4bc45751487ac921582c19efe | miekg/nlgids | webcontact_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rates\n\nimport \"testing\"\n\nfunc TestFetch(t *testing.T) {\n\tc, _ := Country(\"NL\")\n\n\tif r, _ := c.Rate(\"standard\"); r != 21 {\n\t\tt.Errorf(\"Standard VAT rate for NL is supposed to be 21. Got %.2f\", r)\n\t}\n\n\tif r, _ := ... | go | edit | 9 | 4 | mit | 798a94ae3e36ec9f2f67a3c6b06777efb1ca6743 | dannyvankooten/govat | rates/rates_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage piece\n\nimport (\n\t\"chessboard\"\n\t\"point\"\n)\n\ntype Piece struct {\n\tmovable []point.Point\n\twhite byte\n\tblack byte\n}\n\nfunc NewPiece(movable []point.Point, white, black byte) *Piece {\n\tpiece := new(Piece)\n\tpiece.m... | go | edit | 0 | 6 | mit | 4adfea6ae976730c6b4e35c9dd606dfd37ce5f03 | Roadagain/Chess | src/piece/piece.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// The dawa package can be used to de-serialize structures received from \"Danmarks Adressers Web API (DAWA)\" (Addresses of Denmark Web API).\n//\n// This package allows to de-serialize JSON responses from the web api into typed structs.\n// T... | go | edit | 0 | 0 | mit | a42fa7207b8e82ea80d9d36bf8ce5de3a4f5f776 | klauspost/dawa | dawa.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"net/http\"\n \"github.com/moovweb/gokogiri\"\n)\n\nfunc processRequest(r *http.Request, doc *XmlDocument) {\n r.parseForm()\n username := r.Form.Get(\"username\")\n password := r.Form.Get(\"password\")\n \n r... | go | edit | 0 | 1 | mit | 948b79df876ba58858656feb9fd5426236190816 | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql-go,github/codeql,github/codeql-go,github/codeql,github/codeql-go,github/codeql,github/codeql,github/codeql,github/codeql-go,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | ql/src/experimental/Security/CWE-643/XPathInjection.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\n\t\"fmt\"\n\t\"github.com/s3git/s3git-go\"\n\t\"github.com/spf13/cobra\"\n)\n\nvar message string\n\n// commitCmd represents the commit command\nvar commitCmd = &cobra.Command{\n\tUse: \"commit\",\n\tShort: \"Commit... | go | edit | 12 | 4 | apache-2.0 | 66652fc8e443ad0d81ae50a844ce3c799be2ef0c | s3git/s3git | cmd/commit.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage mysqldriver is a driver for MySQL database\n\nConcurrency\n\nDB struct manages pool of connections to MySQL. Connection itself\nisn't thread-safe, so it should be obtained per every go-routine.\nIt's important to return a connection... | go | edit | 0 | 0 | mit | 5add9e9b7e2ce675fa7f0160ce7d6a7693d43854 | pubnative/mysqldriver-go | doc.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/holizz/greyhound\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc main() {\n\tport := flag.Int(\"p\", 3000, \"port number to listen on\")\n\tdir := flag.String(\"d\", \".\", \"d... | go | edit | 0 | 2 | mit | 11c02cddac9251c254c2671e9698f64ca5ca081e | holizz/greyhound,holizz/greyhound | greyhound/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage taskmq\n\ntype TaskMQ struct {\n\tconfig *Config\n\tbroker IBroker\n}\n\nfunc New(broker IBroker, config *Config) *TaskMQ {\n\treturn &TaskMQ{config: config}\n}\n\nfunc (r *TaskMQ) Connect() error {\n\n\treturn r.broker.Connect()\n}\n\n... | go | edit | 15 | 2 | bsd-3-clause | 71aeb6ce8986b30cf79eb0b2cae58fd0ff8a2478 | task-queue/go-taskmq | taskmq.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\"bytes\"\n\t\"container/list\"\n\t\"encoding/json\"\n\t\"log\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"time\"\n)\n\n// Stat represents stats to send to graphite\ntype Stat struct {\n\tKey string `json:\"key\"`\n\tValue... | go | edit | 6 | 2 | mit | 33aed2c0e0e630d2d2b50cddcb9abfb0fe2df14e | halkeye/go_windows_stats | main.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage store_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t\"github.com/onsi/ginkgo/config\"\n\t. \"github.com/onsi/gomega\"\n\n\t\"github.com/cloudfoundry/storeadapter/storerunner/etcdstorerunner\"\n\t\"os\"\n\t\"os/signal\"\n\n\t\"test... | go | edit | 21 | 2 | apache-2.0 | 07579f7f9fe29c1cc08fbe2616a063b44bc6fa72 | cloudfoundry/hm9000 | store/store_suite_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage reuseport\n\nimport (\n\t\"syscall\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\nfunc Control(network, address string, c syscall.RawConn) error {\n\tvar err error\n\tc.Control(func(fd uintptr) {\n\t\terr = syscall.Setsock... | go | edit | 0 | 3 | isc | 622f62c62b102a7e2a71688d9163b90fcd55326c | libp2p/go-reuseport,jbenet/go-reuseport | control_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cryptopals\n\nimport (\n\t\"crypto/rand\"\n\t\"crypto/rsa\"\n\t\"testing\"\n)\n\nfunc TestDecryptRsaPaddingOracleSimple(t *testing.T) {\n\tc := challenge47{}\n\n\tpriv, _ := rsa.GenerateKey(rand.Reader, 1024)\n\tpub := priv.PublicKey\n\... | go | edit | 3 | 3 | mit | f1ae5f6220fe612a75a465f5519c713d90feda88 | Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go | challenge47_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage graphs\n\nimport (\n\t\"testing\"\n)\n\nfunc TestDijkstra(t *testing.T) {\n\tgraph := NewGraph()\n\n\tgraph.AddEdge(\"a\", \"b\", 1)\n\tgraph.AddEdge(\"a\", \"c\", 3)\n\tgraph.AddEdge(\"b\", \"g\", 5)\n\tgraph.AddEdge(\"c\", \"g\", 8)\n... | go | edit | 9 | 4 | mit | 2560bc5fa69e4dcbd8241f7e60a49dbc314a0cf1 | thcyron/graphs,jacobxk/graphs | dijkstra_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage algoholic\n\nfunc LinearSearch(ns []int, n int) int {\n\tfor i, m := range ns {\n\t\tif m == n {\n\t\t\treturn i\n\t\t}\n\t}\n\n\treturn -1\n}\n\n```\n\nApply this change: Add commentary to linear search."
},
{
"role": "assistan... | go | edit | 0 | 3 | mit | ef9b86dd9dd00b1ff3de304f3260e868b0a888e9 | lorenzo-stoakes/algoholic | search/lsearch.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\"io/ioutil\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar content []byte\n\tvar err error\n\tif len(os.Args) == 1 {\n\t\tcontent, err = ioutil.ReadAll(os.Stdin)\n\t} else {\n\t\tconte... | go | edit | 3 | 6 | mit | 83bc89466f52b370b47f92e896dd56040b683ebf | MrGosti/gopl | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Write go code for the following: Update with newlines, as they are equal to ; in char count."
},
{
"role": "assistant",
"content": "package main\nfunc main(){print(p,string(96),p,string(96))}\nvar p string=`package main\nfunc main(){print(p,string(96),p,string(96))}... | go | new_file | 3 | 1 | unlicense | 3eedefb57fe9d71efec7c24be8b5e9dff8eb8f61 | adamryman/go-quine | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage freetype\n\nimport (\n\t\"code.google.com/p/freetype-go/freetype\"\n\t\"image\"\n)\n\nvar img = image.NewNRGBA64(image.Rectangle{image.Point{0, 0}, image.Point{59, 39}})\n\nfunc Fuzz(data []byte) int {\n\tf, err := freetype.ParseFont(da... | go | edit | 0 | 4 | apache-2.0 | 729cec51a106f17529d6e848a3d98c2f0bebd7fd | dvyukov/go-fuzz-corpus,dvyukov/go-fuzz-corpus | freetype/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage summa\n\nimport (\n\t\"database/sql\"\n\t_ \"go-sqlite3\"\n\t\"strings\"\n)\n\nfunc apiProfile(db *sql.DB, req apiRequest, resp apiResponseData) apiError {\n\tu, err := userFetch(db, req.Username)\n\tif err != nil {\n\t\treturn &interna... | go | edit | 27 | 4 | mit | c55229389f9aeee220b5e731e2b0cf8e132625c2 | jbrimeyer/Summa,jbrimeyer/Summa | go/src/summa/api_profile.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage monitoring\n\nfunc GetDefaultThresholdValues() (plugins []Plugin) {\n\treturn []Plugin{\n\t\t{\n\t\t\tName: \"df\",\n\t\t\tEnable: true,\n\t\t\tConfigs: []PluginConfig{\n\t\t\t\t{Category: THRESHOLD, Type: CRITICAL, Value: \"90\"},\n\... | go | edit | 24 | 1 | apache-2.0 | b10939c3654645ec298bb6e2912f8f862307bb9c | skyrings/skyring-common,skyrings/skyring-common | monitoring/default_configs.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lib\n\nimport (\n\t\"context\"\n\t\"time\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/gravitational/trace\"\n)\n\nfunc OneOf(value string, values []string) bool {\n\tfor _, v := range values {\n\t\tif v == value {\n\t\t\tre... | go | edit | 3 | 5 | apache-2.0 | 23c6b0c8b61e4b502e14e090c52107a0987e85bd | gravitational/monitoring-app,gravitational/monitoring-app | watcher/lib/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main_test\n\nimport (\n\t\"code.cloudfoundry.org/bbs/cmd/bbs/testrunner\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/tedsuo/ifrit\"\n)\n\nvar _ = Describe(\"BBS main test\", func() {\n\tJustBeforeEac... | go | edit | 48 | 1 | apache-2.0 | 0fc397ada9bc194d12428ea607c53c9cf1925ed6 | cloudfoundry-incubator/bbs,cloudfoundry-incubator/bbs | cmd/bbs/main_test.go | rejected_lint | Too many lint violations: 48 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nvar defaultTemplate = `\n[vars]\n ignoreDirs = [\".git\", \"Godeps\", \"vendor\"]\n stopLoadingParent = [\".git\"]\n buildFlags = [\".\"]\n artifactsEnv = \"CIRCLE_ARTIFACTS\"\n testReportEnv = \"CIRCLE_TEST_REPORTS\"\n\n[g... | go | edit | 0 | 0 | apache-2.0 | 87e9ff5f6556ad8f3bf06d4053c8e5832364b3be | cep21/gobuild,cep21/gobuild | default_template.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"github.com/dynport/urknall\"\n\ntype Docker struct {\n\tVersion string `urknall:\"required=true\"` // e.g. 1.1.0\n\tCustomInstallDir string\n\tPublic bool\n}\n\nfunc (docker *Docker) Render(pkg urknal... | go | edit | 12 | 3 | apache-2.0 | f2158018f43b9902f307bfe13b06fc8a27be1639 | rajthilakmca/urknall,megamsys/urknall,dynport/urknall | examples/tpl_docker.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// khan\n// https://github.com/topfreegames/khan\n//\n// Licensed under the MIT license:\n// http://www.opensource.org/licenses/mit-license\n// Copyright © 2016 Top Free Games <<EMAIL>>\n\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"... | go | edit | 0 | 0 | mit | 3b945ae65a30a7ad0cb193b8b34489fdda0a2fe6 | topfreegames/khan,topfreegames/khan,topfreegames/khan | cmd/version_test.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\"os\"\n)\n\nfunc main() {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tfmt.Fprint(os.Stderr, r)\n\t\t}\n\t}()\n\n\tvar chewing bool\n\n\tvar ctx BenchmarkContext\n\tdefer func()... | go | edit | 0 | 5 | mit | 8da107a5245b263d3cd48fc0ff814ee8e1e89761 | zhtw/bopomofo-benchmark,zhtw/bopomofo-benchmark | Main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport (\n\t\"testing\"\n)\n\nfunc TestNewTaskModel(t *testing.T) {\n}\n\n```\n\nApply this change: Add test of save and find task"
},
{
"role": "assistant",
"content": "package models\n\nimport (\n\t\"testing\"\n)... | go | edit | 0 | 1 | mit | a44d02678933f7e538a6b123444bcd723cbab7d1 | alice02/go-todoapi,alice02/go-todoapi,alice02/go-todoapi | models/test_task.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nfunc init() {\n\tinitSpec();\n\n\tspec.Describe(\"Math\", func() {\n\t\tspec.It(\"adds\", func() {\n\t\t\tspec.That(1 + 1).Should.Be(2);\n\t\t});\n\n\t\tspec.It(\"multiplies\", func() {\n\t\t\tspec.That(3 * 3).Should.Be(9);\n\t\... | go | edit | 12 | 1 | mit | a278e6f0b814a2321151e65b737f9013041d7033 | stesla/gospecify,stesla/gospecify | src/example_spec.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\npackage lumberjack_test\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/signal\"\n\t\"syscall\"\n\n\t\"github.com/natefinch/lumberjack.v2\"\n)\n\n// Example of how to rotate in response to SIGHUP.\nfunc ExampleLogger_Rotate() {\n\tl... | go | edit | 3 | 2 | mit | 5bae0dc0e2e7121b67aa8b91311d4c82b30bb2eb | natefinch/lumberjack | rotate_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage omxplayer\n\nimport (\n\t\"fmt\"\n)\n\n// dbusCall calls a D-Bus method that has no return value.\nfunc dbusCall(path string) error {\n\treturn fmt.Errorf(\"omxplayer: %s not implemented yet\", path)\n}\n\n// dbusGetBool calls a D-Bus m... | go | edit | 0 | 1 | mit | cbec6b0f74c6ce48926c4beee7e8424d79ddf028 | jleight/omxplayer | player_helpers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage containerd\n\nconst (\n\tdefaultRoot = \"/var/lib/containerd-test\"\n\tdefaultAddress = \"/run/containerd-test/containerd.sock\"\n\ttestImage = \"docker.io/library/alpine:latest\"\n)\n\nfunc platformTestSet... | go | edit | 3 | 6 | apache-2.0 | 661bcd3e4d95e6d55f42b3bedbc18c6f8b8e5793 | estesp/containerd,containerd/containerd,kunalkushwaha/containerd,AkihiroSuda/containerd,estesp/containerd,vdemeester/containerd,miaoyq/containerd,dmcgowan/containerd,vdemeester/containerd,thaJeztah/containerd,mikebrow/containerd,kunalkushwaha/containerd,thaJeztah/containerd,dmcgowan/containerd,mikebrow/containerd,crosb... | client_unix_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage generator\n\nimport (\n\t\"sort\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc ToPublicName(name string) string {\n\tif name == \"\" {\n\t\treturn \"\"\n\t}\n\treturn strings.ToUpper(name[0:1]) + name[1:]\n}\n\nfunc concatSortedMap(m map[st... | go | edit | 0 | 7 | mit | d298c01f3b6449144502041b54651bc7ab6e43dc | alanctgardner/gogen-avro,alanctgardner/gogen-avro | generator/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lsproduct\n\nfunc LargestSeriesProduct(digits string, span int) (int64, error) {\n\tpanic(\"Please implement the LargestSeriesProduct function\")\n}\n\n```\n\nApply this change: Solve first few test cases"
},
{
"role": "assistan... | go | edit | 0 | 3 | mit | e0cc29b12d2e17a838899b3a74caab48109c772f | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/largest-series-product/largest_series_product.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fetch\n\nimport (\n\t\"testing\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestFetchPublicKeys(t *testing.T) {\n\tlog.SetLevel(log.DebugLevel)\n\n\tkeys, err := GitHubKeys(\"devopsfin... | go | edit | 3 | 1 | apache-2.0 | e2a811a0566a0bbaf4a1fdc5e1d59fae2a1b746e | ernoaapa/fetch-ssh-keys,arnested/fetch-ssh-keys | fetch/github_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage onedrive\n\ntype OnedriveId struct {\n\tId string `json:\"id\"`\n}\n\ntype OnedriveAuth struct {\n\tToken_type string `json:\"token_type\"`\n\tExpires_in string `json:\"expires_in\"`\n\tScope string `json:\"scope\"`\n\tAcc... | go | edit | 0 | 0 | mit | df27a95446fb4d7d40871d70648e44265b38a4d8 | ayoisaiah/stellar-photos,ayoisaiah/stellar-photos,ayoisaiah/stellar-photos,ayoisaiah/stellar-photos,ayoisaiah/stellar-photos | onedrive/types.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.