messages listlengths 2 2 | language stringclasses 8
values | prompt_type stringclasses 2
values | lint_errors int64 0 129 ⌀ | cyclomatic_complexity int64 0 32 ⌀ | license stringclasses 7
values | commit stringlengths 40 40 | repos stringlengths 5 116k | new_file stringlengths 4 220 | status stringclasses 6
values | error stringlengths 26 74 ⌀ | is_valid_syntax bool 2
classes |
|---|---|---|---|---|---|---|---|---|---|---|---|
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/hashicorp/vault/http\"\n\t\"github.com/hashicorp/vault/vault\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc setupVault(t *testing.T) (ne... | go | edit | 3 | 1 | mit | 8cc1969225b60f37956f011df7275d03a87edf3d | MiLk/nsscache-go | examples/nsscache-vault/main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"bytes\"\n\t//\t\"io/ioutil\"\n\t\"testing\"\n)\n\nfunc TestListNoArgs(t *testing.T) {\n\tbuf := bytes.NewBuffer([]byte{})\n\tcmd := NewCmdList(buf)\n\terr := listVolumes(cmd, []string{}, buf)\n\tif err != nil {\n\t\... | go | edit | 0 | 3 | apache-2.0 | 34a6a1ad69faf1a581cdba64cf7fd36f7f55f49e | ClusterHQ/dvol,ClusterHQ/dvol,ClusterHQ/dvol | pkg/cmd/list_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 tsuru 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\n// Package heal provides an interface for heal anything.\npackage heal\n\nimport ... | go | edit | 0 | 2 | bsd-3-clause | 5ee04dc2c275ebd756d0b98796f947979ef110f4 | kgrvamsi/tsuru,mderaldo/tsuru,firebitsbr/tsuru,hugoantunes/tsuru,kgrvamsi/tsuru,tuxmonteiro/tsuru,tsuru/tsuru,Endika/tsuru,cezarsa/tsuru,tsuru/tsuru,ggarnier/tsuru,ggarnier/tsuru,RichardKnop/tsuru,tuxmonteiro/tsuru,RichardKnop/tsuru,mderaldo/tsuru,4eek/tsuru,Endika/tsuru,cgvarela/tsuru,mderaldo/tsuru,hcxiong/tsuru,gwmo... | heal/healer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 Paolo Galeone. All right reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://... | go | edit | 0 | 4 | apache-2.0 | fb881d4ebd787939b3dc88a6788fb4a6f0fd8645 | galeone/igor | json.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hdfsbackend\n\nimport \"code.uber.internal/infra/kraken/lib/backend/hdfsbackend/webhdfs\"\n\n// Config defines configuration for all HDFS clients.\ntype Config struct {\n\tNameNodes []string `yaml:\"namenodes\"`\n\tUserName str... | go | edit | 0 | 4 | apache-2.0 | d13b3a39c252db8ec0639499fe39c2d88f0e8693 | uber/kraken,uber/kraken,uber/kraken,uber/kraken,uber/kraken | lib/backend/hdfsbackend/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !rel\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n)\n\n// Asset reads the file at the abs path given\nfunc Asset(name string) ([]byte, error) {\n\tdat, err := ioutil.ReadFile(name)\n\n\tif err != nil {\n\t\treturn nil, fmt.E... | go | edit | 0 | 2 | apache-2.0 | aefe157d01c5bf818ac41d004dffa7e8c0763e36 | sargun/riak-mesos,calebTomlinson/riak-mesos,calebTomlinson/riak-mesos,sargun/riak-mesos,calebTomlinson/riak-mesos,calebTomlinson/riak-mesos,sargun/riak-mesos,sargun/riak-mesos,sargun/riak-mesos | framework/bindata_dev.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nntp\n\nimport (\n\t\"fmt\"\n\t\"io\"\n)\n\ntype Conn struct {\n}\n\nfunc (c *Conn) Write(p []byte) (int, error) {\n\treturn 0, nil\n}\n\nfunc (c *Conn) Read(p []byte) (n int, err error) {\n\treturn\n}\n\nfunc (c *Conn) do(format string... | go | edit | 3 | 1 | mit | 2297fe68f43e217e7ef6d2edde9be76bfc0bf0c3 | andrewstuart/nntp | connection.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2016 The MITRE Corporation. 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\t... | go | edit | 3 | 0 | apache-2.0 | 08a8175d5b69b89a62616145575b48de0c4f5b18 | mitre/ptmatch,mitre/ptmatch,mitre/ptmatch | models/record_match_context.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/kataras/iris\"\n \"github.com/tappsi/airbrake-webhook/webhook\"\n)\n\nfunc main() {\n\tapi := iris.New()\n\tapi.Post(\"/airbrake-webhook\", webhook.Process)\n\tapi.Listen(\":8080\")\n}\n\n```\n\nApply t... | go | edit | 0 | 1 | mit | 20e01dae8dbd8b4be4af7b22b243e79d81e7c853 | oscar-lopez/airbrake-webhook,tappsi/airbrake-webhook | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/tscolari/docode/packages/docode\"\n\t\"github.com/tscolari/docode/packages/docodeconfig\"\n\n\t\"flag\"\n)\n\nfunc main() {\n\tdocodeFilePath := flag.String(\"config\", \"./DocodeFile\", \"ConfigFile to ... | go | edit | 0 | 2 | mit | c434bbe48ee9c5067abedc31239db2f853ac501f | tscolari/docode | docode.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)\n\nconst CompareAndSwapUsage = `usage: etcdctl [etcd flags] compareAndSwap <key> <value> [testAndSet flags]\neither prevValue or prevIndex needs to be given\nspecial flags: --ttl to set a key w... | go | edit | 15 | 3 | apache-2.0 | e8db3371d30853fbcbcc28df1df30b1bba772a13 | jakubigla/etcdctl,jakubigla/etcdctl | compare_and_swap.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage upload\n\nimport \"github.com/materials-commons/mcstore/pkg/app/flow\"\n\ntype uploader struct {\n\ttracker *uploadTracker\n}\n\nfunc newUploader() *uploader {\n\treturn &uploader{\n\t\ttracker: newUploadTracker(),\n\t}\n}\n\nfunc (u *u... | go | edit | 18 | 3 | mit | 7a6c99115283eef33d0ba62515676c0d8cf40335 | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore | server/mcstored/service/rest/upload/uploader.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ipns\n\nimport (\n\tcontext \"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context\"\n\n\t\"github.com/ipfs/go-ipfs/core\"\n\tmdag \"github.com/ipfs/go-ipfs/merkledag\"\n\tnsys \"github.com/ipfs/go-ipfs/namesys\"\n\tci... | go | edit | 0 | 5 | mit | ccd06e5b66621568f7b66d9867779eaef843a75f | jefhe2005/ipfs,keltia/go-ipfs,ianopolous/go-ipfs,kevina/go-ipfs,insionng/go-ipfs,ipfs-filestore/go-ipfs,kyledrake/go-ipfs,WeMeetAgain/go-ipfs,tswindell/go-ipfs,juztamau5/go-ipfs,bconfais/go-ipfs,ion1/go-ipfs,aviau/go-ipfs,adrusi/go-ipfs,shaunstanislaus/go-ipfs,tswindell/go-ipfs,JustinDrake/go-ipfs,insionng/go-ipfs,palk... | fuse/ipns/common.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sqlego\n\nimport \"testing\"\n\nfunc TestSelectStatement(t *testing.T) {\n\tnode := Select(\"Users\", []string{\"id\", \"name\", \"email\"})\n\tsql := node.Compile()\n\tif sql != \"SELECT id,name,email FROM Users;\" {\n\t\tt.Fatal(sql)\... | go | edit | 6 | 5 | mit | 69b1e2ca8664dbf87cf59994fb6a1b28d80c5f26 | brucehsu/sqlego | sqlego_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The Hugo Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\... | go | edit | 0 | 4 | apache-2.0 | 9262c5b32f99d677b6878984e35dbd6a5b31fbd8 | fedelibre/hugo,gohugoio/hugo,gohugoio/hugo,anthonyfok/hugo,anthonyfok/hugo,mdhender/hugo,mdhender/hugo,fedelibre/hugo,digitalcraftsman/hugo,mitchchn/hugo,fedelibre/hugo,anthonyfok/hugo,fedelibre/hugo,digitalcraftsman/hugo,mdhender/hugo,mitchchn/hugo,mdhender/hugo,gohugoio/hugo | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\ntype Config struct {\n\tport string\n\tallowedContentTypes string // uncompiled regex\n}\n\nfunc envOrDefault(key string, default_value string) string {\n\tenv :... | go | edit | 3 | 2 | mit | 9dfd3487f796dbbd24fdc325c27975a19c9d6b84 | ryanlower/front,experiment/front | front.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Stanislav Nazarenko\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://... | go | edit | 0 | 1 | apache-2.0 | f3b52d5e190706d56ac160dce08565363df796ba | kazarena/json-gold | ld/api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\t\"sync\"\n)\n\nvar wg sync.WaitGroup\n\nfunc worker(id int, jobs <-chan int, results chan<- int) {\n\tfor j := range jobs {\n\t\tif j == -1 {\n\t\t\twg.Done()\n\t\t\treturn\n\t\t}\n\t\tfmt.Prin... | go | edit | 0 | 4 | mit | 85ebca1bc6e741f02d493cbd7b1ef506e59aa2f7 | icambridge/go-playground | goroutines.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage wait\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app\"\n\t\"github.com/BytemarkHosting/bytemark-client/lib\"\n\t\"github.com/BytemarkHosting/bytemark-client/lib/brain\"\n)\n\nfunc VM... | go | edit | 0 | 4 | mit | b1f322fda10f927cc36679f4d1f9bf1f4da67cbb | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | cmd/bytemark/app/wait/vm_power_off.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\nREADME.mdpackage main\n\nimport (\n\t\"github.com/stretchr/testify/assert\"\n\t\"testing\"\n\t\"github.com/michaelklishin/rabbit-hole\"\n\t\"reflect\"\n)\n\nfunc TestGraphDefinition(t *testing.T){\n\tvar rabbitmq RabbitMQPlugin\n\n\tgraphdef :=... | go | edit | 9 | 2 | apache-2.0 | 3121a8c85e4ac887a36aa98ec8138ac920013679 | ariarijp/mackerel-agent-plugins,ki38sato/mackerel-agent-plugins,hiroakis/mackerel-agent-plugins,hiroakis/mackerel-agent-plugins,xorphitus/mackerel-agent-plugins,y-kuno/mackerel-agent-plugins,xorphitus/mackerel-agent-plugins,y-kuno/mackerel-agent-plugins,ki38sato/mackerel-agent-plugins,xorphitus/mackerel-agent-plugins,h... | mackerel-plugin-rabbitmq/rabbitmq_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n fmt.Printf(\"Hello World\\n\")\n}\n\n```\n\nApply this change: Update hello world to include a variable"
},
{
"role": "assistant",
"content": "package main\n\nimport \"fmt\"\n\nfunc... | go | edit | 0 | 1 | mit | a52a9ad69a86c54910870071a4fe788ec9117b51 | sampov2/one-language-per-month-2015,sampov2/one-language-per-month-2015,sampov2/one-language-per-month-2015 | 01-Go/01_hello_world/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\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\npackage signal\n\nimport (\n\t\"syscall\"\n\t\"testing\"\n)\n\nfunc TestSignal(t... | go | edit | 6 | 2 | bsd-3-clause | 08e8f3bd51f8e816de5902069f80704ece1957f4 | abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go | src/pkg/os/signal/signal_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage middlewares\n\nimport (\n\t\"github.com/xaviergodart/gydro/errors\"\n\t\"github.com/xaviergodart/gydro/models\"\n\t\"strconv\"\n\t\"net/http\"\n)\n\nvar (\n\tKeyParam string = \"apikey\"\n)\n\nfunc KeyAuth(next http.Handler) http.Handle... | go | edit | 0 | 7 | mit | 3c5a6284e040a6ee3685c16927ca6d1bb163b3e0 | xaviergodart/gydro | middlewares/key_auth.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage prompt\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n)\n\n// YkmanProvider runs ykman to generate a OATH-TOTP token from the Yubikey device\n// To set up ykman, first run `ykman oath add`\nfunc YkmanMfaProvi... | go | edit | 3 | 4 | mit | 07fcef05a50baf9189c4b35bd473b629a2ccd250 | 99designs/aws-vault,99designs/aws-vault | prompt/ykman.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage operations\n\nimport (\n\t\"encoding/json\"\n\t\"time\"\n\n\t\"github.com/omise/omise-go\"\n)\n\n// List contains fields that represent parameters common to most list operations. List\n// struct is not an operation in and of itself and ... | go | edit | 3 | 3 | mit | 67687ee3dc5c55ca2cd8c14261cdf17fc6237420 | omise/omise-go,omise/omise-go | operations/list.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage forces\n\nimport \"github.com/hAWKdv/go-gravity/vectors/vectors\"\n\n// KineticFriction force\ntype KineticFriction struct {\n\tmover *vectors.Mover\n\tmagnitude float64\n}\n\n// CreateKineticFriction creates a kinetic friction forc... | go | edit | 0 | 1 | mit | f4fbe5b5cc3bd4bfd24d57ed27b3238c78b303fb | hAWKdv/go-gravity | vectors/forces/kinetic_friction.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/keybase/cli\"\n\t\"github.com/keybase/client/go/libcmdline\"\n\t\"github.com/keybase/client/go/libkb\"\n)\n\ntype CmdPing struct{}\n\nfunc (v *CmdPing) Run() error {\n\t_, err := G.API.Pos... | go | edit | 9 | 3 | bsd-3-clause | 9a590ea0b872d7ed69f72569237b311e1261e7dd | keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client | go/client/cmd_ping.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/**\n* Node\n*\n* A Node data structure is the simplest data structure in CS. The idea is it's\n* an object that stores a value and a reference to the next Node. We can do\n* the following operations with a Node:\n*\n* - Create Node\n* - Get Va... | go | edit | 0 | 1 | mit | 31ba0f933e0f3a382c7015277fd275206cfe1f9f | dansackett/algorithms,dansackett/computer-science | data-structures/node/node.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rollbar\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc stderr(s string) {\n\tos.Stderr.WriteString(fmt.Sprintf(\"Rollbar error: %s\", s))\n}\n\nfunc stacktraceFrames(skip int) []map[string]interface{} {\n\tfra... | go | edit | 0 | 3 | mit | 0b7cd4e7ebf04bd2946fbed5c754fbefc03fcda3 | stvp/rollbar,nazwa/rollbar | util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage initd\n\ntype Manager interface {\n\tReloadDaemon() error\n\n\tCreateComponent(name, contents string) (Component, error)\n\n\tStart(Component) error\n\tStop(Component) error\n\tInstall(Component) error\n\tDisable(Component) error\n\tExt... | go | edit | 0 | 0 | apache-2.0 | 471f5ffd6182e0a4ce2dbc4ee08ed89f88fd252e | maxamillion/flamingo,maxamillion/flamingo,tmrts/flamingo,tmrts/flamingo | pkg/sys/initd/manager.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage docker_test\n\nimport (\n\t\"testing\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/gexec\"\n)\n\nvar builderPath string\n\nfunc TestDockerLifecycleBuilder(t *testing.T) {\n\tRegisterFail... | go | edit | 15 | 1 | apache-2.0 | 4f95548b18d2fcd73e1d6146da71eca7abab9131 | cloudfoundry-incubator/inigo | docker/builder_suite_test.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tuntap\n\nimport (\n\t\"os\"\n\t\"strings\"\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nfunc createInterface(file *os.File, ifPattern string, kind DevKind) (string, error) {\n\tvar req ifReq\n\treq.Flags = 0\n\tcopy(req.Name[:15], ifPattern)\n\t... | go | edit | 18 | 4 | apache-2.0 | a7fa9e4f7b94cb9c11fc932e9a3ae7368aec5220 | mistsys/tuntap,mistsys/tuntap | tun_linux.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage twitch\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\ntype Follow struct {\n\tCreatedAt time.Time `json:\"created_at\"`\n\tId string `json:\"_id\"`\n\tUser User `json:\"user\"`\n\tNotifications bool `json:... | go | edit | 9 | 2 | mit | 24390cd9011f6c5edc1190cf81e6974d51e64a3a | DDRBoxman/twitchgo | follow.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dropsonde_unmarshaller_test\n\nimport (\n\t\"time\"\n\n\t\"github.com/cloudfoundry/dropsonde/emitter/fake\"\n\t\"github.com/cloudfoundry/dropsonde/metric_sender\"\n\t\"github.com/cloudfoundry/dropsonde/metricbatcher\"\n\t\"github.com/cl... | go | edit | 6 | 1 | apache-2.0 | 21db66e8ab1bb14e7e142f8717a9ee587e27b739 | cloudfoundry/dropsonde,cloudfoundry/dropsonde | dropsonde_unmarshaller/dropsonde_unmarshaller_suite_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage disallow\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/rancher/apiserver/pkg/types\"\n\t\"github.com/rancher/steve/pkg/attributes\"\n\tschema2 \"github.com/rancher/steve/pkg/schema\"\n\tsteve \"github.com/rancher/steve/pkg/server\"\n)\n... | go | edit | 0 | 5 | apache-2.0 | b26e68448477f305937ab21a62806042d933130a | rancher/rancher,rancher/rancher,rancher/rancher,rancher/rancher | pkg/api/steve/disallow/disallow.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\ntype Map struct {\n\tNode struct {\n\t\tServerList string `json:\"serverList\"`\n\t\tLuxMap string `json:\"luxMap\"`\n\t} `json:\"nodes\"`\n}\n\nfunc Con... | go | edit | 6 | 2 | apache-2.0 | 9f90cacd5f6aabe4dd2ec87773cdaac1cd6593d0 | maniktaneja/luxstor | clusterclient/client.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"github.com/lxc/lxd/shared/api\"\n)\n\n// Config represents the config of a backup that can be stored in a backup.yaml file (or embedded in index.yaml).\ntype Config struct {\n\tContainer *api.Instance ... | go | edit | 0 | 0 | apache-2.0 | dc06ba8b658dad07bd0570ba180b7a0e5c75597d | stgraber/lxd,stgraber/lxd,lxc/lxd,lxc/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd,lxc/lxd,stgraber/lxd,lxc/lxd,stgraber/lxd,stgraber/lxd,lxc/lxd | lxd/backup/config/backup_config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Println(\"BTSOOT - Copyright (C) 2016-2017 Paul Kramme\")\n}\n```\n\nApply this change: Add config writer, add and rm"
},
{
"role": "assistant",
"content": "package main\n\nimpo... | go | edit | 3 | 12 | bsd-3-clause | bcc23ea44b860a4ab0b284bfd1c88f6b5206dab4 | paulkramme/btsoot | btsoot.go | rejected_complexity | Cyclomatic complexity too high: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage geocodio\n\nimport \"errors\"\n\nvar (\n\t// ErrReverseGecodeMissingLatLng error when a lat/lng is not provided\n\tErrReverseGecodeMissingLatLng = errors.New(\"Latitude and longitude must not be empty\")\n)\n\n```\n\nApply this change: ... | go | edit | 0 | 0 | mit | 0ebe799d77dbd23f451c48c10a449cebe0eee8b4 | stevepartridge/geocodio | errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\n/*\nCopyright 2015 Google Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License ... | go | edit | 0 | 2 | apache-2.0 | 68f22a40f30279005d260ba38590e32a0eff01be | bnprss/kubernetes,zgutterm/kubernetes,ihmccreery/kubernetes,eparis/kubernetes,jfrazelle/kubernetes,ymqytw/kubernetes,rubenv/kubernetes,sbusso/kubernetes,chbatey/kubernetes,Rotwang/kubernetes,micmro/kubernetes,calebamiles/kubernetes,philips/kubernetes,rubenv/kubernetes,nicksardo/kubernetes,amos6224/kubernetes,abdokh/kub... | pkg/kubelet/root_context_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build builtin_assets\n\npackage main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"path\"\n\t\"strings\"\n)\n\nfunc (w *httpWorker) httpHandleAsset(ctx context.Context, rw http.ResponseWriter, r *http.Request) {\n\tvar (\n\t\tisDefault bo... | go | edit | 12 | 9 | bsd-3-clause | cea33d4afe00f40d2096e03b1206c2267f08318b | facette/facette,facette/facette,facette/facette,facette/facette | src/cmd/facette/http_asset_builtin.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main \n\nimport (\n\tess \"github.com/eris-ltd/erisdb/erisdb/erisdbss\"\n\t\"github.com/eris-ltd/erisdb/server\"\n\t\"os\"\n\t\"github.com/gin-gonic/gin\"\n)\n\nfunc main() {\n\tgin.SetMode(gin.ReleaseMode)\n\n\tbaseDir := os.Getenv(\"H... | go | edit | 0 | 2 | apache-2.0 | 9608a88347f547e8ba767ad34f24b5fd61688eae | benjaminbollen/eris-db,eris-ltd/eris-db,benjaminbollen/burrow,eris-ltd/eris-db,silasdavis/burrow,benjaminbollen/burrow,benjaminbollen/eris-db,silasdavis/burrow,silasdavis/burrow | cmd/erisdbss/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"net/http\"\n \"strings\"\n)\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n proc := sh(\"/usr/local/letsencrypt/letsencrypt.sh %s 2>&1\", strings.Split(r.Header[\"Host\"][0], \":\")[0])\n ... | go | edit | 3 | 1 | mit | 8fe85e1d20b1777319721d009d0b5806c068c34d | appuio/acme-tiny,appuio/acme-tiny,appuio/acme-tiny | docker/letsencrypt.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage turtle\n\n// Emojis maps a name to an Emoji\nvar Emojis = make(map[string]*Emoji)\n\nfunc init() {\n\tfor _, e := range emojis {\n\t\tEmojis[e.Name] = e\n\t}\n}\n\n// Search emojis by a name\nfunc Search(s string) []*Emoji {\n\treturn s... | go | edit | 21 | 2 | mit | af6e3fcc9cc86f7c515a264caab860342abbfd4c | hackebrot/turtle | turtle.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\n// START OMIT\ntype Pet interface { // HL\n\tName() string // HL\n\tFavoriteToy() string // HL\n}\n\ntype Dog struct { // Implicitly a Pet because it fulfills the interface\n\tname string\n\tfavor... | go | edit | 0 | 1 | mit | 8916fc42155b55de7f4501e99013ff371fd2509f | CodyOss/presentations | ready-set-go/code/methods-interfaces.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage elasti_cache\n\nimport (\n\t\"github.com/jagregory/cfval/constraints\"\n\t. \"github.com/jagregory/cfval/schema\"\n)\n\n// see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticache-subnetgroup.html\nf... | go | edit | 24 | 1 | mit | c00a1bcc5a247f7023c63f515d2dcfe61fa1131d | jagregory/cfval,jagregory/cfval | resources/elasti_cache/subnet_group.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/octavore/ketchup/proto/ketchup/models\"\n)\n\nfunc TestSort(t *testing.T) {\n\tnow := time.Now()\n\tnowUnix := now.Unix()\n\tnowPlus1 := now.Add(time.Minute).Unix()\n\tnowPlus2... | go | edit | 6 | 5 | apache-2.0 | 6e8b09c3ed5d58aa3cb8fbbce0b310381055bae1 | ketchuphq/ketchup,ketchuphq/ketchup,ketchuphq/ketchup,ketchuphq/ketchup,ketchuphq/ketchup | db/sort_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 Chadev. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"math/rand\"\n\n\t\"github.com/danryan/hal\"\n)\n\nvar tabl... | go | edit | 3 | 0 | bsd-3-clause | c0e4aa0397cca1ee086c30455f33f0350738b711 | chadev/Chadev_ircbot | emotes.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fuse\n\nfunc (ms *MountState) systemWrite(req *request, header []byte) Status {\n\tif req.flatDataSize() == 0 {\n\t\t_, err := ms.mountFile.Write(header)\n\t\treturn ToStatus(err)\n\t}\n\n\tif req.fdData != nil {\n\t\tsz := req.flatData... | go | edit | 15 | 4 | mit | c24ef376c36eb95217fa8967f18f7d18c7639643 | cmars/tools,keybase/go-fuse,cmars/tools,cmars/tools,cmars/tools,keybase/go-fuse,keybase/go-fuse | fuse/mountstate_darwin.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage migrations\n\nimport (\n\t\"github.com/GeertJohan/go.rice\"\n\t\"github.com/mattes/migrate\"\n\t\"github.com/pkg/errors\"\n\t// Enable PostgreSQL driver for migration tool\n\t_ \"github.com/mattes/migrate/database/postgres\"\n\t// Enabl... | go | edit | 0 | 5 | mit | 3f90026f236689c714f7f601f8d50fd186695829 | diyan/assimilator,diyan/assimilator,diyan/assimilator | migrations/migrations.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage aliyunecs\n\nconst autoFdiskScript = `#/bin/bash\n#fdisk ,formating and create the file system on /dev/xvdb or /dev/vdb\nDISK_ATTACH_POINT=\"/dev/xvdb\"\nfdisk_fun()\n{\nfdisk -S 56 \\$DISK_ATTACH_POINT << EOF\nn\np\n1\n\n\nwq\nEOF\n\ns... | go | edit | 0 | 0 | apache-2.0 | cd1d566d9222012675173bdef9d15a56f42b85aa | denverdino/docker-machine-driver-aliyunecs,denverdino/docker-machine-driver-aliyunecs | aliyunecs/auto_fdisk.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\ntype positionalParameters struct {\n\tparameters []string\n\trest string\n}\n\nfunc (ps positionalParameters) arity() int {\n\tn := len(ps.parameters)\n\n\tif ps.rest != \"\" {\n\t\tn++\n\t}\n\n\treturn n\n}\n\nfunc (ps po... | go | edit | 9 | 4 | mit | 6468fca0b7a5e37d073747fdd59552723abe5c60 | raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp,tisp-lang/tisp,raviqqe/tisp | src/lib/core/positional_parameters.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logrus_papertrail\n\nimport (\n\t\"net\"\n\t\"testing\"\n\n\t\"github.com/Sirupsen/logrus\"\n)\n\nfunc TestWritingToUDP(t *testing.T) {\n\tlog := logrus.New()\n\tport := 16661\n\n\taddr := net.UDPAddr{\n\t\tPort: port,\n\t\tIP: net.Pa... | go | edit | 9 | 2 | mit | 51770fb4eb7a407cacc5e0f04624bb45261f964b | chendrak/logrus,orvice/logrus,henrylee2cn/logrus,brandur/logrus,HideoYamauchi/logrus,sirupsen/logrus,marcosnils/logrus,Arkan/logrus,akutz/logrus,Invacio/logrus,ryanfaerman/logrus,snowsnail/logrus,dradtke/logrus,rfsbraz/logrus,lixin9311/logrus,Barberrrry/logrus,cgag/logrus,hvnsweeting/logrus,therealbill/logrus,penhauer-... | hooks/papertrail/papertrail_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// (c) Copyright IBM Corp. 2021\n// (c) Copyright Instana Inc. 2016\n\n// +build go1.12\n\npackage instamux\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gorilla/mux\"\n\tinstana \"github.com/instana/go-sensor\"\n)\n\n// AddMiddleware instrumen... | go | edit | 0 | 2 | mit | 35ad8575de80c34828b580b7eafaf0573924fca4 | instana/golang-sensor,instana/golang-sensor | instrumentation/instamux/handler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mysqlproto\n\nimport (\n\t\"io\"\n)\n\ntype Conn struct {\n\t*Stream\n\tCapabilityFlags uint32\n}\n\nfunc Handshake(rw io.ReadWriteCloser, capabilityFlags uint32,\n\tusername, password, database string,\n\tconnectAttrs map[string]string... | go | edit | 24 | 5 | mit | dde2be46ed77e632e51dc6a6d636b373e15c5cbc | pubnative/mysqlproto-go | conn.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n)\n\nfunc grep(pattern string, infile *os.File) {\n\tscanner := bufio.NewScanner(infile)\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\t\tmatched, err := regexp.M... | go | edit | 0 | 5 | mit | b4dc25dc8230f14349832bbfd92e958672f1a548 | mirakui/hello_world,mirakui/hello_world,mirakui/hello_world,mirakui/hello_world,mirakui/hello_world,mirakui/hello_world | go/grep.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"os\"\n\t\"os/user\"\n)\n\n/*GetUserHomeDir returns the home directory of the current user.\n */\nfunc GetUserHomeDir() string {\n\tusr, err := user.Current()\n\t// If the current user cannot be reached, get the HO... | go | edit | 0 | 3 | mit | 83e1d592ce80c034cccd7c8443b642f3fbd09ed5 | k0pernicus/goyave | utils/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hammock\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/mikebell-org/go-couchdb\"\n)\n\ntype CouchDB struct {\n\tcouchdb.CouchDB\n}\n\nfunc Database(host, database, username, password string) (*CouchDB, error) {\n\n\tdb, err := couchdb.Databas... | go | edit | 18 | 7 | isc | c55cb7cbb35199ed596ec4a3456e05e430202fea | ramdayan/hammock,leeor/hammock | hammock.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gorduino\n\nimport (\n\t\"github.com/kraman/go-firmata\"\n)\n\ntype Gorduino struct {\n\tpins map[byte]bool\n\tclient *firmata.FirmataClient\n\twork func()\n}\n\nfunc NewGorduino(port string, pins ...byte) *Gorduino {\n\tg := new(Go... | go | edit | 15 | 3 | mit | 5dab011ec52c8ff11468861f5f632359ecc53bb7 | yanzay/gorduino | gorduino.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage options\n\nimport (\n\t\"github.com/spf13/pflag\"\n)\n\ntype Config struct {\n\tMaster string\n\tKubeConfig string\n}\n\nfunc NewConfig() *Config {\n\treturn &Config{\n\t\tMaster: \"127.0.0.1:8080\",\n\t\tKubeConfig: \"\",\n\t}\... | go | edit | 0 | 1 | apache-2.0 | 6b9db4dd9ef4c612a0e436faad992ad7e860c074 | appscode/searchlight,appscode/searchlight,searchlight/searchlight,appscode/searchlight,searchlight/searchlight,searchlight/searchlight,searchlight/searchlight,appscode/searchlight | cmd/searchlight/app/options/options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage restic\n\nimport (\n\t\"log\"\n\t\"net\"\n\t\"os\"\n)\n\n// Addr implements net.Addr for stdin/stdout.\ntype Addr struct{}\n\n// Network returns the network type as a string.\nfunc (a Addr) Network() string {\n\treturn \"stdio\"\n}\n\nf... | go | edit | 0 | 2 | mit | 84776c4e432013fb267fb5084740be416116e699 | olihey/rclone,yonjah/rclone,seuffert/rclone,B4dM4n/rclone,B4dM4n/rclone,B4dM4n/rclone,olihey/rclone,B4dM4n/rclone,ncw/rclone,seuffert/rclone,seuffert/rclone,ncw/rclone,olihey/rclone,yonjah/rclone,olihey/rclone,yonjah/rclone,ncw/rclone,ncw/rclone,seuffert/rclone,yonjah/rclone | cmd/serve/restic/stdio_conn.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage harness\n\nimport (\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/prometheus/client_golang/prometheus\"\n)\n\ntype MetricRegistry struct {\n\tmetrics map[string]prometheus.Collector\n}\n\nfunc newRegistry() *MetricRegistry {\n\t... | go | edit | 0 | 3 | mit | 5052db96f57ac2f4d3fc3a021374a43cf71ca625 | kawamuray/prometheus-exporter-harness,kawamuray/prometheus-exporter-harness | harness/registry.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"github.com/itsankoff/gotcha/server\"\n\t\"log\"\n)\n\nfunc main() {\n\tconfig := server.NewConfig()\n\tflag.StringVar(&config.ListenHost, \"host\",\n\t\t\"0.0.0.0:9000\", \"host to listen\")\n\n\tflag.S... | go | edit | 0 | 2 | mit | 276642a2aa4fd5b3c55f929c886f1172952266aa | itsankoff/gotcha,itsankoff/gotcha | cmd/server/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage game\n\nimport (\n\t\"time\"\n\n\t\"github.com/Bredgren/geo\"\n)\n\ntype playerCameraTarget struct {\n\tg *Game\n\tp *player\n\toffset geo.Vec\n\tpos geo.Vec\n}\n\nfunc newPlayerCameraTarget(g *Game, p *player, screenHeight... | go | edit | 15 | 3 | mit | 4b6c57d7472502045f2c9795b9cac0f8c8e426e7 | Bredgren/game1 | game/cameratarget.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dev\n\nimport (\n\t\"crypto/tls\"\n\t\"net/http\"\n\t\"puma/httputil\"\n\t\"time\"\n)\n\nfunc (h *HTTPServer) ServeTLS() error {\n\tproxy := &httputil.ReverseProxy{\n\t\tDirector: h.director,\n\t\tTransport: h.transport,\n\t\tF... | go | edit | 9 | 1 | bsd-3-clause | a8021bd3a2d4380c189b4d3bcc23a3cc61364ea0 | attilagyorffy/puma-dev,puma/puma-dev,attilagyorffy/puma-dev,puma/puma-dev,puma/puma-dev,attilagyorffy/puma-dev,puma/puma-dev,attilagyorffy/puma-dev | src/puma/dev/http_linux.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\"log\"\n\t\"os\"\n\n\t\"github.com/joho/godotenv\"\n\t\"github.com/labstack/echo\"\n\t\"github.com/labstack/echo/engine/standard\"\n\t\"github.com/labstack/echo/middleware\"\n)\n\nfunc init() {\n\terr := godotenv.Lo... | go | edit | 21 | 2 | mit | 3b047c3778265bc35448c42bc01e729d20bd69b7 | shamsher31/stay-motivated-server | server.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"time\"\n)\n\nfunc loggingMiddleware(next http.Handler) http.Handler {\n\tfn := func(w http.ResponseWriter, r *http.Request) {\n\t\tt1 := time.Now()\n\t\tnext.ServeHTTP(w, r)\n\... | go | edit | 0 | 2 | mit | b34576544df533ed39e2d3cfa985ab57da5ff5fd | achiku/wbs | example/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage trash\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\n// TODO: Use better type than string.\nfunc MoveToTrash(name string) error {\n\tname = filepath.Clean(name)\n\thome := os.Getenv(\"HOME\")\n\t_, file := filepath.Split(name)\n\ttarg... | go | edit | 0 | 6 | mit | f538fcc774dd1fe1b03b293c4b5c8b313d4de98c | shurcooL/go | trash/main_darwin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage weedharvester\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\ntype master struct {\n\turl string\n}\ntype assignment struct {\n\tCount int `json:\"count\"`\n\tFid string `json:\"fid\"`\n\t... | go | edit | 3 | 2 | mit | 4d09eb5bb09fab28752690f0074e38ec2bef8ac4 | ChristianNorbertBraun/Weedharvester | master.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2021 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 | 2 | apache-2.0 | db4832193293a6ab1bf2e65bc3db8acd73eba5e9 | kubernetes/release,kubernetes/release | pkg/kubecross/impl.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jsonconfig\n\nimport (\n\t\"io\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"os\"\n)\n\n// Parser must implement ParseJSON\ntype Parser interface {\n\tParseJSON([]byte) error\n}\n\n// Load the JSON config file\nfunc Load(configFile string, p Parse... | go | edit | 3 | 5 | mit | aa26a18643c3fb0faa064d7d574e437c6fe72caf | josephspurrier/gowebapp,josephspurrier/gowebapp | vendor/app/shared/jsonconfig/jsonconfig.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rel\n\ntype Windower interface {\n\tOver(Visitable) *OverNode\n\tVisitable\n}\n\nfunc windowPredicationOver(node Windower, visitable Visitable) *OverNode {\n\treturn &OverNode{\n\t\tLeft: node,\n\t\tRight: visitable,\n\t}\n}\n\n```\n\n... | go | edit | 12 | 1 | mit | fd7fb4596447d5b9671b9ab55b0e2b957373dbcc | aackerman/rel | window_predications.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc handler(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"Hi there, I love %s!\\n\", r.URL.Path[1:])\n}\n\nfunc main() {\n\thttp.HandleFunc(\"/\", handler)\n\... | go | edit | 0 | 1 | apache-2.0 | 52545b15771e32abc1568a8b582dc59eb55269fc | GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold | examples/no-manifest/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// leftpad.go\n\n/*\n This package implements the leftpad function, inspired by the NPM (JS)\n package of the same name.\n\n Two functions are defined:\n\n import \"leftpad\"\n\n\t // pad with spacex\n str, err := LeftPad(s, n)\n\n ... | go | edit | 0 | 4 | bsd-2-clause | c32047e462c79ebcc95381ef9e76e8b54fa55d38 | keltia/leftpad | leftpad.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n//go:generate $GOPATH/bin/ego -o templates/ego.go -package=template templates\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc main() {\n\thandler, err := OpenHandlerFromEnv()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\... | go | edit | 3 | 3 | bsd-3-clause | 1345e228b60c4cde2f32d5e1c79aec7c362c5fad | Draal/secure-share,Draal/secure-share,Draal/secure-share | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage html\n\nimport (\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/lib/format\"\n\t\"io\"\n\t\"runtime\"\n\t\"syscall\"\n\t\"time\"\n)\n\nvar startTime time.Time = time.Now()\n\nfunc writeHeader(writer io.Writer) {\n\tfmt.Fprintf(writer, \"... | go | edit | 0 | 1 | apache-2.0 | c3b5a59ca652a7b3cf74c4c29a15d2fb7576da4c | keep94/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator | lib/html/header.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/jzelinskie/geddit\"\n\t\"github.com/nlopes/slack\"\n\t\"io/ioutil\"\n)\n\nfunc getSlackToken() string {\n\tdat, err := ioutil.ReadFile(\"slack-token\")\n\tif err != nil {\n\t\tfmt.Println(\"Ca... | go | edit | 0 | 2 | mit | 67e8f95d6ac103a5de16336197624a0a1a71ff51 | mgadzhi/slack-pechkin,mgadzhi/slack-pechkin | pechkin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"net\"\n)\n\nfunc main() {\n\tflag.Parse()\n\thostname := flag.Arg(0)\n\n\taddr, _ := net.LookupHost(hostname)\n\tfor _, v := range addr {\n\t\tptrAddr, _ := net.LookupAddr(v)\n\t\tprintln(v, \"->\", ptr... | go | edit | 0 | 3 | mit | 9ae07df1524e4af7e1832006f6dd28f86db947cc | itochan/ptrhost | ptrhost.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nvar ParseKeysListTests = []struct {\n\tlist string\n\tkeys []string\n}{\n\t// normal\n\t{`host`, []string{`host`}},\n\t{`host,status`, []string{`host`, `status`}},\n\t{`host,status,si... | go | edit | 0 | 3 | mit | 7f558b54b95d2ee38d0e0331b6c80b93c41ffc4e | kusabashira/ltsvp | parts_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scout\n\nimport (\n\t\"context\"\n\t\"strings\"\n\n\t\"github.com/datawire/dlib/dexec\"\n\t\"github.com/datawire/dlib/dlog\"\n)\n\nfunc runSwVers(ctx context.Context, versionName string) string {\n\tcmd := dexec.CommandContext(ctx, \"sw... | go | edit | 0 | 7 | apache-2.0 | 7fb2b903bdcbeac4c99c1c55496544e6db2fc040 | datawire/telepresence,datawire/telepresence,datawire/telepresence | pkg/client/scout/os_metadata_darwin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/hashicorp/terraform/helper/schema\"\n\t\"github.com/keybase/go-keychain\"\n\t\"log\"\n\t\"runtime\"\n)\n\nfunc passwordRetrievalFunc(env_var string, dv interface{}) schema.SchemaDefaultFunc {\n\treturn f... | go | edit | 9 | 3 | mit | 74b7a4645ee242217061bb3233b90e6d126cff15 | Cox-Automotive/terraform-provider-alks | password_darwin.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\"github.com/levigross/grequests\"\n\t\"github.com/ryanskidmore/GoWork\"\n\t\"strings\"\n)\n\nfunc main() {\n\tresponse, err := grequests.Get(\"http://127.0.0.1:3000/register\", nil)\n\tif err != nil {\n\t... | go | edit | 3 | 3 | mit | 8b9c7962dce59ff75a58d969003105fb9cc0bcd7 | ryanskidmore/GoWork | example/client/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Marcel Gotsch. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE file.\n\npackage goserv\n\nimport (\n\t\"net/http\"\n)\n\n// A Request represents an HTTP ... | go | edit | 9 | 2 | bsd-3-clause | 255d2e7c71a9812127ab3bef421397d1815576ba | gotschmarcel/goserv | request.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dockerit\n\nimport (\n\t\"testing\"\n\n\t\"github.com/vdemeester/libkermit/docker\"\n)\n\nfunc TestCreateSimple(t *testing.T) {\n\tsetupTest(t)\n\n\tcontainer, err := docker.Create(\"busybox\")\n\n\tif err != nil {\n\t\tt.Fatalf(\"expec... | go | edit | 6 | 5 | apache-2.0 | 14603b31771e091ac8e33418099ff3d276072aba | libkermit/docker,libkermit/docker | integration/docker/simple_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gform\n\nimport (\n\t\"github.com/AllenDang/w32\"\n)\n\ntype MouseEventData struct {\n X, Y int\n Button int\n Wheel int\n}\n\ntype DropFilesEventData struct {\n X, Y int\n\tFiles []string\n}\n\ntype PaintEventData struc... | go | edit | 3 | 0 | bsd-3-clause | 97b1465c0e45ba551b3c9281befe531ce76fa257 | AllenDang/gform,AllenDang/gform,AllenDang/gform | eventdata.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\t\"os\"\n\n\t\"github.com/bmizerany/pat\"\n\t\"github.com/codegangsta/negroni\"\n\t\"github.com/meatballhat/negroni-logrus\"\n\t\"github.com/unrolled/render\"\n)\n\nfunc main() {\n\tm :... | go | edit | 3 | 2 | mit | 4116ae5c57c6126be0fb95ae364707b76990b8c3 | mattbostock/leavediary | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"runtime\"\n\n\t\"github.com/datawire/ambassador/pkg/supervisor\"\n)\n\nvar notifyRAI *RunAsInfo\n\n// Notify displays a desktop banner notification to the user\nfunc Notify(p *supervisor.Process, message... | go | edit | 9 | 7 | apache-2.0 | 7342707271db0551820b099d5a59ecdf5f006490 | datawire/telepresence,datawire/telepresence,datawire/telepresence | cmd/edgectl/notify.go | rejected_lint | Too many lint violations: 9 | 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\n\t\"testing\"\n)\n\nfunc TestGithubReviewHelper(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tRunSpecs(t, \"GithubReviewHelper Suite\")\n}\n\n```... | go | edit | 6 | 1 | mit | b05270237e0b901a999fefd83202f32f19ffb6e4 | salemove/github-review-helper | github_review_helper_suite_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"os\"\n\t\"os/user\"\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestNormalizingHomeDirectories(t *testing.T) {\n\tt.Parallel()\n\n\tusr, err := user.Current()\n\tasse... | go | edit | 9 | 1 | mit | 63d40da3dd1acbccea4d137e43a4d3a6452500c8 | buildkite/agent,buildkite/agent,buildkite/agent | utils/path_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage yara\n\nimport (\n\t\"testing\"\n)\n\nfunc setupCompiler(t *testing.T) *Compiler {\n\tc, err := NewCompiler()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tc.SetIncludeCallback(func(name, rulefile, namespace string) []byte {\n\t\tt.Logf(... | go | edit | 6 | 4 | bsd-2-clause | 06cb178a1778b165d092e6d59be7c18a090e6e44 | hillu/go-yara,VirusTotal/go-yara,hillu/go-yara | compiler_yara37_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n\t\"testing\"\n\n\t\"github.com/chromium/hstspreload.appspot.com/database\"\n)\n\nfunc TestCheckConnection(t *testing.T) {\n\tms := database.MockState{}\n\ta := API{database.Mock{State: &ms}}\n\tif err := a.CheckConnect... | go | edit | 6 | 5 | bsd-3-clause | 48cd473c79811d04012b188978b9f007f0830d88 | chromium/hstspreload.org,chromium/hstspreload.org,chromium/hstspreload.org,chromium/hstspreload.org | api/api_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build builtin_assets\n\npackage main\n\nimport (\n\t\"context\"\n\t\"net/http\"\n\t\"path\"\n\t\"path/filepath\"\n\t\"strings\"\n)\n\nconst (\n\thttpDefaultPath = \"html/index.html\"\n)\n\nfunc (w *httpWorker) httpHandleAsset(ctx context.Co... | go | edit | 6 | 7 | bsd-3-clause | efe9f2bce5cba90966308450131b836bb0b96e41 | facette/facette,facette/facette,facette/facette,facette/facette | src/cmd/facette/http_asset_builtin.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\"strings\"\n\n\t\"github.com/PuerkitoBio/goquery\"\n)\n\ntype user struct {\n\tname string\n\temail string\n\turl string\n\tusername string\n}\n\nfunc main() {\n\turl :=... | go | edit | 0 | 5 | mit | c74cb7335034012dbe1f103602f076d6953f6e3e | sergiotapia/gophers,timchunght/gophers | gophers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clcgo\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n)\n\ntype DataCenters struct {\n\tDataCenters []DataCenter\n}\n\ntype DataCenter struct {\n\tID string\n\tName string\n}\n\nconst DataCentersURL = APIRoot + \"/datacente... | go | edit | 3 | 2 | apache-2.0 | c6527dfa5a3387affea0b9292ef8af59ddf01042 | rupakg/clcgo,CenturyLinkLabs/clcgo | datacenters.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage waitfor\n\nimport (\n\t\"errors\"\n\t\"time\"\n\n\t\"golang.org/x/net/context\"\n)\n\nvar ErrTimeoutExceeded = errors.New(\"timeout exceeded\")\n\ntype Check func() bool\n\nfunc ConditionWithTimeout(condition Check, interval, timeout ti... | go | edit | 0 | 6 | apache-2.0 | 274e8fe341a0b9490956372edb42cf2bcad09560 | st3v/waitfor | waitfor.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/sclevine/agouti\"\n\t. \"github.com/sclevine/agouti/dsl\"\n\t. \"github.com/sclevine/agouti/matchers\"\n)\n\nvar _ = Feature(\"... | go | edit | 12 | 1 | mit | 28bb2868658c4649caac3b303a4a8a97c590d809 | Etienne42/agouti,abourget/agouti,abourget/agouti,sclevine/agouti,sclevine/agouti,Etienne42/agouti | internal/integration/conflicts_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage messagebirdtest\n\nimport (\n\t\"net/http\"\n\t\"net/http/httptest\"\n\t\"os\"\n\t\"testing\"\n)\n\nvar server *httptest.Server\n\nvar responseBody []byte\nvar status int\n\n// EnableServer starts a fake server, runs the test and closes... | go | edit | 0 | 2 | bsd-2-clause | 9c4d302a3db5e12e283447431d72c8d46d671f52 | messagebird/go-rest-api | internal/messagebirdtest/test_server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tenv := &environment{\n\t\tvalues: map[object]object{\n\t\t\tscmSymbol(\"true\"): TRUE,\n\t\t\tscmSymbol(\"false\"): FALSE,\n\t\t},\n\t}\n\n\tfor _, proc := range makePrimitiv... | go | edit | 30 | 4 | mit | 8b8058cd5ecee3492e2300c6595765f5b34affd4 | bernerdschaefer/sgheme | main.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 Chris McGee <<EMAIL>>. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage main\n\nimport(\n\t\"fmt\"\n\t\"os/exec\"\n)... | go | edit | 0 | 2 | bsd-2-clause | 1fde712fbc41aa9c056dc00b943b540246e61405 | sirnewton01/godbg,sirnewton01/godbg,albfan/godbg,albfan/godbg,albfan/godbg,sirnewton01/godbg | openbrowser_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage statsd\n\nimport (\n\t\"io\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\ntype statsdWriterWrapper struct {\n\tio.WriteCloser\n}\n\nfunc (statsdWriterWrapper) SetWriteTimeout(time.Duration) error {\n\tret... | go | edit | 12 | 2 | mit | 8a0765e9faa143e435dd2c54ea7eb870276fb966 | DataDog/datadog-go | statsd/statsd_test.go | rejected_lint | Too many lint violations: 12 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.