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 vips\n\n/*\n#cgo pkg-config: vips\n#include <stdlib.h>\n#include <vips/vips.h>\n#include <vips/vips7compat.h>\n*/\nimport \"C\"\n\nimport (\n\t\"errors\"\n)\n\n// btoi converts from Go boolean to int with value 0 or 1.\nfunc btoi(b bool... | go | edit | 2 | 3 | apache-2.0 | d993961621605886d0bf8f79e5a31a7221171c16 | die-net/fotomat,kitwalker12/fotomat,kitwalker12/fotomat,kitwalker12/fotomat,die-net/fotomat,kitwalker12/fotomat,die-net/fotomat | vips/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage librarian\n\nimport (\n\t\"github.com/mlafeldt/chef-runner/exec\"\n\t\"github.com/mlafeldt/chef-runner/util\"\n)\n\nfunc Command(path string) []string {\n\tvar cmd []string\n\tif util.FileExist(\"Gemfile\") {\n\t\tcmd = []string{\"bundl... | go | edit | 0 | 4 | apache-2.0 | 10f32b9d14d3431ca6ee9fa7564dd04c724711e1 | mlafeldt/chef-runner,rajthilakmca/chef-runner,mlafeldt/chef-runner,mlafeldt/chef-runner,rajthilakmca/chef-runner,rajthilakmca/chef-runner | librarian/librarian.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage command\n\nimport (\n\t\"github.com/akaspin/bar/client/git\"\n\t\"github.com/akaspin/bar/client/model\"\n\t\"github.com/akaspin/bar/client/transport\"\n\t\"github.com/spf13/cobra\"\n\t\"github.com/tamtam-im/logx\"\n)\n\ntype GitInstallC... | go | edit | 0 | 3 | mit | f0e7b4ade2cf9a2304e5b92258b68c9f3e15fc3d | akaspin/bar | command/git-install.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logrus\n\nimport (\n\t\"bufio\"\n\t\"io\"\n\t\"runtime\"\n)\n\nfunc (logger *Logger) Writer() *io.PipeWriter {\n\treader, writer := io.Pipe()\n\n\tgo logger.writerScanner(reader)\n\truntime.SetFinalizer(writer, writerFinalizer)\n\n\tret... | go | edit | 27 | 7 | mit | 1d1fd2d9ce6cca62f9904035ab7cfa56b76c08ef | penhauer-xiao/logrus,devopstaku/logrus,Sirupsen/logrus,sirupsen/logrus,penhauer-xiao/logrus,sirupsen/logrus,yxd-hde/logrus,akutz/logrus,axiomzen/logrus,freeformz/logrus | writer.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"unicode/utf8\"\n)\n\nfunc main() {\n\ttext := \"abcdefg\"\n\tfmt.Println(reverseString1(text))\n\tfmt.Println(reverseString2(text))\n}\n\nfunc reverseString1(s string) string {\n\treversed := make([]rune... | go | edit | 0 | 2 | mit | faa1dcc57f2ddf970dcedf5b67ccf6ca19c17b92 | oshothebig/golang-cookbook | chap-1/7-1.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/imagepublishers/amipublisher\"\n\t\"github.com/Symantec/Dominator/lib/awsutil\"\n\t\"github.com/Symantec/Dominator/lib/log\"\n\t\"os\"\n\t\"path\"\n)\n\nfunc launchInstances... | go | edit | 18 | 4 | apache-2.0 | 45b4ab6baeaf74bb0004d99090955841135e4ff4 | rgooch/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator | cmd/ami-publisher/launchInstances.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"dbr\"\n)\n```\n\nApply this change: Fix k/v cascade. Make interfaces so that other libraries can loosely depend on health without an explicit dependency."
},
{
"role": "assistant",
"content":... | go | edit | 0 | 1 | mit | b99f21ab009fcc03f072921a11daf77e38a20be8 | orian/dbr,demdxx/dbr,playerbase/dbr,iyee/dbr,mailru/dbr,joe-roth/dbr,mibk/ql,postfix/dbr,kevpie/dbr,antony360/dbr,gocraft/dbr | dbr.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright © 2015 The Things Network\n// Use of this source code is governed by the MIT license that can be found in the LICENSE file.\n\npackage handler\n\nimport (\n\t\"testing\"\n\n\t// . \"github.com/TheThingsNetwork/ttn/utils/testing\"\n... | go | edit | 0 | 0 | mit | f2495c45cd095ec69836bd6a4ca2841588050b75 | jvanmalder/ttn,LoRaWanSoFa/ttn,TheThingsNetwork/ttn,mgranberry/ttn,jvanmalder/ttn,TheThingsNetwork/ttn,mgranberry/ttn,TheThingsNetwork/ttn,mgranberry/ttn,jvanmalder/ttn,LoRaWanSoFa/ttn | core/components/handler/handler_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage webhook_test\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/stripe/stripe-go/webhook\"\n)\n\nfunc Example() {\n\thttp.HandleFunc(\"/webhook\", func(w http.ResponseWriter, req *http.Request) {\n\n\t\... | go | edit | 0 | 3 | mit | 67eacb8ddaca0e9b04f5d11d83fcdfeed08825c7 | stripe/stripe-go,ChannelMeter/stripe-go,ChannelMeter/stripe-go,stripe/stripe-go | webhook/client_handler_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"bytes\"\n \"encoding/json\"\n \"errors\"\n \"fmt\"\n \"io/ioutil\"\n \"log\"\n \"os\"\n \"path/filepath\"\n \"strings\"\n)\n\ntype Commands map[string]string\n\nfunc getCommands() (Commands, error) {\n var... | go | edit | 0 | 3 | mit | 75f140ca8122baddb45049f79a9b79887b103be8 | nicolasmccurdy/run | run.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bigbase\n\nimport (\n\t\"testing\"\n)\n\nfunc TestBigMandelbrotSanity(t *testing.T) {\n\torigin := BigComplex{MakeBigFloat(0.0, testPrec), MakeBigFloat(0.0, testPrec)}\n\tnon := BigComplex{MakeBigFloat(2.0, testPrec), MakeBigFloat(4, te... | go | edit | 21 | 4 | mit | b30751191d32097552e73d56402dd0506b5e61be | johnny-morrice/godelbrot | bigbase/bigmandelbrot_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nodetemplate\n\nimport (\n\t\"github.com/rancher/norman/types\"\n\t\"github.com/rancher/types/apis/management.cattle.io/v3\"\n\t\"github.com/sirupsen/logrus\"\n\t\"k8s.io/apimachinery/pkg/labels\"\n)\n\ntype Formatter struct {\n\tNodePo... | go | edit | 0 | 5 | apache-2.0 | 06c1eb1e90e7a790543d9b4f4e026135c4695617 | rancher/rancher,rancher/rancher,rancher/rancher,cjellick/rancher,rancherio/rancher,cjellick/rancher,rancher/rancher,rancherio/rancher,cjellick/rancher | pkg/api/customization/nodetemplate/formatter.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bindmount\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"syscall\"\n\n\t\"golang.org/x/sys/unix\"\n)\n\ntype Mounter struct{}\n\nfunc (m *Mounter) IdempotentlyMount(source, target string) error {\n\terr := os.MkdirAll(filepa... | go | edit | 0 | 4 | apache-2.0 | fc52fbf40e4a93a95b61d9f9a3310277c88ba469 | cloudfoundry-incubator/cf-networking-release,cloudfoundry-incubator/cf-networking-release,cloudfoundry-incubator/cf-networking-release,cloudfoundry-incubator/cf-networking-release | src/garden-external-networker/bindmount/mounter_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage service\n\nimport (\n\t\"github.com/coreos/go-etcd/etcd\"\n\t\"log\"\n\t\"os\"\n)\n\nvar (\n\tlogger *log.Logger\n\tclient *etcd.Client\n\thostname string\n)\n\nfunc init() {\n\thost := \"http://localhost:4001\"\n\tif len(os.Getenv(... | go | edit | 0 | 7 | apache-2.0 | 44de547317ecb78e4176631c7726f14082db7c48 | Scalingo/etcd-discovery | service/init.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage view\n\nimport (\n\t\"bytes\"\n\t\"crypto/sha1\"\n\t\"fmt\"\n\t\"log\"\n\t\"sort\"\n)\n\ntype ViewRef struct {\n\tDigest [sha1.Size]byte\n}\n\nfunc ViewToViewRef(v *View) ViewRef {\n\tvar updates byUpdate\n\tupdates = v.GetUpdates()\n\n... | go | edit | 6 | 2 | mit | e3c7cc28a2a7789a088c7d1521718f6beeb6c1ee | mateusbraga/freestore,mateusbraga/freestore,mateusbraga/freestore,mateusbraga/freestore | pkg/view/ref.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2017 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.... | go | edit | 0 | 1 | apache-2.0 | ea8f7ea8b760f9a7e7c8f2f0212e234d77da3a64 | canhnt/ingress,aledbf/ingress-nginx,aledbf/ingress-nginx,kubernetes/ingress-nginx,caicloud/ingress,kubernetes/ingress-nginx,caicloud/ingress,kubernetes/ingress-nginx,kubernetes/ingress-nginx,canhnt/ingress,aledbf/ingress-nginx,aledbf/ingress-nginx,canhnt/ingress,caicloud/ingress,canhnt/ingress,kubernetes/ingress-nginx,... | internal/ingress/controller/template/buffer_pool.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage \"dense\" provides an implementation of \"Matrix\" which stores elements in a slide.\n*/\npackage dense\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/mitsuse/matrix-go\"\n)\n\ntype matrixImpl struct {\n\trows int\n\tcol... | go | edit | 0 | 2 | mit | 7c9f3a0c66ca6ba0c3ea10296de73dc1053bd124 | jmptrader/matrix-go,mitsuse/matrix-go | mutable/dense/dense.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage spec\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"net/url\"\n\n\t\"github.com/rightlag/go-swagger-object-model\"\n)\n\nfunc LoadSchema(u *url.URL) (*models.Schema, error) {\n\tvar schema models.Schema\n\trespon... | go | edit | 6 | 4 | mit | 7def621e65be42b0269547de2c62c7b2ebcb84e4 | slate-io/slate | spec/spec.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jsonstructure\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\ntype SchemaError struct {\n\tScope []string\n\tErr error\n}\n\ntype EnumError struct {\n\tSchemaError\n}\n\nfunc (e *SchemaError) Error() string {\n\treturn fmt.Sprintf(\"At /%... | go | edit | 0 | 2 | apache-2.0 | 48983e46f721c439e2106eeb78578e7f2b4c4f6a | json-structure/json-structure,json-structure/json-structure | golang-jsonstructure/errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage go_euler\n\nfunc Factor(n int) chan int {\n\tc := make(chan int)\n\tgo factor(n, c)\n\treturn c\n}\n\nfunc factor(n int, c chan int) {\n\tfor i := 2; i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tn /= i\n\t\t\tc <- i\n\t\t\ti = 1 // Repeat lo... | go | edit | 0 | 3 | mit | f51cf9e706c2e834d9fd032655732a4102958a3c | PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge,PhilHarnish/forge | src/euler/go_euler/go_euler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/streadway/amqp\"\n)\n\nfunc rabbitStart() (ch *amqp.Channel, close func(), err error) {\n\tconn, err := amqp.Dial(\"amqp://guest:<EMAIL>:5672/\")\n\tlog.Fatalf(\"Failed to connect to AMQP se... | go | edit | 0 | 3 | apache-2.0 | dcdd6089f648719bb0d52e051c9b2b41938a06d9 | nictuku/stardew-rocks,nictuku/stardew-rocks,nictuku/stardew-rocks,nictuku/stardew-rocks | client/publish.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cassandra\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/intelsdi-x/swan/pkg/cassandra\"\n\t. \"github.com/smartystreets/goconvey/convey\"\n\t\"testing\"\n)\n\nfunc TestCassandraConnection(t *testing.T) {\n\tlogrus.SetLev... | go | edit | 18 | 1 | apache-2.0 | 0a45d48bf2e3ec9041f3f4b7050b3e79eff9df8b | intelsdi-x/swan,intelsdi-x/swan,intelsdi-x/swan | integration_tests/pkg/cassandra/connector_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 The casbin Authors. All Rights Reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License a... | go | edit | 3 | 2 | apache-2.0 | f9cc36e6fa38e862a408fb7b595bfbdd148e5279 | faceless-saint/casbin,hsluoyz/casbin,casbin/casbin | util/log_util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"bytes\"\n\n\t\"github.com/eyecuelab/kit/assets\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc Load(envPrefix string, configPath string) error {\n\tviper.SetConfigType(\"yaml\")\n\n\tif len(configPath) > 0 {\n\t\tvipe... | go | edit | 0 | 7 | apache-2.0 | b9bd3c2e3a7c5f8c31b6c75e52764823bf2cae8e | eyecuelab/kit | config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage spartaS3\n\n// EventOwnerIdentity event data\ntype EventOwnerIdentity struct {\n\tPrincpalID string `json:\"principalId\"`\n}\n\n// Bucket event data\ntype Bucket struct {\n\tName string `json:\"name\"`\n\tArn ... | go | edit | 0 | 0 | mit | eb965e33fc2b14778611fb047d64411b0ea7bb7a | mweagle/Sparta,mweagle/Sparta,mweagle/Sparta,mweagle/Sparta | aws/s3/events.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The LUCI Authors. All rights reserved.\n// Use of this source code is governed under the Apache License, Version 2.0\n// that can be found in the LICENSE file.\n\npackage common\n\nimport (\n\t\"github.com/kr/pretty\"\n)\n\n//... | go | edit | 0 | 1 | apache-2.0 | 24ddd3d6c1481d4b6d82dade0a19b37d29b1474e | luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go | client/internal/common/types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// go build -o gogrep\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfatal(2, \"Usage: %s <pattern> <file>\\n\", os.Args[0])\n\t}\n\n\tpat := os.Args[1]\n\tfile := os... | go | edit | 0 | 5 | mit | 184253db5b698e2f8cb9439262fd5b8262deb0af | imattman/grep-using-go | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mig\n\nimport (\n\t\"errors\"\n\t\"sync\"\n\t\"time\"\n)\n\nvar mutex = sync.Mutex{}\nvar ErrDatabaseLockTimout = errors.New(\"mig.WithDatabaseLock timed out\")\n\nfunc WithDatabaseLock(db DB, timeout time.Duration, callback func() erro... | go | edit | 3 | 4 | mit | 6b1ea0dabd50c9f183059688e90911baf53f54f1 | jargv/mig | dbLock.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// package to return the program version\npackage version\n\nconst (\n\tversion = \"0.2.0\"\n)\n\n// return the current application version\nfunc Version() string {\n\treturn version\n}\n\n```\n\nApply this change: Configure setup_instruments (... | go | edit | 0 | 1 | bsd-2-clause | 68d16c936752d5c43f330b981bbd4b215654d13b | sjmudd/ps-top,sjmudd/ps-top | version/version.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage metrics\n\nimport (\n\t\"testing\"\n\n\t\"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile\"\n)\n\nfunc TestMetricsUnmarshalCaddyfile(t *testing.T) {\n\tm := &Metrics{}\n\td := caddyfile.NewTestDispenser(`metrics bogus`)\n\terr := ... | go | edit | 9 | 7 | apache-2.0 | a944de4ab7acfdd114d11a2ca0d267110ba9c152 | l3dlp/caddy,l3dlp/caddy,l3dlp/caddy | modules/metrics/metrics_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\npackage buf\n\nimport (\n\t\"syscall\"\n)\n\nfunc checkReadVConstraint(conn syscall.RawConn) (bool, error) {\n\tvar isSocketReady = false\n\tvar reason error\n\t/*\n\t\t\tIn Windows, WSARecv system call only support socket co... | go | edit | 3 | 2 | mit | a32d6416e5b58f22d245d630c47fe6fdd420b297 | v2ray/v2ray-core,panzer13/v2ray-core,v2ray/v2ray-core,panzer13/v2ray-core | common/buf/readv_constraint_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage yang\n\nimport \"github.com/openconfig/goyang/pkg/yang\"\n\ntype entry struct {\n\t*yang.Entry\n}\n\nfunc (e entry) rpcs() []entry {\n\trpcs := []entry{}\n\tfor _, child := range e.Dir {\n\t\tif child.RPC != nil {\n\t\t\trpcs = append(r... | go | edit | 9 | 5 | apache-2.0 | 241876eccb0a5dfe73e7c1ac6f7946f26d1266c0 | oshothebig/pbast | transform/yang/entry.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n Copyright The containerd Authors.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://w... | go | edit | 0 | 1 | apache-2.0 | a7af3c13a520bc3a717bf54915701fcd42ef71eb | mikebrow/containerd,crosbymichael/containerd,vdemeester/containerd,vdemeester/containerd,dmcgowan/containerd,estesp/containerd,containerd/containerd,mikebrow/containerd,thaJeztah/containerd,containerd/containerd,crosbymichael/containerd,dmcgowan/containerd,estesp/containerd,thaJeztah/containerd | services/server/server_solaris.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage action\n\nimport (\n\t\"flag\"\n)\n\ntype operatorKeyringList struct {\n\t*config\n}\n\nfunc OperatorKeyringListAction() Action {\n\treturn &operatorKeyringList{\n\t\tconfig: &gConfig,\n\t}\n}\n\nfunc (o *operatorKeyringList) CommandFla... | go | edit | 24 | 3 | apache-2.0 | efba26e793ff95a68c819be6e274f4b0c8632b89 | mantl/consul-cli,mantl/consul-cli,CiscoCloud/consul-cli | action/operator_keyring_list.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t\"path/filepath\"\n\n\t\"github.com/cloudfoundry/libbuildpack/cutlass\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"CF Binary Buildpack\", func() {\n\tvar app ... | go | edit | 45 | 2 | apache-2.0 | e0c2c779adf652c65f796e16f33bc41c4c204c18 | rakutentech/binary-buildpack,cloudfoundry/binary-buildpack,cloudfoundry/binary-buildpack,cloudfoundry/binary-buildpack,rakutentech/binary-buildpack,rakutentech/binary-buildpack | src/binary/integration/deploy_a_binary_app_test.go | rejected_lint | Too many lint violations: 45 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sgload\n\nimport \"log\"\n\ntype GateLoadSpec struct {\n\tLoadSpec\n\tWriteLoadSpec\n\tReadLoadSpec\n\tUpdateLoadSpec\n}\n\nfunc (gls GateLoadSpec) Validate() error {\n\n\tif err := gls.LoadSpec.Validate(); err != nil {\n\t\treturn err\... | go | edit | 12 | 6 | apache-2.0 | c7d330e20a1959579f5292cf14b0a8ce03184515 | couchbaselabs/sgload | sgload/gateload_spec.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// $G $D/$F.go && $L $F.$A && (! ./$A.out || echo BUG: should not succeed)\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npa... | go | edit | 18 | 4 | bsd-3-clause | 016fd1dee1d652fa6589db05cb2d9aac9e50249a | abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go | test/bugs/bug113.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.... | go | edit | 0 | 0 | apache-2.0 | 9970ae85fb0cc5374233b223f04b025ecdd7f0be | kubernetes-retired/cluster-registry,kubernetes-retired/cluster-registry | apis/federation/annotations.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage imageserver\n\nimport (\n\t\"errors\"\n\t\"testing\"\n)\n\ntype size struct {\n\twidth int\n\theight int\n}\n\ntype providerSize struct{}\n\nfunc (provider *providerSize) Get(source interface{}, parameters Parameters) (*Image, error) {... | go | edit | 24 | 2 | mit | d83645b14ebff9caee145159fae77a1f277ca4cd | pierrre/imageserver | server_test.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage id3v2\n\nimport (\n\t\"bytes\"\n\t\"github.com/bogem/id3v2/frame\"\n\t\"os\"\n\t\"sync\"\n)\n\nvar bytesBufPool = sync.Pool{\n\tNew: func() interface{} { return new(bytes.Buffer) },\n}\n\nfunc Open(name string) (*Tag, error) {\n\tfile, ... | go | edit | 6 | 2 | mit | 0135b94473fe6ed4722829ef5d5842f56bf3ea7f | bogem/id3v2 | id3v2.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage service_test\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/cloudfoundry-incubator/cf-test-helpers/services/context_setup\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\ntype redisT... | go | edit | 6 | 3 | apache-2.0 | 2f6d4398d06f45c7da4ba9b0e7f7cd798b9a3125 | pivotal-cf/cf-redis-smoke-tests,pivotal-cf/cf-redis-smoke-tests | service/service_suite_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport \"time\"\n\ntype ScriptsRequest struct {\n\tArgs []string `json:\"args,omitempty\"`\n\tFiles map[string]string `json:\"files,omitempty\"`\n\tCallbackURL string `json:\"callback_url,omitempt... | go | edit | 0 | 0 | mit | 9149cf53879adbe6b8fe098e0efdecfd63cdd679 | pressly/qmd | api/scripts.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage url\n\nimport (\n\t\"fmt\"\n\t\"net/url\"\n\t\"strings\"\n\n\t\"github.com/tonyhb/govalidate/helper\"\n\t\"github.com/tonyhb/govalidate/rules\"\n)\n\nfunc init() {\n\trules.Add(\"URL\", URL)\n}\n\n// Validates a URL using url.Parse() in... | go | edit | 0 | 7 | mit | ed161fe9d683ad4dbda50514cc609f9a8189c288 | tonyhb/govalidate | rules/url/url.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration\n\nimport . \"github.com/onsi/ginkgo\"\n\nfunc testNFSShare(aws infrastructureProvisioner, distro linuxDistro) {\n\tnfsServers, err := aws.CreateNFSServers()\n\tFailIfError(err, \"Couldn't set up NFS shares\")\n\n\tWithMiniI... | go | edit | 33 | 1 | apache-2.0 | b526ff68d4cb462dab0c335a8a2b968299a64e5a | apprenda/kismatic,apprenda/kismatic,apprenda/kismatic | integration/nfsshare.go | rejected_lint | Too many lint violations: 33 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage netlink\n\nimport (\n\t\"fmt\"\n\t\"net\"\n)\n\n// Dir is an enum representing an ipsec template direction.\ntype Dir uint8\n\nconst (\n\tXFRM_DIR_IN = iota\n\tXFRM_DIR_OUT = iota\n)\n\nfunc (d Dir) String() string {\n\tswitch d {\n\tc... | go | edit | 6 | 7 | apache-2.0 | 88c13bcb5c55ddd09494944c97e7d14e1c738e10 | mcastelino/netlink,nickethier/netlink,LK4D4/netlink,ninjadq/netlink,paravmellanox/netlink,chantra/netlink,porjo/netlink,axsh/netlink,vishvananda/netlink,clearlinux/netlink,mrjana/netlink,bboreham/netlink | xfrm_policy.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"encoding/json\"\n\t\"github.com/alex1sz/shotcharter-go/utilities\"\n\t\"github.com/gorilla/mux\"\n\t// \"log\"\n\t\"net/http\"\n\t// neccessary to catch sql.ErrNoRows\n\t// \"database/sql\"\n\n\t\"github.com... | go | edit | 9 | 4 | mit | 5b76abab10292af97ae9c3ea3da825c3353c224f | Alex1sz/shotcharter-go-api | controllers/game_controller.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport (\n \"github.com/yawnt/index.spacedock/couch\"\n \"github.com/fjl/go-couchdb\"\n)\n\ntype User struct {\n\n}\n\nfunc NewUser() *User {\n return &User{}\n}\n\nfunc GetUser(name string) (*User, error) {\n ret := &User... | go | edit | 0 | 4 | mit | 2c973222464a9ae133b089aa0f7cd48958bc36ed | spacedock-io/index | models/user.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"flag\"\n\t\"fmt\"\n\n\tnats \"github.com/nats-io/go-nats\"\n\t\"github.com/regner/albiondata-client/lib\"\n)\n\nvar natsURL string\n\nfunc init() {\n\tflag.StringVar(\n\t\t&natsURL,\n\t\t\"i\",... | go | edit | 0 | 4 | mit | 4f27b0ec2e1d4a9dbf73dfba7fea4f45473652a2 | oxisto/albiondata-client,Ultraporing/albiondata-client,oxisto/albiondata-client,Ultraporing/albiondata-client | cmd/natsdumper/natsdumper.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\t\"github.com/citadel/citadel\"\n\t\"github.com/citadel/citadel/cluster\"\n\t\"github.com/citadel/citadel/scheduler\"\n)\n\nfunc main() {\n\tengines := []*citadel.Engine{}\n\n\tc, err := cluster.New(sched... | go | edit | 0 | 8 | mit | c2dfa2c19663904fd331b4b61b79f3d66048c44b | liebo/citadel | examples/cluster.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc Example() {\n\n\tcapitals := map[string]string{\n\t\t\"NSW\": \"Sydney\",\n\t\t\"VIC\":\n\t\t\"Melbourne\",\n\t\t\"TAS\": \"Hobart\",\n\t\t\"WA\": \"Perth\",\n\t\t\"QLD\": \"Brisbane\",\n\t\t\"SA\": \"Adel... | go | edit | 0 | 3 | mit | e2a82380cd99592cd1713230a94c4a143f50ffae | rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,... | go/compound_statements_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gnotifier\n\nimport (\n\t\"github.com/deckarep/gosx-notifier\"\n)\n\nfunc (n *notifier) Push() error {\n\terr := n.IsValid()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tnotification := gosxnotifier.NewNotification(n.Config.Message)\n\t... | go | edit | 0 | 2 | mit | 631d4fd22f39d6ff2d2c4f1e98949999c45766fe | haklop/gnotifier | gnotifier_darwin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n)\n\nfunc dummyNewUser() *User {\n\tvar letters = []rune(\"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\")\n\n\trandSeq := func(n int) string {\n\t\tb := make([]rune, n)\n\t\tfor... | go | edit | 9 | 2 | apache-2.0 | 85337525023b304d71ce16fce35208889acf1be4 | gourd/gourd | _examples/2_server/user_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nagiosplugin\n\n// Nagios plugin exit status.\ntype Status uint\n\n// The usual mapping from 0-3.\nconst (\n\tOK Status = iota\n\tWARNING\n\tCRITICAL\n\tUNKNOWN\n)\n\n// Returns string representation of a Status. Panics if given an inva... | go | edit | 0 | 5 | bsd-3-clause | 8585162422198b6961bc736bde20ad9ab80b3829 | fractalcat/nagiosplugin,olorin/nagiosplugin | result.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jwthelper\n\nimport (\n\t\"github.com/dgrijalva/jwt-go\"\n)\n\ntype Signer struct {\n\tMethod jwt.SigningMethod\n\tkey interface{}\n}\n\ntype SignerOption struct {\n\tf func(s *Signer)\n}\n\nfunc SignerMethod(m jwt.SigningMethod) Sig... | go | edit | 12 | 3 | mit | 23d07ef0a6818fa4dbe343dfd35e324a96fb1763 | northbright/jwthelper | signer.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !appengine,!tinygo\n\npackage fwd\n\nimport (\n\t\"reflect\"\n\t\"unsafe\"\n)\n\n// unsafe cast string as []byte\nfunc unsafestr(b string) []byte {\n\tl := len(b)\n\treturn *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{\n\t\tLen: l,... | go | edit | 0 | 1 | mit | 8be6da3b9e29bc5701fad75f3253a30805f28cf4 | philhofer/fwd | writer_unsafe.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cync\n\nimport (\n\t\"sync\"\n\t\"testing\"\n\n\t\"github.com/thatguystone/cog/check\"\n)\n\nfunc TestSemaphore(t *testing.T) {\n\tc := check.New(t)\n\ts := NewSemaphore(2)\n\n\tfor i := 0; i < s.count; i++ {\n\t\ts.Lock()\n\t}\n\n\twg ... | go | edit | 6 | 4 | mit | bf8e9b3bb14647482313a3dab5f8a56e8e99dc1e | thatguystone/assert,thatguystone/assert,thatguystone/assert,thatguystone/cog | cync/sema_test.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\"net/http\"\n\t\"testing\"\n\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestContainerExportError(t *testing.T) {\n\tclient := &Client{\n\t\ttransport: newMockClient(nil, errorMock(http.StatusInternalServerError, \... | go | edit | 0 | 4 | apache-2.0 | 55960d6e0bda20d4452a1b73c48d542f84661e2f | jwhonce/engine-api,vdemeester/engine-api,thaJeztah/engine-api,docker/engine-api | client/container_export_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage magic\n\nimport (\n\t\"testing\"\n)\n\nfunc TestConstants(t *testing.T) {\n\tvar constantTests = []struct {\n\t\tgiven int\n\t\texpected []int\n\t}{\n\t\t{\n\t\t\tMIME,\n\t\t\t[]int{\n\t\t\t\tMIME_TYPE,\n\t\t\t\tMIME_ENCODING,\n\t\t\... | go | edit | 48 | 5 | apache-2.0 | f2da51b51b059f30ee715c9e0bd87d9c50f12b78 | kwilczynski/go-magic,kwilczynski/go-magic,kwilczynski/go-magic | constants_test.go | rejected_lint | Too many lint violations: 48 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sysdep\n\nimport (\n bs_core \"bitbucket.org/yyuu/bs/core\"\n bs_ir \"bitbucket.org/yyuu/bs/ir\"\n)\n\ntype X86CodeGenerator struct {\n errorHandler *bs_core.ErrorHandler\n}\n\nfunc NewX86CodeGenerator(errorHandler *bs_core.ErrorHand... | go | edit | 9 | 1 | mit | e3d73a6350901b1fb9b73d5a8f8d97d949524c33 | yyuu/xtc,yyuu/xtc | sysdep/x86_code_generator.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main // import \"github.com/CenturyLinkLabs/imagelayers\"\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/CenturyLinkLabs/imagelayers/api\"\n\t\"github.com/CenturyLinkLabs/imagelayers/server\"\n\t\"github... | go | edit | 0 | 2 | apache-2.0 | 7f42be12da8429ad5cef835a043b35da7f548747 | BWITS/imagelayers,argvader/imagelayers,Acidburn0zzz/imagelayers,patocox/imagelayers,Acidburn0zzz/imagelayers,CenturyLinkLabs/imagelayers,BWITS/imagelayers,CenturyLinkLabs/imagelayers,patocox/imagelayers,rupakg/imagelayers,argvader/imagelayers,rupakg/imagelayers | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main_test\n\nimport \"testing\"\n\nfunc Test_failure(t *testing.T) {\n\tt.Fatal(\"Write a test...\")\n}\n\n```\n\nApply this change: Remove failing test to verify travis builds succeed now."
},
{
"role": "assistant",
"conten... | go | edit | 0 | 1 | bsd-3-clause | bf00c5a6cc5c9e004cdf628b8c630a1f03583fca | nfisher/apib2go | parser_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\n// resolves a relative image path to a fully qialified path.\nfunc ResolveImagePath(relativePath string) string {\n\treturn \"images/\" + relativePath\n}\n\n```\n\nApply this change: Allow images directory to be configured.\n\nS... | go | edit | 0 | 1 | mit | f091d6da065552c707bf9fca580a12602393b47c | lindsaymarkward/sphere-go-led-controller,ninjasphere/sphere-go-led-controller,lindsaymarkward/sphere-go-led-controller,ninjasphere/sphere-go-led-controller,ninjasphere/sphere-go-led-controller,lindsaymarkward/sphere-go-led-controller,ninjasphere/sphere-go-led-controller,lindsaymarkward/sphere-go-led-controller | util/resolver.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage response\n\nimport (\n\t\"fmt\"\n\n\t\"warcluster/entities\"\n)\n\ntype ServerParams struct {\n\tbaseResponse\n\tHomeSPM float64 //ships per minute\n\tPlanetsSPM map[string]float64\n\tRaces map[string]entities.Race\n}\n\nfunc Ne... | go | edit | 6 | 3 | mit | 18de99b55b77c3d965af8774a99d7abdb2ddea3f | WarCluster/warcluster-server,WarCluster/warcluster-server | server/response/server_params.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\"net/http\"\n\t\"time\"\n)\n\nfunc timeHandler(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprint(w, time.Now().Format(\"02 Jan 2006 15:04:05 MST\"))\n}\n\nfunc main() {\n\tport := \":9999\"\n\n\tfil... | go | edit | 0 | 1 | unlicense | 18dc805104d86b0e78eb6317c1cef6167501e662 | eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog | 2022/go-static-http-server/server-static-and-dynamic.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"errors\"\n\t\"net\"\n)\n\nfunc getMyIP() (net.IP, error) {\n\tvar myIP net.IP\n\tmostOnesInMask := 0\n\tinterfaces, err := net.Interfaces()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, iface := range inte... | go | edit | 0 | 12 | apache-2.0 | 70e03fc997049a38107efdb9ab51e8e38fc80323 | rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator | lib/net/util/getMyIP.go | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"testing\"\n)\n\nvar mersennes = []int {\n 2,\n 3,\n 5,\n 7,\n 13,\n 17,\n 19,\n 31,\n 61,\n}\n\nfunc TestPrime(t *testing.T) {\n for _, p := range mersennes {\n if !isPrime(p)... | go | edit | 9 | 5 | bsd-3-clause | 3a012e96adbf7c4ca1b90c3af0b3413d2e5393c5 | ericdahl/go-mersenne-primes | src/github.com/ericdahl/go-mersenne-primes/lucas-lehmer_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2013-2014 The btcsuite developers\n// Use of this source code is governed by an ISC\n// license that can be found in the LICENSE file.\n\npackage legacyrpc\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"reflect\"\n\t... | go | edit | 3 | 5 | isc | 5d6392b65d25818f52a19c23d4a2f7bb5716fdb3 | jrick/btcwallet,btcsuite/btcwallet,btcsuite/btcwallet,jrick/btcwallet,jrick/dcrwallet,Roasbeef/btcwallet,synrg-labs/btcwallet,Stash-Crypto/btcwallet,Stash-Crypto/btcwallet,synrg-labs/btcwallet,decred/dcrwallet,jrick/dcrwallet,Roasbeef/btcwallet,decred/dcrwallet | rpc/legacyrpc/rpcserver_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t_ \"expvar\"\n\t\"net/http\"\n\n\t\"gitlab.com/mattbostock/timeoff/handler\"\n)\n\nfunc registerRoutes() {\n\tmux.Add(\"GET\", \"/debug/vars\", http.DefaultServeMux)\n\tmux.Get(\"/\", handler.Index)\n}\n\n```\n\nAppl... | go | edit | 6 | 1 | mit | 06349aab2d237f87e05132dcbf0732ac4f309a19 | mattbostock/leavediary | routes.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2019 The OpenSDS 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 | 6 | 2 | apache-2.0 | 0cf0543a24707bdf99b72591745271447fa39222 | opensds/opensds,opensds/opensds,opensds/opensds | pkg/utils/pwd/pwd.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\"encoding/json\"\n)\n\nfunc encryptValueGood(v interface{}) ([]byte, error) {\n\tjsonData, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsize := uint64(len(jsonData)) + (uint64(len(jsonData)... | go | edit | 3 | 2 | mit | cb2f15f770e449cd019212fd8d3c3b78298b73c6 | github/codeql,github/codeql-go,github/codeql-go,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql-go,github/codeql,github/codeql,github/codeql,github/codeql-go,github/codeql | ql/test/query-tests/Security/CWE-190/AllocationSizeOverflowGood2.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pixy\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mailgun/kafka-pixy/Godeps/_workspace/src/github.com/mailgun/log\"\n\t\"github.com/mailgun/kafka-pixy/Godeps/_workspace/src/github.com/mailgun/sarama\"\n\t\"github.com/mailgun/kafka-pixy/Gode... | go | edit | 0 | 3 | apache-2.0 | c88fe4ae49b26caef567bad8b7a4e4f1267ca96a | mailgun/kafka-pixy,mailgun/kafka-pixy,mailgun/kafka-pixy | pixy/logging.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\n\t\"github.com/ClusterHQ/dvol/pkg/api\"\n\t\"github.com/spf13/cobra\"\n)\n\nfunc NewCmdBranch(out io.Writer) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\t// TODO: Improve the usage st... | go | edit | 3 | 6 | apache-2.0 | 123967e28d46d223de62a175f6aa225c94721ccb | ClusterHQ/dvol,ClusterHQ/dvol,ClusterHQ/dvol | pkg/cmd/branch.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2018 Google LLC\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// https://www.apac... | go | edit | 0 | 1 | apache-2.0 | 16235b6286b42477477123de4e1ab5dcead7da4e | ampproject/amppackager,ampproject/amppackager,ampproject/amppackager | util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage plot\n\nimport (\n\t\"testing\"\n)\n\nfunc TestDrawImage(t *testing.T) {\n\tExample().Save(4, 4, \"test.png\")\n}\n\nfunc TestDrawEps(t *testing.T) {\n\tExample().Save(4, 4, \"test.eps\")\n}\n\n```\n\nApply this change: Test for errors ... | go | edit | 6 | 2 | mit | 0a88fd404a28faa2b1359a5450713963961e64a7 | aquarat/plotinum,tectronics/plotinum,zhanglong2005/plotinum | plot/plot_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stack\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n)\n\ntype Context struct {\n\tmu sync.RWMutex\n\tm map[string]interface{}\n}\n\nfunc NewContext() *Context {\n\tm := make(map[string]interface{})\n\treturn &Context{m: m}\n}\n\nfunc (c *Context... | go | edit | 0 | 2 | mit | 10adbb2bdfa621ae3ac43736bd1a23781988b6ea | alexedwards/stack | context.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logutil\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestThrottledLogger(t *testing.T) {\n\ttl := NewThrottledLogger(\"test\", 100*time.Millisecond)\n\n\ttl.Infof(\"test %v\", 1)\n\ttl.Infof(\"test %v\", 2)\n\tif tl.skippedCount !=... | go | edit | 6 | 7 | apache-2.0 | 7fd9584ebeb30f4bb1e6d79ada5d3a5da0f20a5a | alainjobart/vitess,tjyang/vitess,cloudbearings/vitess,mapbased/vitess,mlc0202/vitess,aaijazi/vitess,dcadevil/vitess,cloudbearings/vitess,enisoc/vitess,sougou/vitess,AndyDiamondstein/vitess,nurblieh/vitess,cloudbearings/vitess,guokeno0/vitess,kuipertan/vitess,aaijazi/vitess,yangzhongj/vitess,guokeno0/vitess,nurblieh/vit... | go/vt/logutil/throttled_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2022 Google LLC\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.apac... | go | edit | 0 | 3 | apache-2.0 | 37487e685b21926ec218d1d3f0948459fcbb32f2 | google/tink,google/tink,google/tink,google/tink,google/tink,google/tink,google/tink,google/tink | go/keyderivation/internal/streamingprf/streaming_prf_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\ntype trigger struct {\n\tSchedule string `json:\"schedule\"`\n\tType string `json:\"type\"`\n}\n\ntype notify struct {\n\tPayload string `json:\"payload\"`\n}\n\ntype step struct {\n\tName string `json:\"name\"`\n\tPayload strin... | go | edit | 0 | 0 | bsd-2-clause | 26b27fe12595b0a1ad14e2b5ce5a78f11bcbd44d | clee/channon,sboyettedh/channon | types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport (\n\t\"testing\"\n)\n\nfunc SetUser() *User {\n\treturn &User {\n\t\tLoginName: \"loginName\",\n\t\tGitHubUsername: \"github_user\",\n\t\tSlackUsername: \"slack_user\",\n\t\tSlackUserId: \"SLACKID\",\n\t}\n}\n\nfunc Tes... | go | edit | 6 | 4 | mit | a0542b662899c105853eaebeef9a751ceb7af00f | wantedly/developers-account-mapper | models/user_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage librariesio\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nconst APIKey string = \"1234\"\n\nfunc TestNewClient(t *testing.T) {\n\tc := NewClient(APIKey)\n\n\tif got, want := c.apiKey, APIKey; got != want {\n\t\tt.Errorf(\"NewClient baseU... | go | edit | 6 | 5 | mit | a0c5eb039ee82477bef82de69c679b9d6e8c098b | hackebrot/go-librariesio | librariesio/librariesio_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !cgo\n\n// Package service implements the daemon service for mediating access to the\n// storage backend.\npackage service\n\nimport (\n\t\"github.com/elves/elvish/util\"\n\t\"syscall\"\n)\n\nvar logger = util.GetLogger(\"[daemon-dumm... | go | edit | 0 | 1 | bsd-2-clause | f6ee3f8284632a262556a95bf05be32469e99ffa | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | daemon/service/service_nocgo.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage resources\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/service/ec2\"\n)\n\ntype EC2Subnet struct {\n\tsvc *ec2.EC2\n\tid *string\n\tregion *string\n}\n\nfunc (n *EC2Nuke) ListSubnets() ([]Resource, error) {\n\tparams :... | go | edit | 6 | 3 | mit | d85d2805568f8ea3af628aa82192c497e4229981 | rebuy-de/aws-nuke,rebuy-de/aws-nuke | resources/ec2-subnets.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/coxx/es-slowlog/internal/parser\"\n)\n\nfunc main() {\n\tconst defaultFormat = \"{{.Source}}\"\n\n\tstderr := log.New(os.Stderr, \"\", 0)\n\n\tflag... | go | edit | 0 | 10 | mit | da3fe87949edfd9eac8e9fd24195188d5969206a | coxx/es-slowlog | cmd/es-slowlog-parse/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage store\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc Test_StoreOpen(t *testing.T) {\n\ts := New()\n\ttmpDir, _ := ioutil.TempDir(\"\", \"store_test\")\n\tdefer os.RemoveAll(tmpDir)\n\n\ts.RaftBind = \"127.0.0.1:8088\"\... | go | edit | 6 | 9 | mit | c645bdd74a494329c37efd240af3b74f37a42d68 | otoolep/hraftd | store/store_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t//\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t//\"strings\"\n)\n\nfunc receive(w http.ResponseWriter, r *http.Request) {\n\tio.WriteString(w, \"Hello world!\")\n}\n\nfunc main() {\n\t//... | go | edit | 0 | 2 | apache-2.0 | 027a290a2d885cf93d296769570a840a78b2981d | ovaskevich/TxtRoulette | server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2018 The Kubernetes Authors 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 ... | go | edit | 0 | 0 | apache-2.0 | c25ab2d107b7750f5cc955ff68bb4f8a7c75dccc | warmchang/minikube,dlorenc/minikube,kubernetes/minikube,warmchang/minikube,warmchang/minikube,dalehamel/minikube,warmchang/minikube,kubernetes/minikube,dlorenc/minikube,kubernetes/minikube,warmchang/minikube,kubernetes/minikube,kubernetes/minikube,kubernetes/minikube,warmchang/minikube,dlorenc/minikube,dalehamel/miniku... | pkg/minikube/bootstrapper/kubeadm/default_cni.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// http://blog.denevell.org/golang-closures-anonymous-functions.html\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tanon := func(name string) string {\n\t\treturn \"Hiya, \" + name\n\t}\n\tanotherFunction(anon)\n}\n\nfunc anotherFunction(f... | go | edit | 0 | 1 | bsd-3-clause | 1e3609474470876732e0db9852f2fadad4021d0a | zchee/cgo,zchee/cgo | anony_func/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bench\n\nimport (\n\t\"time\"\n\n\t\"github.com/nats-io/nats\"\n)\n\n// NATSRequester implements Requester by publishing a message to NATS and\n// waiting to receive it.\ntype NATSRequester struct {\n\tURL string\n\tPayloadSize ... | go | edit | 0 | 3 | apache-2.0 | d0352a6064678c0cca4c4b6019ee0476ccb34e28 | tylertreat/bench | nats_requester.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage types implements support for the types used in the Navitia API (see doc.navitia.io), simplified and modified for idiomatic Go use.\n\nThis package was and is developed as a supporting library for the gonavitia API client (https://gi... | go | edit | 0 | 0 | unlicense | 7ebdcd7ee77d88e37e3354cec46eeca3f1c9bf0b | aabizri/navitia,aabizri/navitia | types/common.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux,cgo\n\npackage term\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\n// #include <termios.h>\nimport \"C\"\n\ntype Termios syscall.Termios\n\n// MakeRaw put the terminal connected to the given file descriptor into raw\n// mode and... | go | edit | 6 | 3 | apache-2.0 | 05a8de46853f8b3534ca6d0cb03121ae214e8a34 | keerthanabs1/docker,lixiaobing10051267/docker,manchoz/docker,mpatlasov/docker,jagdeesh109/docker,yp-engineering/docker,mixja/docker,wzzrd/docker,dccurtis/docker,kirankbs/docker,jc-m/docker,kdomanski/docker,wulonghui/docker,ankushagarwal/docker,zoomis/docker,bonczj/moby-json-file-logger,pecameron/docker,SFDMumbaiDockerH... | pkg/term/tc_linux_cgo.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/xyproto/web.go\"\n)\n\ntype Greeter struct {\n\tgreeting string\n}\n\nfunc (g *Greeter) Greet(s string) string {\n\treturn g.greeting + \" \" + s\n}\n\nfunc main() {\n\tg := &Greeter{\"hello\"}\n\tweb.Ge... | go | edit | 6 | 1 | mit | 8f937ea95c24488e1ac6fb824d3493fd0c34d521 | hraban/web | examples/methodhandler.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/url\"\n\t\"os\"\n\t\"runtime/pprof\"\n\t\"wapbot.co.uk/crawler\"\n)\n\nvar cpuprofile = flag.String(\"cpuprofile\", \"\", \"write cpu profile to file\")\n\nfunc main() {\n\tfla... | go | edit | 0 | 5 | mit | 91cd0bf56db9a0840b52e40ebc130b12233b6b45 | yoink00/crawler,yoink00/crawler | src/wapbot.co.uk/crawlapp/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"provisioner/provisioner\"\n)\n\ntype CloseAllPorts struct {\n\tCmdRunner provisioner.CmdRunner\n}\n\nfunc (c *CloseAllPorts) Run() error {\n\terr := c.CmdRunner.Run(\"iptables\", \"-I\", \"INPUT\", \"-i\", \"et... | go | edit | 0 | 3 | apache-2.0 | 7cdfe9a31d3590bce98a928428b6b17389239ccb | pivotal-cf/micropcf,pivotal-cf/micropcf | src/provisioner/provisioner/commands/close_all_ports.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 | 2ce9a9b374519db51cc889a3473a550450a4daa9 | itsankoff/gotcha,itsankoff/gotcha | cmd/server/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"testing\"\n\ntype testVisitor struct {\n\tstart int\n\tend int\n}\n\nfunc (v *testVisitor) Start(i int) {\n\tv.start = i\n}\n\nfunc (v *testVisitor) End(a, b int) {\n\tv.end = a + b\n}\n\nfunc TestTraverseBasic(t *tes... | go | edit | 6 | 3 | unlicense | 241c0115a1d1a7414bbe22408635276581270787 | eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog,eliben/code-for-blog | 2019/cgo-callback/example_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n Copyright The containerd Authors.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://w... | go | edit | 0 | 0 | apache-2.0 | 4515b9792230777b10db50b9cdbb5d3fd0c2a035 | containerd/go-cni,containerd/go-cni | types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n\t\"net/http\"\n\t\"github.com/ibrt/go-oauto/oauto/config\"\n\t\"encoding/json\"\n\t\"fmt\"\n)\n\ntype ApiHandler func(config *config.Config, r *http.Request, baseURL string) (interface{}, error)\n\nfunc RegisterApiRout... | go | edit | 3 | 3 | mit | b9686df0c97c6c029495830042a2aeb52c7d5a0a | ibrt/go-oauto,ibrt/go-oauto | oauto/api/api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"github.com/spf13/viper\"\n\nfunc init() {\n\tviper.SetDefault(\"base-url\", \"http://127.0.0.1:8080\")\n\tviper.SetDefault(\"http_addr\", \":8080\")\n\tviper.SetDefault(\"https_addr\", \"\")\n\tviper.SetDefault(\"https_... | go | edit | 0 | 1 | mit | 103d3d0a018556293bd7542436b9c7fa9d161e7f | evepraisal/go-evepraisal,evepraisal/go-evepraisal,evepraisal/go-evepraisal | evepraisal/config.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 | 5 | bsd-3-clause | 99363331e8532d09ba0602d80c344707f8e29d98 | digideskio/xurls,mvdan/xurls | cmd/xurls/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rest_json\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc bodyWithMessage(message string) []byte {\n\tbody, err := json.Marshal(map[string]interface{}{\n\t\t\"message\": message,\n\t})\n\tif err != nil {\n\t\tpani... | go | edit | 6 | 2 | mit | 20ee955c66228e098680b7bf99bb02a9fb0dc526 | Everlane/evan | http_handlers/rest_json/utils.go | rejected_lint | Too many lint violations: 6 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.