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 format\n\nimport (\n\t\"testing\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestSsh(t *testing.T) {\n\tlog.SetLevel(log.DebugLevel)\n\n\tkeys := map[string][]string{\n\t\t\"ernoaapa\"... | go | edit | 3 | 1 | apache-2.0 | f2d2387cdc7f66706bd27c5b5fdd3f697d0ca592 | arnested/fetch-ssh-keys,ernoaapa/fetch-ssh-keys | format/ssh_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage isolated\n\nimport (\n\thelpers \"code.cloudfoundry.org/cli/integration/helpers\"\n\t\"code.cloudfoundry.org/cli/util/configv3\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Config\", func() {... | go | edit | 0 | 1 | apache-2.0 | 4b8ffdd6bf963a376e659dcf415036d24516abaa | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | integration/v7/isolated/config_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nfunc main() {\n for {\n spin()\n }\n}\n\nfunc spin() {\n sum := 0\n for i:=0;i<9999999;i++ {\n sum += i\n sum -= i\n }\n}\n\n```\n\nApply this change: Add new spinner go app."
},
{
"ro... | go | edit | 0 | 2 | mit | 181e07d329617cc3d30f8dc1d1a56fb830b584d4 | brianrob/coretests,brianrob/coretests | go/spinner/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cf_http\n\nimport (\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\nvar config Config\n\ntype Config struct {\n\tTimeout time.Duration\n}\n\nfunc Initialize(timeout time.Duration) {\n\tconfig.Timeout = timeout\n}\n\nfunc NewClient() *http.... | go | edit | 0 | 5 | apache-2.0 | 428f6839ba6b1707e80289c611c8f50f1fee2fee | cloudfoundry-incubator/cf_http,cloudfoundry-incubator/cf_http | cf_http.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage parser\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"testing\"\n)\n\nfunc TestParser(t *testing.T) {\n\tr, err := os.Open(\"monitor\")\n\tif err != nil {\n\t\tt.Error(err)\n\t}\n\tbr := bufio.NewReader(r)\n\tbd := NewBabelDesc()\n\... | go | edit | 3 | 6 | mit | fbc019dd4b60a6b81eccc35a9e2f0f357d293d53 | Vivena/babelweb2,Vivena/babelweb2,Vivena/babelweb2 | parser/parser_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stdin\n\nimport (\n\t\"os\"\n)\n\n// This is a tricky problem and we have gone through several iterations before\n// settling on something that works well for recent golang across windows,\n// linux and macos.\n\nfunc IsReadable() bool ... | go | edit | 0 | 3 | mit | af173743ca07a1d343abe50384378f9155b6a273 | buildkite/agent,buildkite/agent,buildkite/agent | stdin/stdin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\ntype Result struct {\n\tDomain string\n\tAvailability string\n}\n\ntype SearchResults struct {\n\tQuery string\n\tResul... | go | edit | 0 | 6 | mit | d5b7459350339706599f3cbf2375399e181a7180 | nwjlyons/domainr | domainr.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net\"\n)\n\nfunc StartServer() {\n\tlistener, err := net.Listen(\"tcp\", Config.String(\"listen\"))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer listener.Close()\n\tfor {\n\t\tconn, err := listen... | go | edit | 21 | 9 | mit | 3d24c0529c8fdb5abebaade72859f7dc0e903262 | PolyFloyd/ledcubesim,PolyFloyd/ledcubesim,PolyFloyd/ledcubesim | server.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage router\n\nimport (\n\t\"github.com/micro/go-micro/v2/api/resolver\"\n\t\"github.com/micro/go-micro/v2/registry\"\n)\n\ntype Options struct {\n\tHandler string\n\tRegistry registry.Registry\n\tResolver resolver.Resolver\n}\n\ntype Optio... | go | edit | 0 | 3 | apache-2.0 | 27eb7db1c2a947f706dabd967427ffc137c62efc | myodc/go-micro,micro/go-micro | api/router/options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"html/template\"\nimport \"log\"\nimport \"net/http\"\nimport \"time\"\n\nimport \"github.com/stianeikeland/go-rpio\"\n\nconst GPIOPin = 18\nconst DelaySeconds = 5\n\ntype gpioHandler struct {\n pin rpio.Pin\n}\n\nfunc ... | go | edit | 9 | 2 | apache-2.0 | e4fef29dc95c0964573c0bbc19ad2d916ba9b399 | hatstand/hodoor,hatstand/hodoor,hatstand/hodoor | main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/hashicorp/terraform/plugin\"\n\t\"github.com/finn-no/terraform-provider-softlayer/softlayer\"\n)\n\nfunc main() {\n plugin.Serve(&plugin.ServeOpts{\n ProviderFunc: softlayer.Provider,\n })... | go | edit | 0 | 1 | apache-2.0 | 49a19bb69b8f2573ba6630f5e9b564d304d51536 | TheWeatherCompany/terraform-provider-softlayer,finn-no/terraform-provider-softlayer | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cli\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/jwaldrip/odin/cli/values\"\n)\n\n// Flag returns the Value interface to the value of the named flag,\n// returning nil if none exists.\nfunc (cmd *CLI) Flag(name string) values.Value {\n\tfla... | go | edit | 9 | 5 | mit | 7db07de599f0cdcccfa3a5d7a788d312e378b9dc | jwaldrip/odin | cli/flag_access.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/exec\"\n)\n\nfunc lastlog() (string, error) {\n\tusers, err := exec.Command(\"/usr/bin/lastlog\", \"--time\", \"365\").Output()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn string(users), nil... | go | edit | 3 | 3 | mit | 8664658f225982cd152f042af61656129a17105d | adelq/go-dash | lastlog.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fnlog_test\n\nimport (\n\t\"github.com/northbright/fnlog\"\n\t\"log\"\n)\n\nfunc Example() {\n\tiLog := fnlog.New(\"i\")\n\twLog := fnlog.New(\"w\")\n\teLog := fnlog.New(\"e\")\n\tvar noTagLog *log.Logger = fnlog.New(\"\")\n\n\tiLog.Pri... | go | edit | 0 | 1 | mit | 9db7454fda81b60e657c026ffe0fcfaa517e6053 | vonwenm/fnlog | unit_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage shell\n\nimport (\n\t\"github.com/codegangsta/cli\"\n\t\"strings\"\n)\n\nfunc SetUp() cli.Command {\n\tcmd := cli.Command{\n\t\tName: \"shell\",\n\t\tUsage: \"BQL shell\",\n\t\tAction: Launch,\n\t}\n\tcmd.Flags = []cli.Flag{\n\t\tcli... | go | edit | 12 | 4 | mit | bf739142c88471b434526a898bc32737399aa043 | sensorbee/sensorbee,sensorbee/sensorbee | cmd/lib/shell/cmd_line_tool.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2018 The gVisor 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 | 9 | 1 | apache-2.0 | e975184bc50944e82a6bf5f4c57bbe970933fdc5 | google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor,google/gvisor | runsc/fsgofer/filter/filter.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gowrapmx4j\n\nimport \"sync\"\n\nvar registry = make(map[string]*MX4JMetric)\nvar reglock = &sync.RWMutex{}\n\nfunc RegistrySet(mm MX4JMetric, mb *MBean) {\n\treglock.Lock()\n\tdefer reglock.Unlock()\n\n\tmm.MBean = mb\n\tregistry[mm.Hu... | go | edit | 0 | 2 | apache-2.0 | f139d4b750a622b558a5d06d8b8b2ef24da1a600 | lytics/gowrapmx4j | src/registry.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 Google Inc.\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.apa... | go | edit | 6 | 1 | apache-2.0 | 36e09e4c2d209dfbc91cd8879f71b171bbf50b64 | google/fleetspeak,google/fleetspeak,google/fleetspeak | fleetspeak/src/server/internal/ftime/retry.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\"github.com/reveliant/dirtyci/server\"\n)\n\nfunc main() {\n\tvar mode = \"release\"\n\tvar help = flag.Bool(\"h\", false, \"Show this help message\")\n\tvar debug = flag.Bool(\"d\", false, \"Enable debu... | go | edit | 0 | 3 | mit | 68bf3fd4628479fc945a6f97e8bb7d9652d7df6e | reveliant/dirty-ci | dirtyci.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"net\"\n\ntype SessionManager struct {\n\tallSessions []Session\n}\n\nfunc (s *SessionManager) StartSession(conn *net.Conn) {\n\tvar ses Session\n\n\tses.Init(conn, s)\n}\n\n```\n\nApply this change: Send request to all ... | go | edit | 9 | 2 | mit | 9fdc42d09061f01b3fb86f04d5b545e6338a514d | ertrkumut/ARWServer_1.0 | Sessions.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage command\n\nimport (\n\t\"testing\"\n)\n\nconst (\n\tcmdText = \"give\"\n\tdesc = \"Gives x y to player z\"\n\tusage = \"Usage text\"\n\tmessage = \"/give 1 64 admin\"\n)\n\nfunc TestCommandFramework(t *testing.T) {\n\tcf := NewComm... | go | edit | 3 | 1 | mit | bfa17b16b8c7ac0b081ea2c1ab7e92b052b70907 | huin/chunkymonkey,huin/chunkymonkey | pkg/chunkymonkey/command/commandframework_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage petfind\n\nimport (\n\t\"errors\"\n\t\"time\"\n)\n\nvar ErrNotFound = errors.New(\"item not found\")\n\n// Pet holds information about each pet of the application.\ntype Pet struct {\n\tID int64\n\tName string\n\tAge int\n\tAdded ... | go | edit | 0 | 0 | mit | 1c2aed608f18a37e41e4a54b6b6da4a48b333533 | psimika/secure-web-app | petfind/petfind.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage leetcode\n\n// 6. ZigZag Conversion\nfunc convert(s string, numRows int) string {\n\tif numRows == 1 {\n\t\treturn s\n\t}\n\n\tstrs := make([][]rune, numRows)\n\tdiff := numRows - 2\n\n\tfor i, c := range s {\n\t\tp := i % (numRows + di... | go | edit | 0 | 8 | mit | e5571f073387496478d9cd8665978d7eb1ce6995 | motomux/go-algo | leetcode/6_zigzag_conversion.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// errchk $G $D/$F.go\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\npackage main\n\nfunc out_escapes() (x int, p *int) {\n\... | go | edit | 0 | 1 | bsd-3-clause | 2e5f4680915e9980173f0069ba4a09841597a484 | npe9/noahevans-go9,webfd/go-zh,rflanagan/reginaldflanagan-project1,glycerine/jeaten-go-arrayof-structof,rdp/rogerpack2005-golang,rdp/rogerpack2005-golang,mhennings/marcohennings-go,glycerine/jeaten-go-arrayof-structof,scirelli/scirelli-go,rdp/rogerpack2005-golang,d0f/go-zh,sanjosh/sanjos100-tipc,npe9/noahevans-go9,rdp/... | test/escape1.go | rejected_duplicate | Near-duplicate of sample 117252 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cf_test\n\nimport (\n\t. \"cf\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"path/filepath\"\n)\n\nvar _ = Describe(\"AppFiles\", func() {\n\tfixturePath := filepath.Join(\"..\", \"fixtures\", \"applications\")\n... | go | edit | 27 | 2 | apache-2.0 | 95f5796f338fff910b2e84b9e20c85917bf17208 | SrinivasChilveri/cli,markstgodard/cli,HuaweiTech/cli,pishro-cc/cli,EngineerBetter/cli,cgvarela/cli,srikanth88infy/cli,saravana76/cli,ReachingOut/cli,rastasheep/trash-can,TomG713/cli,mcowger/cli,fujitsu-cf/cli,markstgodard/cli,xingzhou/cli,18F/cli,saravana76/cli,diatmpravin/cli,SrinivasChilveri/cli,markstgodard/cli,xing... | src/cf/app_files_test.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fs\n\nimport (\n\t\"syscall\"\n\t\"time\"\n)\n\n// StatAtime returns the Atim\nfunc StatAtime(st *syscall.Stat_t) syscall.Timespec {\n\treturn st.Atim\n}\n\n// StatCtime returns the Ctim\nfunc StatCtime(st *syscall.Stat_t) syscall.Times... | go | edit | 0 | 1 | apache-2.0 | 854c97539720b44d4dbfbad448cae22fd5d1cc1c | containerd/continuity,stevvooe/continuity,stevvooe/continuity | fs/stat_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/codegangsta/cli\"\n)\n\nvar Commands = []cli.Command{\n\tcommandAll,\n\tcommandBiz,\n\tcommandHack,\n}\n\nvar commandAll = cli.Command{\n\tName: \"all\",\n\tUsage: \"\",\n\tDescri... | go | edit | 0 | 2 | mit | aa787e84483a0004d98de72848b9409a2b22d08b | timakin/ts,timakin/ts | commands.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage deck_test\n\nimport (\n\t\"github.com/whereswaldon/cryptage/deck\"\n\t\"testing\"\n)\n\nfunc TestBigIntStringConverstion(t *testing.T) {\n}\n\n```\n\nApply this change: Fix old test fouling up compilation"
},
{
"role": "assistan... | go | edit | 0 | 1 | mit | e938a9d55b4cc3c155d9adb4ac547501111cc4e6 | whereswaldon/cryptage | deck/conv_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage x509util\n\nimport (\n\t\"crypto/x509\"\n\t\"encoding/asn1\"\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/lib/constants\"\n\t\"strings\"\n)\n\nfunc getPermittedMethods(cert *x509.Certificate) (map[string]struct{}, error) {\n\tmethodLis... | go | edit | 0 | 1 | apache-2.0 | dfc49dce9dfaa813328d352fe4f81d39de179139 | Symantec/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator,rgooch/Dominator,keep94/Dominator | lib/x509util/getPermittedMethods.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar apiHost, jsBundleURL, dynoID, twitterAPIToken string\nvar webPort int\n\nfunc initEnv() (err error) {\n\ttwitterAPIToken = os.Getenv(\"TWITTER_TOK... | go | edit | 0 | 6 | mit | ee890b4167bc57fb3b6f5dd4e35fc3418a3cde03 | fsufitch/prez-tweet,fsufitch/prez-tweet,fsufitch/prez-tweet,fsufitch/prez-tweet,fsufitch/prez-tweet | prez-tweet-server/env.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage henchman\n\nimport (\n\t\"testing\"\n)\n\nfunc TestPrepareTask(t *testing.T) {\n\ttask := Task{\"fake-uuid\", \"The {{ vars.variable1 }}\", \"The {{ vars.variable2 }}\", false}\n\tvars := make(TaskVars)\n\tvars[\"variable1\"] = \"foo\"\... | go | edit | 9 | 3 | bsd-3-clause | 280a0f52c4d78a4b4f80b5603310b479528ca1cb | sudharsh/henchman,sudharsh/henchman | lib/task_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api_test\n\nfunc (t *testSuite) TestProjectGroupIndex_Get() {\n\tt.T().Skip(\"Not yet implemented\")\n}\n\n```\n\nApply this change: Change testify/suite to the stdlib *testing.T"
},
{
"role": "assistant",
"content": "packag... | go | edit | 0 | 1 | mit | 8583b1af41c7d10833cffeb5dcd1046df29b1f0e | diyan/assimilator,diyan/assimilator,diyan/assimilator | api/endpoints/project_group_index_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage database\n\nimport (\n\t\"github.com/juju/errors\"\n)\n\nvar (\n\t// ErrNoSuchEntity is returned from a Get operation when there is not a model\n\t// that matches the query\n\tErrNoSuchEntity = errors.New(\"no such entity found in datab... | go | edit | 0 | 0 | mit | e21746925781cf4e1487e291fbb0a0a10421a978 | altipla-consulting/database | errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage litetunes\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n)\n\n// MemoryQueue is an in-memory implementation of the Queue interface\ntype MemoryQueue struct {\n\ttracks []*Track\n}\n\n// NewMemoryQueue constructs a new MemoryQueue to use\nfunc Ne... | go | edit | 9 | 4 | isc | bbd63aaf89d17f76df98b44aeb32a3966512d352 | ciarand/litetunes | memqueue.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows linux\npackage clw11\n\n/*\n#cgo LDFLAGS: -lOpenCL\n\n#include \"CL/opencl.h\"\n*/\nimport \"C\"\nimport (\n\t\"errors\"\n)\n\nconst (\n\tGLContext ContextProperties = C.CL_GL_CONTEXT_KHR\n\tEGLDisplay ContextProperties... | go | edit | 15 | 1 | mit | 5d1de45e2b26351aa868ad1fb4121f2bcacaa1c3 | rdwilliamson/clw11 | cl_windowslinux.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"strings\"\n\n\t\"github.com/hackebrot/go-librariesio/librariesio\"\n)\n\nfunc loadFromEnv(keys ...string) (map[string]string, error) {\n\tenv := make(map[string]string)\n\n\tfor _, key := ran... | go | edit | 0 | 3 | mit | 7ab214657f7f0c4fdb2e9d513151dde09a90c463 | hackebrot/go-librariesio | librariesio/cmd/librariesio/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"log\"\n)\n\nfunc Index(w http.ResponseWriter, r *http.Request) {\n\tbody := NewRequest(r).GetBody()\n\n\tif config.FastPublish {\n\t\tif len(body) > 0 {\n\t\t\tservicesQueue.Publish(body)\n\t\t}\n\t... | go | edit | 21 | 5 | mit | eae6100549932dd145c8fc71afc573c0a4c20da2 | andreiavrammsd/microservices-persistent-communication | handlers.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package sockets provides helper functions to create and configure Unix or TCP sockets.\npackage sockets\n\nimport (\n\t\"errors\"\n\t\"net\"\n\t\"net/http\"\n\t\"time\"\n)\n\n// Why 32? See https://github.com/docker/docker/pull/8035.\nconst ... | go | edit | 9 | 4 | apache-2.0 | 8e8f92af1961482e5c0c2e0adb2b3f55c7274833 | docker/go-connections | sockets/sockets.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage irc\n\nimport \"testing\"\n\nfunc TestMessageString(t *testing.T) {\n\ttype tcase struct {\n\t\tmsg Message;\n\t\texpected string;\n\t};\n\tcases := []tcase {\n\t\ttcase {\n\t\t\tMessage{Command: \"command\", Params: []string{}},\n\t\t\... | go | edit | 9 | 3 | mit | bc7b920406a3f0a142fb57335463628fb9949929 | stefanha/bouncin | irc_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/bfontaine/edn\"\n)\n\nfunc main() {\n\tflag.Parse()\n\n\t// buffered I/O makes my 55M-file benchmark go 3x times faster\n\tinput := bufio.NewReader(os.Stdi... | go | edit | 3 | 2 | mit | 6436a2abc48e4112ac3c4c5645975e54cd14bd0d | bfontaine/epp,bfontaine/epp | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux freebsd solaris\n\npackage builtin\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/libnetwork/datastore\"\n\t\"github.com/docker/libnetwork/ipam\"\n\t\"github.com/docker/libnetwork/ipamapi\"\n\t\"github.com/docker/libnetwork/ipa... | go | edit | 0 | 6 | apache-2.0 | 64a2d2a3a2234a80b16081958b9dd2cfaad606eb | cpuguy83/docker,moby/moby,flavio/docker,AkihiroSuda/docker,Ramzec/docker,nalind/docker,paralin/docker,paralin/docker,docker/docker,nalind/docker,nawawi/docker,cpuguy83/docker,cpuguy83/docker,jthelin/docker,Mokolea/docker,jameszhan/docker,vdemeester/docker,moby/moby,yosifkit/docker,konstruktoid/docker-upstream,mahak/doc... | libnetwork/ipams/builtin/builtin_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sudoku\n\ntype CellList []*Cell\n\ntype intList []int\n\nfunc (self CellList) SameRow() bool {\n\tif len(self) == 0 {\n\t\treturn true\n\t}\n\trow := self[0].Row\n\tfor _, cell := range self {\n\t\tif cell.Row != row {\n\t\t\treturn fal... | go | edit | 9 | 4 | apache-2.0 | a9642f1e61c63af83e70d191404d80139e4791f5 | jkomoros/sudoku,jkomoros/sudoku,jkomoros/sudoku | sudoku/celllist.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write go code for the following: Add Lexer struct and New function for it"
},
{
"role": "assistant",
"content": "package lexer\n\ntype Lexer struct {\n\tinput\t\t\tstring\n\tposition\t\tint\t\t// current position in input (points to current char)\n\treadPosition\tin... | go | new_file | 0 | 1 | mit | 17187685fba4907d90cd545015cff21b8483732a | vkandola/go-go-gadget,vkandola/go-go-gadget | src/gadget/lexer/lexer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage p01\n\nimport (\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc Solve(input string) (string, string) {\n\treturn solve(input, 1), solve(input, len(input)/2)\n}\n\nfunc solve(input string, lookahead int) string {\n\tsum := 0\n\n\tfor i := 0; i < le... | go | edit | 0 | 3 | apache-2.0 | c49c8f81b34273d842a9920b569a2cf14810a950 | shaeberling/euler,shaeberling/euler,shaeberling/euler,shaeberling/euler | go/src/aoc17/problems/p01/p01.go | rejected_duplicate | Near-duplicate of sample 117387 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/gchaincl/sqlhooks\"\n\t_ \"github.com/mattn/go-sqlite3\"\n\t\"github.com/russross/meddler\"\n)\n\ntype Person struct {\n\tID int `meddler:\"id,pk\"`\n\tName string ... | go | edit | 0 | 2 | mit | 1c1f2703940c4f5645f1969d57fbc1b3132a9bd0 | gchaincl/sqlhooks | examples/meddler/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage uploader\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"launchpad.net/goamz/aws\"\n\t\"launchpad.net/goamz/s3\"\n)\n\nconst (\n\tdefaultS3BufferSize = 5 * 1024 * 1024\n)\n\ntype S3 struct {\n\tBucket *s3.Bucket\n\tBufferSize int64\n}\n\nfunc... | go | edit | 0 | 3 | mit | 0e20ab7b104b869fef4160c6c876a8ed47318851 | jingweno/travisarchive,jingweno/travisarchive,jingweno/travisarchive | export/uploader/s3.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gstrings\n\nimport (\n\t\"github.com/wallclockbuilder/testify/assert\"\n\t\"testing\"\n)\n\nfunc TestSize(t *testing.T) {\n\tassert := assert.New(t)\n\tassert.Equal(5, Size(\"hello\"))\n}\n\n```\n\nApply this change: Add documentation e... | go | edit | 6 | 1 | bsd-2-clause | f9a8c9a68124f765dbf727e286e4ff56b9d8b5b0 | wallclockbuilder/gstrings,wallclockbuilder/stringutil | size_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"github.com/mat/besticon/besticon\"\n\t\"os\"\n)\n\nfunc main() {\n\tall := flag.Bool(\"all\", false, \"Display all Icons, not just the best.\")\n\tflag.Parse()\n\n\tif len(os.Args) <= 1 {\n\t... | go | edit | 0 | 7 | mit | f9308c5beb7ee4235df0f79f503181655712d3bc | mat/besticon,mat/besticon,mat/besticon | besticon/besticon/cmd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport (\n \"path\"\n \"io/ioutil\"\n \"os\"\n \"encoding/json\"\n \"ghighlighter/utils\"\n)\n\ntype GhHighlights struct {\n items []GhHighlight\n}\n\nfunc (m *GhHighlights) GetAll() []GhHighlight {\n m.Read()\n return... | go | edit | 9 | 4 | mit | a829a44606a1daf593ff190248a1f8723b4db150 | chdorner/ghighlighter | src/ghighlighter/models/highlights.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\"context\"\n\t\"net/http\"\n\t\"os\"\n\t\"os/signal\"\n\t\"time\"\n\n\t\"github.com/labstack/echo\"\n\t\"github.com/labstack/gommon/log\"\n)\n\nfunc main() {\n\t// Setup\n\te := echo.New()\n\te.Logger.SetLevel(log.I... | go | edit | 0 | 2 | mit | c96e2e1d264d393c7f8f898313c26b58dbb00c8b | labstack/echox,labstack/echox,labstack/echox | cookbook/graceful-shutdown/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bot\n\nimport (\n\t\"strings\"\n\n\t\"github.com/arachnist/gorepost/irc\"\n)\n\nfunc ping(output chan irc.Message, msg irc.Message) {\n\tif strings.Split(msg.Trailing, \" \")[0] != \":ping\" {\n\t\treturn\n\t}\n\n\toutput <- irc.Message... | go | edit | 3 | 2 | mit | 4deb2609d2d3ca5fbc89496d88cca40a27b40fd9 | arachnist/gorepost | bot/msgping.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage platforms\n\nimport (\n\t\"reflect\"\n\t\"runtime\"\n\t\"testing\"\n\n\tspecs \"github.com/opencontainers/image-spec/specs-go/v1\"\n)\n\nfunc TestDefault(t *testing.T) {\n\texpected := specs.Platform{\n\t\tOS: runtime.GOOS,\n\... | go | edit | 12 | 3 | apache-2.0 | 2517e13a5e7231029477bbfd02835e490c7b4a48 | mikebrow/containerd,crosbymichael/containerd,vdemeester/containerd,miaoyq/containerd,crosbymichael/containerd,miaoyq/containerd,mikebrow/containerd,dmcgowan/containerd,kunalkushwaha/containerd,containerd/containerd,estesp/containerd,dmcgowan/containerd,containerd/containerd,vdemeester/containerd,estesp/containerd,thaJe... | platforms/defaults_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mfsr\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/ipfs/go-ipfs/thirdparty/assert\"\n)\n\nfunc testVersionFile(v string, t *testing.T) (rp RepoPath) {\n\tname, err := ioutil.TempDir(\"\", v)\n\tif err != nil {\... | go | edit | 9 | 2 | mit | 310c08cf58eef25fbda468fb1db97612b396bef6 | chriscool/go-ipfs,MichaelMure/go-ipfs,WilliButz/go-ipfs,Quantomicus/go-ipfs,ianopolous/go-ipfs,JustinDrake/go-ipfs,OpenBazaar/go-ipfs,kyledrake/go-ipfs,chriscool/go-ipfs,Quantomicus/go-ipfs,Luzifer/go-ipfs,ianopolous/go-ipfs,OpenBazaar/go-ipfs,ianopolous/go-ipfs,JustinDrake/go-ipfs,WilliButz/go-ipfs,chriscool/go-ipfs,J... | repo/fsrepo/migrations/mfsr_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ActiveObject\n\nimport (\n\t\"errors\"\n\t\"time\"\n)\n\n//ActiveObjectWithInterval implements IActiveObject with behavior running in a specified interval\ntype ActiveObjectWithInterval struct {\n\tworkerFunction func(params ...interfac... | go | edit | 0 | 4 | mit | d94eafef82a20c26d22ddbdf4def16d3e76e7540 | irwansyahwii/Pattern-Oriented-Software-Architecture-With-Go | ConcurrencyPatterns/ActiveObject/ActiveObjectWithInterval.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dragon\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestOut(t *testing.T) {\n\tlibChan := make(chan lib)\n\n\tgo func() {\n\t\tlibChan <- lib{\n\t\t\tpkg: \"dragon\",\n\t\t\tobject: \"Imports\",\n\t\t\tpath: \"... | go | edit | 12 | 4 | mit | 612177abbe1815533df4904f7e06544f98bd3a1a | monochromegane/dragon-imports | out_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"syscall\"\n)\n\nfunc CallBrowser(url string) error {\n\tfmt.Fprintf(os.Stderr, \"Running a browser to open %s...\\r\\n\", url)\n\n\tvar attr os.ProcAttr\n\tattr.Sy... | go | edit | 3 | 3 | mit | 74b6ce801ce15a1a2b4df6aa51a3005a0c67ab07 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | cmds/util/callbrowser_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage models\n\nimport (\n\t\"log\"\n\n\t\"github.com/gobuffalo/envy\"\n\t\"github.com/gobuffalo/packr/v2\"\n\t\"github.com/gobuffalo/pop\"\n\t\"github.com/nleof/goyesql\"\n)\n\n// DB is a connection to your database to be used\n// throughout... | go | edit | 3 | 3 | apache-2.0 | bd43cd097cc4e3d64aa7c47d1ed88a3dcdc6b32e | kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi,kindlyops/mappamundi | havenapi/models/models.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\n\n/*\nCopyright 2019 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 ... | go | edit | 0 | 0 | apache-2.0 | 78ca71857bb7a55e30235367aa12066622148592 | zhangmingld/kubernetes,andrewsykim/kubernetes,fgimenez/kubernetes,kitt1987/kubernetes,JacobTanenbaum/kubernetes,jessfraz/kubernetes,tengqm/kubernetes,li-ang/kubernetes,yujuhong/kubernetes,mikedanese/kubernetes,saad-ali/kubernetes,tcnghia/kubernetes,pires/kubernetes,warmchang/kubernetes,chrislovecnm/kubernetes,warmchang... | cmd/kubeadm/app/constants/constants_windows.go | accepted | null | 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 | 569042e6dfe2dcf338cb5d584e4d9b7c170af669 | dmcgowan/containerd,mikebrow/containerd,thaJeztah/containerd,mikebrow/containerd,dmcgowan/containerd,thaJeztah/containerd,containerd/containerd,estesp/containerd,containerd/containerd,estesp/containerd | version/version.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\n\t\"github.com/umahmood/geoip\"\n)\n\n// command line flags.\nvar ip string\n\nfunc init() {\n\tflag.StringVar(&ip, \"ip\", \"\", \"IP to geo locate can be v4 or v6 addres... | go | edit | 0 | 3 | mit | 6c75828f717b728985782256eb0d22906c8f40d4 | umahmood/geoip | cmd/geoip/main.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/lib/fsbench\"\n\t\"os\"\n)\n\n// Benchmark the read speed of the underlying block device for a given file.\nfunc main() {\n\tpathname := \"/\"\n\tif len(os.Args) == 2 {\n\t\... | go | edit | 0 | 4 | apache-2.0 | 06b21da4606ce5d2b8130eea7b069ebe949346e4 | Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,rgooch/Dominator | cmd/fsbench/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage exp12\n\nimport (\n\t\"sync\"\n\n\t\"github.com/shurcooL/go/exp/13\"\n\t\"github.com/shurcooL/go/vcs\"\n\n\t. \"gist.github.com/7802150.git\"\n)\n\n// TODO: Use FileUri or similar type instead of string for clean path to repo root.\n// ... | go | edit | 12 | 3 | mit | ff5fd25f40f578a47b0c7148bbfc551b2505b87e | shurcooL/go | exp/12/main.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Write go code for the following: Add test for NotFound Login"
},
{
"role": "assistant",
"content": "package service\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestNotFoundLoginShouldReturnError(t *testing.T) {\n\tnf := &NotFoun... | go | new_file | 3 | 1 | mit | 74259226185994025f100c1f6be20a8c1f14b074 | hoop33/limo | service/not_found_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\npackage overlayutils // import \"github.com/docker/docker/daemon/graphdriver/overlayutils\"\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/daemon/graphdriver\"\n)\n\n// ErrDTypeNotSupported denotes that the backing fi... | go | edit | 0 | 3 | apache-2.0 | 8a21b128d4deb874c05eb81ebbc1265175ad69ba | thaJeztah/docker,nalind/docker,jthelin/docker,kolyshkin/moby,kolyshkin/moby,paralin/docker,trebonian/docker,tonistiigi/docker,Ramzec/docker,maxamillion/docker,yosifkit/docker,kojiromike/docker,scotttlin/docker,bearstech/moby,SvenDowideit/docker,konstruktoid/docker-upstream,johnstep/moby-moby,jvanz/docker,jwhonce/docker... | daemon/graphdriver/overlayutils/overlayutils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2015, Peter Mrekaj. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE.txt file.\n\npackage btrees\n\n// checkSymmetry returns true if the l binary\n// tree ... | go | edit | 9 | 7 | mit | 7d0fb46d0304cc4f730f6b26334c176e9ae71a2a | mrekucci/epi,mrekucci/epi | btrees/symmetric.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage data\n\ntype Command struct {\n Id string `json:\"id\"`\n ProcessId string `json:\"processId\"`\n Name string `json:\"name\"`\n Body string `json:\"body\"`\n}\n\n```\n\nApply this change: Add generic behavior to body field, ... | go | edit | 0 | 0 | mit | edeeb6d6bb90997182e000ba6768391fdadbc459 | rjansen/fivecolors,rjansen/fivecolors,rjansen/fivecolors | data/data.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\n\t\"github.com/ParadropLabs/node\"\n)\n\n// var client *rabric.Client\n\nfunc main() {\n\tnode.Log()\n\n\t// Pass certificate here\n\ts := node.CreateNode(\"pd.routers.aardvark\")\n\n\tserv... | go | edit | 0 | 3 | mit | 0a352ae409d9750665fc10369b72e89b08c9bd90 | exis-io/node,exis-io/node | runner/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/sean-duffy/xlsx\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tc := []xlsx.Column{\n\t\txlsx.Column{Name: \"Col1\", Width: 10},\n\t\txlsx.Column{Name: \"Col2\", Width: 10},\n\t}\n\n\tsh := xlsx.NewSheetWithCo... | go | edit | 0 | 2 | mit | 91bc49d87ca9c78db6a7e3dfc68e752063fdf1cf | psmithuk/xlsx,scraperwiki/xlsx | example/large/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jwt\n\nimport (\n\t\"net/http\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestJWKFetcher(t *testing.T) {\n\tassert := assert.New(t)\n\tfetcher := &JWKsHTTPFetcher{\n\t\tClient: &http.Client{},\n\t}\n\tjwksres... | go | edit | 12 | 2 | bsd-3-clause | b2c0c3382bb939a72c7bd80d6da8cda9a3931e97 | nabeken/jwt.go | v2/jwk_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage leetcode\n\n/**\n * Definition for singly-linked list.\n * type ListNode struct {\n * Val int\n * Next *ListNode\n * }\n */\nfunc removeNthFromEnd(head *ListNode, n int) *ListNode {\n\tn1, n2 := head, head\n\tfor i := 0; i < n; ... | go | edit | 3 | 4 | apache-2.0 | 9fe2514b370f58c5531fd22830713791fac0b3a5 | 4396/leetcode | leetcode/019.remove-nth-node-from-end-of-list.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n//go:generate gourd gen service -type=Post -coll=posts $GOFILE\n\npackage main\n\nimport (\n\t\"time\"\n)\n\n// Post is for blog post\n// This is a multiple line comment\n/**\n * This is another multiple line comment\n * Just another type\n */\... | go | edit | 0 | 0 | apache-2.0 | 1f3f8a7fba81402579fccaafac069d135e0a648c | gourd/gourd | _examples/2_server/post.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage middleware\n\nimport \"net/http\"\n\ntype Cors struct{}\n\nfunc (c Cors) Handle(w http.ResponseWriter, req *http.Request, next http.HandlerFunc) {\n\theaders := w.Header()\n\tif headers.Get(\"Access-Control-Allow-Origin\") == \"\" {\n\t... | go | edit | 0 | 5 | apache-2.0 | bbd4133904ea76cc800ecb411986905c6762e141 | matzew/mcp-standalone,matzew/mcp-standalone,matzew/mcp-standalone,feedhenry/mcp-standalone,feedhenry/mcp-standalone,feedhenry/mcp-standalone,feedhenry/mcp-standalone,matzew/mcp-standalone | pkg/web/middleware/cors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n\t\"github.com/astaxie/beego\"\n)\n\ntype Registration struct {\n\tUsername string\n\tPassword string\n}\n\ntype RegistrationsController struct {\n\tBaseController\n}\n\nfunc (this *RegistrationsController) Prep... | go | edit | 24 | 2 | mit | b151d96d5ba52fc8827e638119ff5ad2e090ea76 | UserStack/ustackweb,UserStack/ustackweb,UserStack/ustackweb,UserStack/ustackweb | src/ustackweb/controllers/registrations.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux,cgo\n\npackage lfs\n\nimport (\n\t\"io\"\n)\n\nfunc CloneFile(writer io.Writer, reader io.Reader) (bool, error) {\n\treturn false, nil\n}\n\n```\n\nApply this change: Fix non linux with cgo build condition"
},
{
"role":... | go | edit | 0 | 1 | mit | a2f72c955e24c3a37d1c6342f8fd4d774eb81896 | ttaylorr/git-lfs,Jericho25/-git-lfs_miilkyway,dakotahawkins/git-lfs,github/git-lfs,andyneff/git-lfs,aleb/git-lfs,ttaylorr/git-lfs,Jericho25/-git-lfs_miilkyway,andyneff/git-lfs,bozaro/git-lfs,Jericho25/-git-lfs_miilkyway,ttaylorr/git-lfs,github/git-lfs,larsxschneider/git-lfs,larsxschneider/git-lfs,aleb/git-lfs,aleb/git-... | lfs/util_generic.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"code.google.com/p/gcfg\"\n\t\"path/filepath\"\n)\n\ntype Config struct {\n\tRabbitMq struct {\n\t\tHost string\n\t\tUsername string\n\t\tPassword string\n\t\tPort string\n\t\tVhost strin... | go | edit | 0 | 4 | mit | a9e8602b881e3fccb9ab7e72fff75f55b5740bb4 | ricbra/rabbitmq-cli-consumer,ricbra/rabbitmq-cli-consumer | config/config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build darwin freebsd netbsd openbsd\n\npackage fineline\n\nimport (\n\t\"syscall\"\n)\n\nfunc tcgetattr(fd int, t *termios) {\n\tttyIoctl(0, syscall.TIOCGETA, t)\n}\n\nfunc tcsetattr(fd int, t *termios) {\n\tvar cmd int\n\tswitch op {\n\tca... | go | edit | 30 | 4 | bsd-3-clause | 496ea1ca490380d07c6044379813c3893c4f92d4 | edsrzf/fineline,davecheney/fineline | termios_bsd.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\n// SourceCD\n// 0 = unknown\n// 1 = carthage\n// 2 = cocoapods\n// 3 = submodule\n\n// Dependency has project dependency and source distination.\ntype Dependency struct {\n\tProjectUUID string `json:\"project_uuid\"`\n... | go | edit | 0 | 0 | mit | 628c92772d72467b9d5172434a259936e7e5d613 | torinos-io/api,torinos-io/api | type/model/dependency.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport sp \"github.com/scipipe/scipipe\"\n\nfunc main() {\n\t// --------------------------------\n\t// Set up a pipeline runner\n\t// --------------------------------\n\n\trun := sp.NewPipelineRunner()\n\n\t// ------------------... | go | edit | 0 | 1 | mit | c0c0357473e58b1bb531b94a6959f1a4d1fada5b | scipipe/scipipe,scipipe/scipipe,samuell/scipipe | examples/minimal_pipeline_k8s/minimal_k8s.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage algoliasearch\n\nfunc checkGenerateSecuredAPIKey(params Map) error {\n\tif err := checkQuery(params,\n\t\t\"restrictIndices\",\n\t\t\"restrictSources\",\n\t\t\"userToken\",\n\t\t\"validUntil\",\n\t); err != nil {\n\t\treturn err\n\t}\n\... | go | edit | 0 | 9 | mit | bb1c4db925a715716fdf7293051fa810858cd4a9 | l4u/algoliasearch-client-go,algolia/algoliasearch-client-go,algolia/algoliasearch-client-go,l4u/algoliasearch-client-go | algoliasearch/check_key.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tessen\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"strings\"\n)\n\nfunc FetchUchiwaEvents(endpoint string) ([]map[string]interface{}, error) {\n\n\tresp, err := http.Get(fmt.Sprintf(\"%s/events\", e... | go | edit | 3 | 3 | apache-2.0 | 57b7a0920059998e1cc6a8ed7dd194811a1fa2a0 | mikepea/tessen | uchiwa_results.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logrus\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"time\"\n)\n\ntype JSONFormatter struct{}\n\nfunc (f *JSONFormatter) Format(entry *Entry) ([]byte, error) {\n\tdata := make(Fields, len(entry.Data)+3)\n\tfor k, v := range entry.Dat... | go | edit | 9 | 3 | mit | 98fd21de2cae4ee1166e6aeb69aaa411dcb23c8d | zbindenren/logrus,sirupsen/logrus,penhauer-xiao/logrus,derekdowling/logrus,alecha/logrus,yawn/logrus,upstartmobile/logrus,axiomzen/logrus,gogap/logrus,marcosnils/logrus,Dal-Papa/logrus,Sirupsen/logrus,noxiouz/logrus,therealbill/logrus,Barberrrry/logrus,devopstaku/logrus,noironetworks/logrus,wallclockbuilder/logrus,orvi... | json_formatter.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage chat_test\n\nimport (\n\t\"testing\"\n\n\t\"github.com/spring1843/chat-server/src/chat\"\n\t\"github.com/spring1843/chat-server/src/drivers/fake\"\n)\n\nfunc TestCanWriteToUser(t *testing.T) {\n\tfakeWriter := fake.NewFakeConnection()\n... | go | edit | 3 | 4 | mit | a4276e879139c400159294b32d50f3650a99670b | spring1843/chat-server | src/chat/user_conn_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage state\n\nimport (\n\t\"github.com/centurylinkcloud/clc-go-cli/config\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path\"\n)\n\nfunc ReadFromFile(name string) ([]byte, error) {\n\tp, err := config.GetPath()\n\tif err != nil {\n\t\treturn nil, err\n... | go | edit | 0 | 3 | apache-2.0 | 64f1ed07a5e11070025e664a46786bb17e35b4a9 | CenturyLinkCloud/clc-go-cli,CenturyLinkCloud/clc-go-cli | state/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2010 The draw2d Authors. All rights reserved.\n// created: 21/11/2010 by Laurent Le Goff\n\npackage draw2d\n\ntype Path interface {\n\t// Return the current point of the path\n\tLastPoint() (x, y float64)\n\t// Create a new subpath... | go | edit | 0 | 0 | bsd-2-clause | fef72651456546ef604497e028cce74713871741 | xushiwei/draw2d,julianshen/draw2d,xushiwei/draw2d,sksullivan/draw2d,llgcode/draw2d,ninjasphere/draw2d,hellobond/draw2d,stephenwithav/draw2d | path.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"runtime\"\n)\n\nimport (\n\t\"github.com/chango/tas/tas\"\n)\n\nfunc main() {\n\truntime.GOMAXPROCS(10)\n\ttasConfig := tas.NewDefaultTASConfig()\n\tsvr, err := tas.NewTASServer(tasConfig)\n\tif err != n... | go | edit | 0 | 2 | mit | f767b7051afee3fe494610d22b31e92d35493218 | oldmantaiter/tas,chango/tas,oldmantaiter/tas,chango/tas | examples/tas-server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2020 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 | 3 | 4 | apache-2.0 | 1239c58e1d843e4eaf67a92de768f74f469aa2db | kubernetes/minikube,kubernetes/minikube,kubernetes/minikube,kubernetes/minikube,kubernetes/minikube,kubernetes/minikube,kubernetes/minikube | hack/preload-images/kubernetes.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage terminal\n\nimport (\n\t\"syscall\"\n)\n\n\nconst ioctlReadTermios = syscall.TIOCGETA\n\n/*\n Go 1.2 doesn't include Termios for FreeBSD. This should be added in\n 1.3 and th is could be merged with terminal_darwin.\n*/\ntype termios ... | go | edit | 3 | 0 | mit | 16b82629adec18d2ca848aed2a854faad64572d0 | BellerophonMobile/logberry | terminal/terminal_freebsd.go | rejected_duplicate | Near-duplicate of sample 117441 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage vecty\n\nvar _ = func() bool {\n\tisTest = true\n\treturn true\n}()\n\n```\n\nApply this change: Add unit test for RenderBody expecting \"body\" tag"
},
{
"role": "assistant",
"content": "package vecty\n\nimport (\n\t\"fmt\"... | go | edit | 27 | 2 | bsd-3-clause | e0dd532d12b6bc448757b2bc0ea22527630c612c | gopherjs/vecty | dom_test.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\ntype options struct {\n\tqty int\n\tdir string\n}\n\nfunc newOptionsDefault() *options {\n\treturn &options{\n\t\tqty: 1024,\n\t\tdir: \"./testfiles\",\n\t}\n}... | go | edit | 3 | 7 | mit | 7eaf4588f66c1036ce5fe3aa8b16cb16a534b9a2 | daved/conch0 | cmd/conchtestdata/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage transcode\n\nimport (\n\n)\n\n// Options represents an audio codec and its quality settings, and includes methods to\n// retrieve these settings\ntype Options interface {\n\tCodec() string\n\tFFmpegCodec() string\n\tFFmpegQuality() stri... | go | edit | 0 | 0 | mit | b19dc050e5c6c78f4a5cc6264234aab7989ac9c3 | mdlayher/wavepipe,mdlayher/wavepipe | transcode/options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"net/http\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc helloHandler(w http.ResponseWriter, r *http.Request) {\n\tresponse := os.Getenv(\"RESPONSE\")\n\tif len(response) == 0 {\n\t\tresponse = \"Hello ... | go | edit | 0 | 3 | apache-2.0 | 36260dd3160d3cc73c2f730ff7845b8a5868e7ff | soltysh/origin,JacobTanenbaum/origin,jsafrane/origin,akram/origin,spadgett/origin,mahak/origin,spadgett/origin,deads2k/origin,soltysh/origin,gabemontero/origin,spadgett/origin,jeremyeder/origin,mahak/origin,openshift/origin,spadgett/origin,gabemontero/origin,csrwng/origin,bparees/origin,mfojtik/origin,hroyrh/origin,bpa... | examples/hello-openshift/hello_openshift.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage proto\n\nimport \"time\"\n\ntype Response struct {\n\tAvailable bool `json:\"available\"`\n\tDownloadURL string `json:\"download_url\"`\n\tChecksum string `json:\"checksum\"`\n\tSignature string `json:\"signature\"`\n\tPatc... | go | edit | 0 | 0 | mit | 8868bbc4ec723dd62f79d36c762f1df0b9aa63e9 | equinox-io/equinox | proto/proto.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nconst dockerUnitTemplate = `\n[Unit]\nDescription={{.Name}}\nAfter=docker.service\n\n[Service]\nEnvironmentFile=/etc/environment\nUser=core\nTimeoutStartSec=0\nExecStartPre=/usr/bin/docker pull {{.ImagePrefix}}/{{.Name}}:{{.Ve... | go | edit | 0 | 0 | mit | 0ea3318dc35ee609c75ae2fb9ef67d580191a560 | bmorton/deployster | server/templates.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage shell\n\nimport (\n\t\"testing\"\n)\n\nfunc TestGuessFish(t *testing.T) {\n\tif Guess(\"/usr/local/bin/fish\") != Fish {\n\t\tt.Errorf(\"Expected /usr/local/bin/fish to match the fish shell\")\n\t}\n}\n\nfunc TestGuessZsh(t *testing.T) ... | go | edit | 18 | 3 | mit | 0223d37681f5ba51e00106c9fc146d63f9618fa1 | gsamokovarov/jump | shell/shell_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage store\n\n// TypeGetter is a func used to determine the concrete type of a context or\n// endpoint metadata by returning a pointer to an instance of the object\n// eg: for a context of type DockerContext, the corresponding TypeGetter sho... | go | edit | 0 | 3 | apache-2.0 | 4f14c4995ea5d96d91caeb03bb2e700572c97660 | thaJeztah/cli,thaJeztah/cli,docker/cli,cpuguy83/cli,docker/cli,cpuguy83/cli | cli/context/store/storeconfig.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gothic\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nvar ir *Interpreter\n\nfunc init() {\n\tir = NewInterpreter(nil)\n\ttime.Sleep(200 * time.Millisecond)\n}\n\nfunc BenchmarkTcl(b *testing.B) {\n\tir.Set(\"N\", b.N)\n\tir.Eval(`\n\t\tf... | go | edit | 6 | 2 | mit | fe66750db93b9c37f02b5f9d81dc906b2335abc5 | nsf/gothic,nsf/gothic,nsf/gothic | interpreter_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hyperdb\n\n// DB represents a collection of objects with multitude of attributes,\n// that can be retrieved based all possible dimensions.\ntype DB struct {\n}\n\n// Open creates and opens a database at the given path.\n// If the file d... | go | edit | 6 | 1 | mit | 6d4feed44b19c54144888f3dba74f5c2fa13a014 | mysza/hyperdb | db.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage data\n\nimport (\n\t\"time\"\n\n\t\"github.com/jinzhu/gorm\"\n\n\t// DB adapters\n\t_ \"github.com/lib/pq\"\n\t_ \"github.com/mattn/go-sqlite3\"\n)\n\nvar db gorm.DB\n\ntype Check struct {\n\tId int64\n\tURL string\n}\n\ntype Result st... | go | edit | 0 | 3 | mit | 777289c17a05c3271cf62169a5d02411f2ed06cc | goffee/goffee,goffee/goffee,goffee/goffee,goffee/goffee | data/data.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pull\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"net/http\"\n\t\"os\"\n\t\"path\"\n\n\t\"github.com/mitchellh/ioprogress\"\n)\n\nfunc NewRelease(cache string) *Release {\n\treturn &Release{CacheDir: cache}\n}\n\ntype Release struct {\n\tCache... | go | edit | 0 | 4 | apache-2.0 | f8328f75917c22c0a34ee938d31d3dce4503b4c9 | enaml-ops/enaml,xchapter7x/enaml | pull/releasepull.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestVesion(t *testing.T) {\n\tassert.Equal(t, \"unknown\", Version())\n}\n\n```\n\nApply this change: Fix a typo in the test method name"
},
{
... | go | edit | 3 | 1 | apache-2.0 | c7d6cee7f87ebfcc96c2cbffe4018675532e696d | simonswine/kube-lego,jetstack/kube-lego | main_test.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.