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 h2spec\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/summerwind/h2spec/config\"\n\t\"github.com/summerwind/h2spec/http2\"\n\t\"github.com/summerwind/h2spec/log\"\n\t\"github.com/summerwind/h2spec/reporter\"\n\t\"github.com/summer... | go | edit | 0 | 8 | mit | 5f096880765e74e26b2ed21033fe975d87ef904a | summerwind/h2spec | h2spec.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage vsphere\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/cloudfoundry/bosh-bootloader/storage\"\n)\n\ntype TemplateGenerator struct{}\n\nfunc NewTemplateGenerator() TemplateGenerator {\n\treturn TemplateGenerator{}\n}\n\nfunc (t TemplateGenerat... | go | edit | 0 | 1 | apache-2.0 | 04b72b4a7ddd37d4615f4fcc125211ee93518780 | pivotal-cf-experimental/bosh-bootloader,niroyb/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader,niroyb/bosh-bootloader | terraform/vsphere/template_generator.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ergo\n\nimport (\n\t\"net/http\"\n)\n\ntype Request struct {\n\t*http.Request\n\tInput map[string]validation.Valuer\n\tpathParams map[string]string\n\troute *Route // route object that matched request\n}\n\nfunc NewRequest(htt... | go | edit | 3 | 4 | mit | 7f08592da6b612bf33dda64a404e7f44c5c3cfb8 | wlMalk/ergo | request.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\t\"github.com/gin-gonic/gin\"\n)\n\nfunc main() {\n\tp := os.Getenv(\"PORT\")\n\tif p == \"\" {\n\t\tlog.Fatal(\"$PORT must be set\")\n\t}\n\n\tr := gin.Default()\n\n\t// PING te... | go | edit | 3 | 3 | mit | ac3aaddcedb51e0f1c25c218ea98bfee9939404b | jhh/puka-react,jhh/puka-react,jhh/puka-react | cmd/puka-web/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage log\n\nimport (\n\t\"github.com/getsentry/raven-go\"\n\t\"log\"\n\t\"os\"\n)\n\nvar activeSentry bool = true\n\nfunc InitializeSentry() {\n\tsentry := os.Getenv(\"SENTRY_DSN\")\n\tif sentry == \"\" {\n\t\tactiveSentry = false\n\t\tlog.P... | go | edit | 6 | 2 | mit | 6ccc812331b6f899d2b1d1344b5fd332ad3452d2 | aleasoluciones/goaleasoluciones | log/sentry.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Problem 6.18\n\npackage chapter6\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode\"\n)\n\nfunc Encoding(s string) string {\n\trunes := []rune(s)\n\n\tvar out string\n\n\tcnt := 1\n\n\tfor i := 1; i < len(runes); i++ {\n\t\tif runes[i] != r... | go | edit | 0 | 3 | mit | a2f3c88e6c93db375f881d18bbc8ae45e1c36883 | akshaykumar90/sparkling-water | chapter6/runlengthcompression.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2017 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.... | go | edit | 0 | 1 | apache-2.0 | 2e560e797e22c44ac628581486d847c2d5bdbd59 | MikeSpreitzer/kubernetes,sethpollack/kubernetes,BenTheElder/kubernetes,zhangxiaoyu-zidif/kubernetes,BenTheElder/kubernetes,jingxu97/kubernetes,ncdc/kubernetes,kow3ns/kubernetes,fgimenez/kubernetes,goblain/kubernetes,mbohlool/kubernetes,ingvagabund/kubernetes,kow3ns/kubernetes,bizhao/kubernetes,madhanrm/kubernetes,resou... | staging/src/k8s.io/apiserver/pkg/server/signal.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2018 CNI 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://www.apac... | go | edit | 6 | 1 | apache-2.0 | 61a412ea773bbda0e073689739363defe58cdd15 | containernetworking/plugins,containernetworking/plugins | plugins/ipam/static/static_suite_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage master\n\ntype pqSlice struct {\n\tSlice []interface{}\n\tLessComparator func(i, j interface{}) bool\n}\n\nfunc (s pqSlice) Len() int {\n\treturn len(s.Slice)\n}\n\nfunc (s pqSlice) Less(left, right int) bool {\n\treturn s.Less... | go | edit | 0 | 1 | mit | 24bc903ce757644948a2a8d805bb960c16486fef | KIT-MAMID/mamid,KIT-MAMID/mamid,KIT-MAMID/mamid,KIT-MAMID/mamid,KIT-MAMID/mamid | master/cluster_allocator_pq.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\t\"strings\"\n)\n\nfunc BoolString(tf bool) string {\n\tif tf {\n\t\treturn \"Y\"\n\t}\n\treturn \"F\"\n}\n\nfunc CurrentUser() string {\n\treturn fmt.Sprintf(\"%s@%s\", os.Getenv(\"USER\"), os.Ge... | go | edit | 3 | 3 | mit | 3e1377d6c5f151b9c4ed74b618fa17ac2f28f73f | starkandwayne/shield,karampok/shield,karampok/shield,starkandwayne/shield,starkandwayne/shield,starkandwayne/shield,karampok/shield,karampok/shield,starkandwayne/shield | cmd/shield/utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2017 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.... | go | edit | 0 | 1 | apache-2.0 | 883f9be315ef02f77810ec2aef6c1e36f6a1d465 | aveshagarwal/cluster-capacity,aveshagarwal/cluster-capacity,aveshagarwal/cluster-capacity | cmd/genpod/app/options/options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage helpers\n\nimport (\n\t\"io\"\n\t\"os\"\n)\n\n// Copyfile takes a source and destination file path and copies the file. Destination needs to be complete path of file, not a directory\nfunc CopyFile(srcPath, destPath string) (err error) ... | go | edit | 0 | 4 | mit | c3c49108dfabe730376c33d65d7c01f56820786b | devopsdays/devopsdays-cli,mattstratton/probablyfine,devopsdays/devopsdays-cli | helpers/copy_file.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n//go:build boringcrypto\n// +build boringcrypto\n\npackage boring\n\nimport (\n\t\"crypto/boring\"\n\n\t\"gitlab.com/gitlab-org/labkit/log\"\n)\n\n// CheckBoring checks whether FIPS crypto has been enabled. For the FIPS Go\n// compiler in https... | go | edit | 3 | 2 | mit | 2b6b8215dfcf8beefd332b401922f7e36f901ae6 | gitlabhq/gitlab-shell,gitlabhq/gitlab-shell,gitlabhq/gitlab-shell | internal/boring/boring.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nPackage \"matrix\" provides types and operations for matrix manipulation.\n*/\npackage matrix\n\ntype Matrix interface {\n\t// Return the shape of matrix, which consists of the \"rows\" and the \"columns\".\n\tShape() (rows, columns int)\n\... | go | edit | 0 | 0 | mit | d510b15dbd2fae76f34f77cd28e909714d0138d5 | mitsuse/matrix-go,jmptrader/matrix-go | matrix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage octokit\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\ntype Status struct {\n\tCreatedAt time.Time `json:\"created_at\"`\n\tUpdatedAt time.Time `json:\"updated_at\"`\n\tState string `json:\"state\"`\n\tTargetUrl string `json... | go | edit | 3 | 2 | mit | 439f8f25fd6b256ca099ffb419bfb449f5fe38ed | dev4mobile/hub,rlugojr/hub,nmfzone/hub,terry2000/hub,codydaig/hub,jingweno/hub,codydaig/hub,naru0504/hub,isundaylee/hub,aspiers/hub,dongjoon-hyun/hub,dongjoon-hyun/hub,ASidlinskiy/hub,cpick/hub,sbp/hub,github/hub,xantage/hub,boris-rea/hub,hopil/hub,ASidlinskiy/hub,pankona/hub,AndBicScadMedia/hub,isundaylee/hub,rlugojr/... | octokit/statuses.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Robert S. Gerus. 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 bot\n\nimport (\n\t\"math/rand\"\n\t\"strings\"\n\t\"time\"\n\n\t\"gith... | go | edit | 6 | 4 | mit | 09286f3defa2f9368b645a4905a19cb0f521dafd | arachnist/gorepost | bot/pick.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage acme\n\ntype dvsniChallenge struct{}\n\nfunc (s *dvsniChallenge) CanSolve() bool {\n\treturn false\n}\n\nfunc (s *dvsniChallenge) Solve(challenge challenge, domain string) {\n\n}\n\n```\n\nApply this change: Implement new interface with... | go | edit | 3 | 1 | mit | 728646c70e94fef270ef90aeee31c813239089e6 | xenolf/lego,fxposter/lego,xenolf/lego,tommie/lego | acme/dvsni_challenge.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pages\n\nimport (\n\t\"io\"\n\t\"io/ioutil\"\n)\n\n// StaticPage is a static page.\ntype StaticPage struct {\n\tpageFields\n}\n\n// Static returns a bool indicating that the page is a static page.\nfunc (p *StaticPage) Static() bool { r... | go | edit | 9 | 2 | mit | 5853a141a52429783a7fc031b2c33fef4d8c58d5 | osteele/gojekyll,osteele/gojekyll,osteele/gojekyll,osteele/gojekyll | pages/staticpage.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"github.com/hatofmonkeys/cloudfocker/utils\"\n)\n\ntype RunConfig struct {\n\tContainerName string\n\tImageTag string\n\tPublishedPorts map[int]int\n\tMounts map[string]string\n\tCommand []strin... | go | edit | 0 | 1 | apache-2.0 | 6f24c2f9b2eb585b30f1cb3fa5e147875bbd0358 | CloudCredo/cloudrocker,agilemobiledev/cloudfocker,agilemobiledev/cloudfocker,agilemobiledev/cloudfocker,agilemobiledev/cloudfocker,CloudCredo/cloudrocker,agilemobiledev/cloudfocker,CloudCredo/cloudrocker,CloudCredo/cloudrocker,agilemobiledev/cloudfocker,CloudCredo/cloudrocker,CloudCredo/cloudrocker,CloudCredo/cloudrock... | config/run_config.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage python\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"sourcegraph.com/sourcegraph/toolchain\"\n)\n\nfunc runCmdLogError(cmd *exec.Cmd) {\n\terr := runCmdStderr(cmd)\n\tif err != nil {\n\t\tlog... | go | edit | 0 | 3 | mit | ce73256b8ecfdd14428bee5977c453906fc4148a | techdragon/srclib-python,techdragon/srclib-python,techdragon/srclib-python | python/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage edn\n\nimport . \"testing\"\n\nfunc TestEmptyGivesOnlyEOF(t *T) {\n\tlexer := Lex(\"\")\n\ttoken, _ := lexer.Next()\n\n\tif token.kind != tEOF {\n\t\tt.Error(\"expecting EOF\")\n\t}\n}\n\n// I suspect there's a potential race condition ... | go | edit | 21 | 4 | mit | 6c0ec2e1d08e054f13fb4e2988082b026b230ec1 | bjeanes/gojure,bjeanes/gojure | edn/lexer_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cli\n\nimport (\n\t\"os\"\n\n\tkingpin \"gopkg.in/alecthomas/kingpin.v2\"\n)\n\nfunc ExampleAddCommand() {\n\tos.Setenv(\"AWS_ACCESS_KEY_ID\", \"llamas\")\n\tos.Setenv(\"AWS_SECRET_ACCESS_KEY\", \"rock\")\n\tos.Setenv(\"AWS_VAULT_BACKEN... | go | edit | 6 | 2 | mit | 62003f275bbb631f05b88dfb1c8f44093d7b886d | 99designs/aws-vault,99designs/aws-vault | cli/add_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/jingweno/nut/vendor/_nuts/github.com/codegangsta/cli\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"nut\"\n\tapp.Usage = \"Vendor Go dependencies\"\n\tapp.Version = \... | go | edit | 3 | 2 | mit | 3d59cd3d80ac5fe0d9ab2af8519fb396687e6381 | jingweno/nut | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage myaws\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws\"\n\t\"github.com/aws/aws-sdk-go/service/ssm\"\n\t\"github.com/pkg/errors\"\n)\n\n// SSMParameterLsOptions customize the behavior of the ParameterGet command.\ntype SSMPa... | go | edit | 3 | 4 | mit | a31738e13391634abd5704035cc83733f6a776d6 | minamijoyo/myaws | myaws/ssm_parameter_ls.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\nconst aURL = \"http://artii.herokuapp.com\"\n\nfunc main() {\n\targs := os.Args[1:]\n\n\tif len(args) == 0 {\n\t\tfmt.Printf(\"Usage:\\n\")\n\t\tret... | go | edit | 0 | 3 | mit | 9fae8b28922bca7469dba400b6d945c259a78f70 | neslom/aart | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !integration\n\npackage esapi\n\nimport (\n\t\"testing\"\n)\n\nfunc TestAPIHelpers(t *testing.T) {\n\tt.Run(\"BoolPtr\", func(t *testing.T) {\n\t\tvar v *bool\n\n\t\tv = BoolPtr(false)\n\t\tif v == nil || *v != false {\n\t\t\tt.Errorf... | go | edit | 9 | 5 | apache-2.0 | de7f3824d378904828e3eb74e6ff109d6a519296 | elastic/go-elasticsearch,elastic/go-elasticsearch,elastic/go-elasticsearch,elastic/go-elasticsearch | esapi/esapi_internal_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage transport\n\nimport (\n\t\"time\"\n)\n\ntype Message struct {\n\tHeader map[string]string\n\tBody []byte\n}\n\ntype Socket interface {\n\tRecv(*Message) error\n\tSend(*Message) error\n\tClose() error\n}\n\ntype Client interface {\n\tR... | go | edit | 15 | 1 | apache-2.0 | 7868d5a2cbfe2b6c4d72dffa0852693b21f56f75 | myodc/go-micro,uffy/go-micro,Taik/go-micro,divisionone/go-micro,micro/go-micro | transport/transport.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage toscalib\n\ntype Playbook struct {\n\tAdjacencyMatrix Matrix\n\tIndex map[int]Play\n\tInputs map[string]PropertyDefinition\n\tOutputs map[string]Output\n}\n\ntype Play struct {\n\tNodeTemplate NodeTemplate\n\... | go | edit | 15 | 4 | apache-2.0 | 7e3d5535dde7ce18b28d3ee1b12ded170dcac792 | owulveryck/toscalib,owulveryck/toscalib | execution_plan.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !k8s\n\npackage k8s\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"k8s.io/client-go/rest\"\n)\n\nfunc getEmbedded(ctx context.Context) (context.Context, *rest.Config, error) {\n\treturn ctx, nil, fmt.Errorf(\"embedded support is not com... | go | edit | 0 | 1 | apache-2.0 | bf027fc600d3eba18358a1f7c0037448624db1f4 | rancherio/rancher,rancher/rancher,cjellick/rancher,rancher/rancher,rancher/rancher,cjellick/rancher,cjellick/rancher,rancher/rancher,rancherio/rancher | k8s/embedded_none.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2013-2014 Conformal Systems LLC.\n// Use of this source code is governed by an ISC\n// license that can be found in the LICENSE file.\n\n/*\nThis test file is part of the btcchain package rather than than the\nbtcchain_test pac... | go | edit | 12 | 1 | isc | e1c622c4cfd1bf2e27448a0f0940407d35022343 | ltcsuite/ltcd,cqswxj2013/btcd,jrick/btcd,jrick/btcd,jcmincke/dcrd,dajohi/btcd,toddfries/btcd,jimmysong/btcd,btcsuite/btcd,decred/dcrd,stevenroose/btcd,wallclockbuilder/btcd,davecgh/btcd,Stash-Crypto/btcd,danoctavian/btcd,adiabat/btcd,btcsuite/btcd,jrick/btcd,hectorj/btcd,stevenroose/btcd,pkothbauer/btcd,danoctavian/btc... | internal_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build lambdabinary,noop\n\npackage cgo\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/aws/aws-sdk-go/aws/credentials\"\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n\tsparta \"github.com/mweagle/Sparta\"\n)\n\n///////////////////////////////... | go | edit | 0 | 1 | mit | f24763d3ccb248ab488e8c54b3ed9f7cea800c41 | mweagle/Sparta,mweagle/Sparta,mweagle/Sparta,mweagle/Sparta | cgo/cgo_main_noop.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/glaslos/tlsh\"\n)\n\nvar (\n\t// VERSION is set by the makefile\n\tVERSION = \"v0.0.0\"\n\t// BUILDDATE is set by the makefile\n\tBUILDDATE = \"\"\n)\n\nfunc main() {\n... | go | edit | 0 | 5 | apache-2.0 | deb88ae0d23bbe747a6a1859fb106131c333d14c | glaslos/tlsh | app/tlsh.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mrepo\n\nimport (\n\t\"os/exec\"\n\t\"strings\"\n)\n\n//Make invoke make on the prj with the target as argument.\nfunc Make(prj, target string) (result string, err error) {\n\tcmd := exec.Command(\"make\", target)\n\tcmd.Dir = prj\n\tou... | go | edit | 0 | 1 | apache-2.0 | 865976fc72004dd9c082b19dcf76408aef8512aa | ericaro/sbr | make.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage caddytls\n\nimport (\n\t\"crypto/tls\"\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/http/httputil\"\n\t\"net/url\"\n\t\"strings\"\n)\n\nconst challengeBasePath = \"/.well-known/acme-challenge\"\n\n// HTTPChallengeHandler proxies chall... | go | edit | 3 | 6 | apache-2.0 | e641d2fd65a6772cda7e003d2a446789804352bc | tobya/caddy,cez81/caddy,devangels/caddy,elcore/caddy,yukimochi/caddy,yukimochi/caddy,captncraig/caddy,joshix/caddy,devangels/caddy,pyed/caddy,elcore/caddy,pyed/caddy,joshix/caddy,joshix/caddy,devangels/caddy,pyed/caddy,cez81/caddy,tobya/caddy,tobya/caddy,dusty/caddy,dusty/caddy,captncraig/caddy,tobya/caddy,pyed/caddy,y... | caddytls/httphandler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar output string\n\nfunc init() {\n\tflag.Usage = func() {\n\t\tfmt.Printf(\"Usage: %s [-out=out.path] in.path\\n\\n\", os.Args[0])\n\t\tflag.PrintDefaults()\n\t}\n\n\tflag.String... | go | edit | 0 | 3 | mit | 39cfbfe67a38039a90f6e0d14a14afedf16e5253 | konjoot/go-inspect | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\nimport \"github.com/stianeikeland/go-rpio\"\n\nfunc main() {\n\tfmt.Println(\"foo\")\n\n\terr := rpio.Open()\n\tdefer rpio.Close()\n}\n\n```\n\nApply this change: Set pin 18 high on request to open door"
},
{... | go | edit | 9 | 2 | apache-2.0 | 0adb8e284e81f6af3c9f42b44bef046485db25e1 | 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\t\"os\"\n\n\t\"github.com/github/hub/commands\"\n\t\"github.com/github/hub/github\"\n\t\"github.com/github/hub/ui\"\n)\n\nfunc main() {\n\tdefer github.CaptureCrash()\n\n\terr := commands.CmdRunner.Execute()\n\tif !er... | go | edit | 0 | 2 | mit | 97fbf4e4f685f6a7ed8acb3b09dd384da49eaad4 | github/hub,cpick/hub,github/hub,github/hub,cpick/hub,cpick/hub,github/hub | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\nimport (\n\t\"github.com/akutz/gofig\"\n)\n\nfunc init() {\n\tinitDrivers()\n\tgofig.Register(globalRegistration())\n\tgofig.Register(driverRegistration())\n}\n\nfunc globalRegistration() *gofig.Registration {\n\tr := gofig.NewR... | go | edit | 3 | 1 | apache-2.0 | d04023572e47e5c18fa549fe7f7de301e8470c63 | thecodeteam/rexray,codedellemc/rexray,oppodeldoc/rexray,cduchesne/rexray,akutz/rexray,codedellemc/rexray,cduchesne/rexray,clintonskitson/rexray,cduchesne/rexray,cduchesne/rexray,clintonskitson/rexray,oppodeldoc/rexray,akutz/rexray,emccode/rexray,thecodeteam/rexray,clintonskitson/rexray,codedellemc/rexray,emccode/rexray... | core/core.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage trog\n\ntype rawNode struct {\n\tId NodeId\n\tParentIds []NodeId // Every ancestor id, all the way up to the root\n\tChildIds []NodeId // Every direct child id of this node\n\tPairs []Pair // Key/value pairs\n\tFlags [... | go | edit | 15 | 3 | mit | 75eda8f5bc6edb8fbfa6a033d2b63f4a9e8e7503 | PieterD/crap,PieterD/crap | node.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Challenge 32 - Break HMAC-SHA1 with a slightly less artificial timing leak\n// http://cryptopals.com/sets/4/challenges/32\n\npackage cryptopals\n\nimport (\n\t\"crypto/sha1\"\n\t\"net/http\"\n\t\"time\"\n)\n\ntype challenge32 struct {\n}\n\n... | go | edit | 3 | 6 | mit | 51bc8619546d5deb61e73f428f42e4dfdb09ec60 | Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go | challenge32.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"log\"\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc TestParseConfig(t *testing.T) {\n\tinput := `\n queue \"test\" {\n type = \"test_type\"\n host = \"localhost\"\n port = 1234\n }\n`\n\texpect := config{\n... | go | edit | 12 | 3 | apache-2.0 | a8f977f5a09e3981f918dabc78b84028a03051a3 | smo921/kubeq | config/config_test.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\"log\"\n\t\"os\"\n\n\t\"github.com/FiloSottile/CVE-2016-2107/LuckyMinus20\"\n)\n\nfunc main() {\n\tres, err := LuckyMinus20.Test(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(\"Vulnerable:\"... | go | edit | 0 | 3 | mit | 7922c3be5fea76c32cc50a00f7d0f32817c19852 | FiloSottile/CVE-2016-2107 | main.go | rejected_duplicate | Near-duplicate of sample 117267 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nico\n\nimport \"strings\"\n\ntype Mail struct {\n\tIs184 bool\n}\n\nfunc (m Mail) String() string {\n\tvar strs []string\n\tif m.Is184 {\n\t\tstrs = append(strs, \"184\")\n\t}\n\treturn strings.Join(strs, \" \")\n}\n\n```\n\nApply this... | go | edit | 0 | 2 | mit | 9382cee6ae2d57c8b6f9e159f7ea88c7f7b4eac9 | 178inaba/lv-barrage | nico/mail.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage frame\n\nvar (\n\tV24CommonIDs = map[string]string{\n\t\t\"Title\": \"TIT2\",\n\t\t\"Artist\": \"TPE1\",\n\t\t\"Album\": \"TALB\",\n\t\t\"Year\": \"TYER... | go | edit | 0 | 0 | mit | 814a93a9f30b70213b5ae81b9f6276dbd9d265c3 | bogem/id3v2 | frame/v4.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\n\t\"gopkg.in/jcelliott/turnpike.v2\"\n)\n\nfunc main() {\n\tturnpike.Debug()\n\tc, err := turnpike.NewWebsocketClient(turnpike.JSON, \"ws://localhost:8000/\... | go | edit | 6 | 6 | mit | 4466a860c1e8c59d5d866e8d1165c15273d52d90 | jcelliott/turnpike,dcarbone/turnpike | examples/rpc/rpc-client/main.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport \"github.com/codegangsta/cli\"\n\nvar Commands = []cli.Command{\n\t{\n\t\tName: \"install\",\n\t\tShortName: \"i\",\n\t\tUsage: \"Install specific Note.js version\",\n\t\tAction: Install,\n\t},\n\t{\n\t\tName: ... | go | edit | 15 | 0 | mit | 707ead8b4f9dbecb7d98ac63d62125d2e91be340 | armed/nver | cmd/commands.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\nfunc main() {\n\tif len(os.Args) == 1 {\n\t\tfmt.Println(\"bad args\")\n\t\treturn\n\t}\n}\n\n```\n\nApply this change: Read hand and start card from command line"
},
{
"role": "assist... | go | edit | 0 | 4 | mit | 64faa63b2905e0bc84ea9d446490bcf126d5a756 | millere/cribbage,millere/cribbage,millere/cribbage | cribbage.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build integration\n\npackage memory\n\nimport (\n\t\"context\"\n\t\"runtime\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestMemoryAllocationAttack(t *testing.T) {\n\tassert := assert.New(t)\n\tvar siz... | go | edit | 0 | 1 | apache-2.0 | 8e011d250ef58cec6432025a823a86f722c8542a | slok/ragnarok,slok/ragnarok | attack/memory/alloc_integration_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2013 Jesse Allen. All rights reserved\n// Released under the MIT license found in the LICENSE file.\n\npackage main\n\nimport (\n\t\"flag\"\n\t\"html/template\"\n)\n\nvar (\n\tLayoutTemplateGlob = flag.String(\"layouts\", \"templat... | go | edit | 0 | 4 | mit | 2c0d6ad1e5b2a44a377e378f5f46d6313a17defd | lazyengineering/gobase,lazyengineering/gobase,lazyengineering/gobase | template.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package notifier contains types and methods for sending notifications\n// that a job has completed.\npackage notifier\n\nimport (\n\t\"io\"\n\t\"net/http\"\n)\n\n// To create notifications, an object has to have a destination in mind\n// and... | go | edit | 0 | 2 | mit | 1d1fe1050df8b666fe0f79be61b93338129977da | PeopleAdmin/pdfcombiner,PeopleAdmin/pdfcombiner,PeopleAdmin/pdfcombiner | notifier/notifier.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !linux\n\n/*\nCopyright 2016 The Kubernetes Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n ... | go | edit | 3 | 1 | apache-2.0 | 6ad82e5a30471a7421beb58242839cb835743fc1 | derekwaynecarr/kubernetes,weijinxu/kubernetes,njuicsgz/kubernetes-1,k82cn/kubernetes,gaocegege/kubernetes,Hui-Zhi/kubernetes,mkumatag/kubernetes,qiujian16/kubernetes,hartsock/kubernetes,medinatiger/kubernetes,marun/kubernetes,iterion/kubernetes,saad-ali/kubernetes,chrislovecnm/kubernetes,bluebreezecf/kubernetes,houming... | pkg/kubelet/dockershim/cm/container_manager_unsupported.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n// +build !ppc64,!ppc64le\n// run\n\n// Copyright 2015 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\n// Test that a -B option i... | go | edit | 0 | 2 | bsd-3-clause | a2cf0568e853a22a50110e43d5185a096f3145c6 | NunoEdgarGub1/go,constantine001/go,NichoZhang/go,gohin/go,danielsoro/go,vsekhar/elastic-go,vsekhar/elastic-go,zcwfeng/go,joshsammut/go,ifagnosticism/go,dafyddcrosby/go,Stan-Lin-/go,gdey/go,arschles/go-1,AALEKH/go,stormltf/go,yangzhongj/go,cainiaocome/go,greyhwndz/go,gohin/go,NunoEdgarGub1/go,chinanjjohn2012/go,JioCloud... | test/fixedbugs/issue10607.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage render\n\nimport (\n\t\"path/filepath\"\n\t\"testing\"\n\n\t\"github.com/oakmound/oak/fileutil\"\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestBatchLoad(t *testing.T) {\n\tfileutil.BindataDir = AssetDir\n\tfileutil.BindataFn ... | go | edit | 0 | 1 | apache-2.0 | f2d3d803865df6712a60f2c62109750e77ebc6b0 | oakmound/oak,oakmound/oak,oakmound/oak | render/loader_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fortunereader\n\nimport (\n \"testing\"\n \"reflect\"\n)\n\nfunc TestFortunes(t *testing.T) {\n var tests = []struct {\n input string\n expected []string\n } {\n { \"fortune\", []string{\"fortune\"} },\n... | go | edit | 3 | 3 | mit | fd6c0068aaccaf0757e61c41424434890cbab2aa | mhaligowski/fortunes-server | src/io.mhlg/fortunes/fortunereader/fortunereader_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage search\n\nimport (\n\t\"net/url\"\n\t\"strconv\"\n)\n\ntype search struct {\n\tKeyword string\n\tPagenation int\n\tSort string\n}\n\nfunc New(keyword string, sort string) *search {\n\treturn &search{\n\t\tKeyword: keyword,\n... | go | edit | 0 | 1 | apache-2.0 | 3b19428baf38b7687fafca985d1ba2929e59e18f | wataru0225/sreq | search/new_search.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mccli\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/codegangsta/cli\"\n\t\"github.com/materials-commons/config\"\n\t\"github.com/materials-commons/mcstore/server/mcstore\"\n)\n\nvar ShowCommand = cli.Command{\n\tName: \"show\",\n\tAliases... | go | edit | 0 | 1 | mit | 63f2b4c5ac8cc3cfdbe3ded9d34105b237519baa | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore | cmd/mccli/show_cmd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handler\n\nimport (\n\t\"github.com/Sirupsen/logrus\"\n\t\"github.com/unrolled/render\"\n)\n\nvar (\n\tl *logrus.Logger\n\toutput = render.New(render.Options{Layout: \"layout\"})\n)\n\nfunc SetLogger(logger *logrus.Logger) {\n\tl = logg... | go | edit | 0 | 1 | mit | 2dd289ac5b57a508437299ac72b1528c3f89b2b8 | mattbostock/leavediary | handler/main.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\t\"gopkg.in/ini.v1\"\n)\n\ntype ADFSConfig struct {\n\tUsername string `ini:\"user\"`\n\tPassword string `ini:\"pass\"`\n\tHostname string `ini:\"host\"`\n}\n\nfunc newADFSConfig() *ADFSConfig {... | go | edit | 12 | 8 | mit | 2c47d6ab1b9edc503d7a4513c8e7671b897a7505 | tmiller/auth-aws,tmiller/auth-aws | adfs_config.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\"strings\"\n)\n\nvar defaultFuncs = map[string]interface{}{\n\t\"str\": String,\n\t\"dec\": Decimal,\n\t\"eq\": Equal,\n}\n\nfunc String(v interface{}) string {\n\tswitch x := v.(type) {\n\tcase string:\... | go | edit | 3 | 3 | bsd-3-clause | 4ebb48349da687c59cc37206f681a3c2aca2cae9 | voxelbrain/jsonformat | funcs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\t\"onestepback.org/assert\"\n)\nimport \"strconv\"\n\ntype StringIo struct {\n\tdata string\n}\n\nfunc (self *StringIo) WriteString(s string) (int, error) {\n\tself.data += s\n\treturn 0, nil\n}\n\nfunc... | go | edit | 12 | 1 | mit | d131b74b0a3b0555e251eda3c490a0b92660c5d3 | jimweirich/gotags,jimweirich/gotags | src/onestepback.org/gotags/tag_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slug\n\nimport (\n\t\"code.google.com/p/go.text/unicode/norm\"\n\t\"regexp\"\n\t\"strings\"\n\t\"unicode\"\n)\n\n// don't even quote these\nvar _SKIP = []*unicode.RangeTable{\n\tunicode.Mark,\n\tunicode.Sk,\n\tunicode.Lm,\n}\n\nvar _SAF... | go | edit | 0 | 3 | mit | 6ffdaa50bb51c6fe78e0634a316c468a29f31941 | tv42/slug | slug.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage kvlog_test\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/gwatts/kvlog\"\n)\n\nfunc Example() {\n\tvar buf bytes.Buffer\n\n\tlog.SetOutput(&buf)\n\tlog.SetFormatter(\n\t\tkvlog.New(\n\t\t\tkv... | go | edit | 0 | 1 | mit | abbe90686d8f9b9a35097c07235e52259ea0f453 | gwatts/kvlog | example_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tjira \"github.com/andygrunwald/go-jira/v2/cloud\"\n)\n\nfunc main() {\n\tjiraURL := \"https://go-jira-opensource.atlassian.net/\"\n\n\t// Jira docs: https://support.atlassian.com/atlassian... | go | edit | 0 | 3 | mit | d86ceae7b1095c323eff4a4acd19462c32d7c987 | andygrunwald/go-jira | cloud/examples/basic_auth/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Challenge 37 - Break SRP with a zero key\n// http://cryptopals.com/sets/5/challenges/37\n\npackage cryptopals\n\nimport \"math/big\"\n\ntype challenge37 struct {\n}\n\nfunc (challenge37) Client(net Network) bool {\n\tA := big.NewInt(0)\n\n\t... | go | edit | 0 | 1 | mit | a0a835a901c83f9e781e73c34faab5d9337d9450 | Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go | challenge37.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\n// NOTE: install protoc as described on grpc.io before running go generate.\n\n//go:generate protoc -I. -I../../../vendor/ beam_fn_api.proto --go_out=Mbeam_runner_api.proto=github.com/apache/beam/sdks/go/pkg/beam/core/api/org_apa... | go | edit | 0 | 0 | apache-2.0 | 40d8111aab890a0de2a8674b0246ce1a8a76a560 | robertwb/incubator-beam,charlesccychen/beam,charlesccychen/incubator-beam,charlesccychen/beam,markflyhigh/incubator-beam,RyanSkraba/beam,chamikaramj/beam,charlesccychen/incubator-beam,lukecwik/incubator-beam,tgroh/beam,robertwb/incubator-beam,charlesccychen/beam,lukecwik/incubator-beam,apache/beam,robertwb/incubator-be... | pkg/beam/core/runtime/api/gen.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2019 The Skaffold Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org... | go | edit | 6 | 1 | apache-2.0 | f826c4bc4981d44eeecbf4c9e4d2dcdc182ef496 | GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold,GoogleContainerTools/skaffold | cmd/skaffold/app/skaffold_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/spf13/viper\"\n\n\t\"github.com/minamijoyo/myaws/cmd\"\n)\n\nfunc main() {\n\tif err := cmd.RootCmd.Execute(); err != nil {\n\t\tif viper.GetBool(\"debug\") {\n\t\t\tfmt.Printf(\"%... | go | edit | 0 | 3 | mit | 5002cb8535a0fbfd09ab79b7b850ea374842f967 | minamijoyo/myaws | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage collector\n\nimport (\n\t\"fullerite/metric\"\n\n\t\"net/http\"\n)\n\ntype errorHandler func(error)\ntype responseHandler func(*http.Response) []metric.Metric\n\ntype baseHTTPCollector struct {\n\tbaseCollector\n\n\trspHandler responseH... | go | edit | 15 | 3 | apache-2.0 | 808f26b9d76c0ed690a6256559c0dd0aa1c906f7 | qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect,qnib/QNIBCollect | src/fullerite/collector/http_generic.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage fzf\n\nconst (\n\t// Reader\n\tdefaultCommand = `find -L . -path '*/\\.*' -prune -o -type f -print -o -type l -print 2> /dev/null | sed s/^..//`\n)\n\n```\n\nApply this change: Use cut instead of sed in the default... | go | edit | 0 | 0 | mit | 3d74d277aa0446264240308e52df6f223cc2a8ed | junegunn/fzf,tomfitzhenry/pkg-fzf,tomfitzhenry/pkg-fzf,janlazo/fzf,junegunn/fzf,stuha/wbr-zsh,junegunn/fzf,infokiller/fzf,infokiller/fzf,wilywampa/fzf,janlazo/fzf,tomfitzhenry/pkg-fzf,janlazo/fzf,wilywampa/fzf,wilywampa/fzf,infokiller/fzf | src/constants_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tempfile\n\nimport (\n\t\"io/ioutil\"\n\t\"os\"\n\n\t\"github.com/stretchr/testify/require\"\n)\n\n// TempFile is a temporary file that can be used with unit tests. TempFile\n// reduces the boilerplate setup required in each test case b... | go | edit | 0 | 1 | apache-2.0 | 7865a018b5c3a4e1ea66cf27dc41c78a3de1c3dd | gotestyourself/gotestyourself,gotestyourself/gotestyourself | tempfile.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fileservice\n\nimport \"testing\"\n\nfunc TestPlaceholder(t *testing.T) {}\n\n```\n\nApply this change: Add test for NewLink() in fileservice package."
},
{
"role": "assistant",
"content": "package fileservice\n\nimport (\n\... | go | edit | 3 | 3 | apache-2.0 | 2928ede0960ce66901d418165558d66de38b5625 | pasinskim/deployments,pasinskim/deployments,pasinskim/deployments,pasinskim/deployments | models/fileservice/link_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n)\n\nfunc AddRightScriptMetadata(path string) error {\n\tscript, err := os.Open(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer script.Close()\n\n\t// check if metadata already exists\n\n\t// Load scri... | go | edit | 6 | 7 | mit | 93c5d186aa05632dfc3671bd9989befe9cf17637 | rightscale/right_st,rightscale/right_st | scaffold.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ami\n\n// Agents lists agents and their status.\nfunc Agents(client Client, actionID string) ([]Response, error) {\n\treturn requestList(client, \"Agents\", actionID, \"AgentsEntry\", \"AgentsComplete\")\n}\n\n// AgentLogoff sets an age... | go | edit | 12 | 1 | mit | 0482410d9d3e8b3c113872d5f97f1d79921d84d9 | heltonmarx/goami | ami/agent.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ast\n\n// TokenType is the type of tokem that will be returned by the Scanner.\ntype TokenType int\n\n// The following are the token types that are recognized by the scanner\nconst (\n\tEOF TokenType = iota\n\tComment\n\tSection\n\tWhit... | go | edit | 0 | 0 | mit | c782b8a68a1b8bd70e98c11167e1a761adca7cba | FarmRadioHangar/fessboxconfig,FarmRadioHangar/fessboxconfig | ast/token.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage env\n\nimport (\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/jinzhu/gorm/dialects/postgres\"\n\t_ \"github.com/lib/pq\"\n\t\"github.com/mattes/migrate\"\n\t\"github.com/mattes/migrate/database/postgres\"\n\t_ \"github.com/mattes/migr... | go | edit | 6 | 2 | mit | db6bcc601d9e052dba286ea470489375a491012e | droptheplot/rand_chat,droptheplot/rand_chat,droptheplot/rand_chat,droptheplot/rand_chat | env/env.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fbmodelsend\n\n/*\nLetter is a complete message to a Facebook user.\nWe use this name to refer a old letter because your message to be delivered\nit needed a sender, a reciever not only text in order to the mail company be\nable to find... | go | edit | 12 | 0 | apache-2.0 | fa85ea50e9b5af18a4633da1d016aa44f05882e1 | novatrixtech/go-fbmessenger | fbmodelsend/letter.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\"runtime\"\n\t\"time\"\n)\n\nconst MEGABYTE = 1024 * 1024\n\nfunc startRuntimeProfiler() {\n\tm := &runtime.MemStats{}\n\n\tfor {\n\t\truntime.ReadMemStats(m)\n\n\t\tfmt.Println(\"-----------------------\... | go | edit | 0 | 2 | mit | d3a6757d5ec57df5fb7b7ffc1f29451693d3162e | trigrass2/pgweb,w4ngyi/pgweb,freeformz/pgweb,adamjaso/pgweb,w4ngyi/pgweb,akarki15/pgweb,xiongjungit/pgweb,w4ngyi/pgweb,trigrass2/pgweb,freeformz/pgweb,beni55/pgweb,cmabastar/pgweb,sosedoff/pgweb,sosedoff/pgweb,akarki15/pgweb,brianlow/pgweb,trigrass2/pgweb,cmabastar/pgweb,cmabastar/pgweb,brianlow/pgweb,hardware/pgweb,ni... | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage test\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"io\"\n\t\"net/http\"\n\n\t\"github.com/labstack/echo\"\n)\n\ntype testForm struct {\n\tName string\n\tDesc string\n}\n\nfunc Context(req *http.Request, res http.ResponseWriter, r i... | go | edit | 0 | 2 | mit | 5dc838ca8c7100e44290ed77640a57da23a6aa7a | konjoot/reeky | test/helpers.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gotumblr\n\ntype BasePost struct {\n\tBlog_name string\n\tId int64\n\tPost_url string\n\tPostType string `json:\"type\"`\n\tTimestamp int64\n\tDate string\n\tFormat string\n\tReblog_key string\n\t... | go | edit | 0 | 0 | apache-2.0 | 4575d2c544f98590bc75fb019536adde973859c0 | MariaTerzieva/gotumblr | base_post.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage eventmon\n\nconst (\n\tConnectString = \"200 Connected to keymaster eventmon service\"\n\tHttpPath = \"/eventmon/v0\"\n\n\tEventTypeSSHCert = \"SSHCert\"\n\tEventTypeX509Cert = \"X509Cert\"\n)\n\n// Client sends no data. Server se... | go | edit | 0 | 0 | apache-2.0 | ccdf7a7c68492c624fbb4de6378230d9a5ff59ed | rgooch/keymaster,Symantec/keymaster,rgooch/keymaster,Symantec/keymaster,Symantec/keymaster,rgooch/keymaster | proto/eventmon/messages.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cloudwatch\n\nimport (\n\t\"math/rand\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/Pallinder/go-randomdata\"\n\t\"github.com/gliderlabs/logspout/router\"\n)\n\nconst NumMessages = 25000000\n\nfunc TestCloudWatchAdapter(t *testing.T) {... | go | edit | 6 | 4 | mit | 9a3d826cd39063bf06e42f3bdf93505a58b3e710 | bradgignac/logspout-cloudwatch,bradgignac/logspout-cloudwatch | cloudwatch_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\nimport \"time\"\n\ntype TimeSeriesPayload struct {\n\tThing string `json:\"thing\"`\n\tThingType string `json:\"thingType\"`\n\tPromoted bool `json:\"promoted\"... | go | edit | 3 | 3 | mit | 41789c7104c75923441b5d34d6ce544e7df6eeed | ninjasphere/go-ninja,ninjasphere/go-ninja | model/ts.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage typhon\n\nimport (\n\t\"context\"\n\t\"strconv\"\n\t\"time\"\n\n\t\"github.com/monzo/terrors\"\n)\n\nfunc TimeoutFilter(defaultTimeout time.Duration) Filter {\n\treturn func(req Request, svc Service) Response {\n\t\ttimeout := defaultTi... | go | edit | 12 | 4 | mit | f5d17571e3cfe8bd2b41367ff231ab2c7a738e00 | monzo/typhon | timeout.go | rejected_lint | Too many lint violations: 12 | 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 TestInterviewUser(t *testing.T) {\n\tt.Skipf(\"Racy!\")\n\tvar (\n\t\tserver ... | go | edit | 0 | 4 | mit | 5a937ec7881ac63392293330853418f61912f110 | spring1843/chat-server | src/chat/server_conn_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/app\"\n\t\"github.com/BytemarkHosting/bytemark-client/cmd/bytemark/commands/admin\"\n\t\"github.com/urfave/cli\"\n)\n\nfunc generateHelp([]cli.Command) {\n\tf... | go | edit | 9 | 4 | mit | b3b5e935e841193fb4656167f4af6d6fed7043e9 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | cmd/bytemark/generate_help.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\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n\t\"github.com/codegangsta/cli\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"nsinit\"\n\tapp.Version = \"2\"\n\tapp.Author = \"libcontainer maintainers\"... | go | edit | 24 | 4 | apache-2.0 | fa9efe82f9ace4e3f11325e527c2d8759afc7101 | keloyang/libcontainer,HuKeping/runc,ycaihua/runc,stefanberger/runc,BrickXu/libcontainer,boucher/runc,wcwxyz/runc,LK4D4/runc,willmtemple/runc,adrianreber/runc,kimh/runc,navidshaikh/runc,talwai/runc,ZJU-SEL/libcontainer,crosbymichael/libcontainer,albertoleal/runc,rhatdan/runc,mheon/runc,clnperez/runc,balajibr/runc,calave... | nsinit/main.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\"fmt\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/nicksnyder/go-i18n/i18n\"\n\tmylog \"github.com/patrickalin/GoMyLog\"\n\t\"github.com/spf13/viper\"\n)\n\nfunc TestSomething(t *testing.T) {\n\tviper.SetConfigName(\... | go | edit | 0 | 2 | apache-2.0 | f514130e12b0caf01f55069cf3c4dba5b5aa1d3f | patrickalin/bloomsky-client-go,patrickalin/bloomsky-client-go,patrickalin/bloomsky-client-go | main_test.go | rejected_duplicate | Near-duplicate of sample 117455 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2013-2014 by Michael Dvorkin. All Rights Reserved.\n// Use of this source code is governed by a MIT-style license that can\n// be found in the LICENSE file.\n\npackage main\n\nimport (\n\t`github.com/michaeldv/donna`\n\t`os`\n)... | go | edit | 0 | 3 | mit | 4d034e0a38dc64bf5b5e776217638442e70b0e31 | michaeldv/donna,michaeldv/donna | cmd/donna.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright © 2016 The Things Network\n// Use of this source code is governed by the MIT license that can be found in the LICENSE file.\n\npackage types\n\n// LocationMetadata contains GPS coordinates\ntype LocationMetadata struct {\n\tAltitud... | go | edit | 0 | 0 | mit | 348063da18fd9396bb0de1595fb4278c9c5a0a24 | TheThingsNetwork/ttn,mgranberry/ttn,mgranberry/ttn,mgranberry/ttn,TheThingsNetwork/ttn,jvanmalder/ttn,TheThingsNetwork/ttn,jvanmalder/ttn,jvanmalder/ttn | core/types/location_metadata.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"flag\"\n\n\t\"github.com/vharitonsky/iniflags\"\n)\n\nvar (\n\tName = flag.String(\"name\", \"tad\", \"Nick to use in IRC\")\n\tServer = flag.String(\"server\", \"127.0.0.1:6668\", \"Host:Port to connect to... | go | edit | 0 | 1 | unlicense | b101f3a69614b9ad11616d4ab0dd72b066b99bd2 | smotti/cfengine-tad | config/config.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\n\tmetrics \"github.com/rcrowley/go-metrics\"\n)\n\ntype ChanGroup struct {\n\tName string\n\tpoints []chan []interface{}\n\tdepthGauges []metrics.Gauge\n}\n\nfunc NewChanGroup(name ... | go | edit | 12 | 3 | apache-2.0 | e37e1e4db476d391eb88c15bf4ae19f35d957bf1 | akkakks/lumbermill,octanner/lumbermill,getlantern/lumbermill,heroku/lumbermill,msiebuhr/lumbermill-prometheus | changroup.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage datalayer\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n\t\"regexp\"\n)\n\nconst MAX_VOLUME_NAME_LENGTH int = 40\n\n// ClusterHQ data layer, naive vfs (directory-based) implementation\n\nfunc ValidVolumeName(volumeName string) bool {\n\tv... | go | edit | 0 | 2 | apache-2.0 | 0beef6dce9e593adc213ee9493669a18bc64cc2f | ClusterHQ/dvol,ClusterHQ/dvol,ClusterHQ/dvol | datalayer/datalayer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Google Inc. 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\n//\n/... | go | edit | 0 | 1 | apache-2.0 | ee372f5cd446777a7a64b65af98f7b8fc8f8caf9 | vin/dashboard,cheld/dashboard,batikanu/dashboard,digitalfishpond/dashboard,tangfeixiong/dashboard,luxas/dashboard,cheld/dashboard,rf232/dashboard,SebastianM/dashboard,taimir/dashboard,batikanu/dashboard,f-higashi/dashboard,floreks/dashboard,floreks/dashboard,cnwalker/dashboard,floreks/dashboard,vlal/dashboard,titilambe... | src/app/backend/console.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sel\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\t\"flag\"\n\t\"fmt\"\n\t\"link-select/types\"\n)\n\nfunc SelectLink(arg *flag.Flag) {\n\tfmt.Fprintf(os.Stdout, \"Selecting %s from json file\\n\", arg.Value)\n\n\treadFile, err := os.Ope... | go | edit | 0 | 3 | mit | 040945562fe7d0502a38043f18fcd135b69603d1 | danielkocher/link-select | sel/sel.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sirius\n\nimport (\n\t\"time\"\n)\n\ntype Execution struct {\n\tExt Extension\n\tMsg Message\n\tCfg ExtensionConfig\n}\n\ntype ExecutionResult struct {\n\tErr error\n\tAction MessageAction\n}\n\ntype ExtensionRunner interface {\n\tRu... | go | edit | 15 | 5 | mit | 0cbd47541910c6c89879c745a535c0fa6dd78460 | kayex/sirius | execution.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Write go code for the following: Define methods needed on Robot"
},
{
"role": "assistant",
"content": "package robotname\n\ntype Robot struct {\n\tname string\n}\n\nfunc (r *Robot) Name() (name string, err error) {\n\treturn r.name, nil\n}\n\nfunc (r *Robot) Reset()... | go | new_file | 0 | 1 | mit | 4ac8b346023ea66a442fc23d5c47089b9909fef0 | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/robot-name/robot_name.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"testing\"\n)\n\nfunc TestTruth(t *testing.T) {\n if t == nil {\n t.Fatalf(\"truth fails\")\n }\n}\n\n```\n\nApply this change: Add runtime data to test output."
},
{
"role": "assistant",
"content":... | go | edit | 3 | 2 | mit | a5341f77a21a3ca96be63a92e81395cd7a2270a2 | bpo/travis-testing | main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage machineid_test\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/denisbrodbeck/machineid\"\n)\n\nfunc Example() {\n\tid, err := machineid.ID()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tfmt.Println(id)\n}\n\n```\n\nApply this chan... | go | edit | 0 | 2 | mit | b39571d9fdd81e86328031ceb7b98e4fe477dd64 | denisbrodbeck/machineid | example_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pqx\n\nimport (\n\t\"testing\"\n)\n\nfunc TestConnect(t *testing.T) {\n\tconn, err := Connect(map[string]string{\"socket\": \"/private/tmp/.s.PGSQL.5432\"})\n\tif err != nil {\n\t\tt.Fatal(\"Unable to establish connection\")\n\t}\n\n\ti... | go | edit | 6 | 6 | mit | 86099237bd8a792bbc2a88b9cdd1210a71276b1d | plopik/pgx,plopik/pgx,deoxxa/pgx,silviucm/pgx,rsto/pgx,plopik/pgx,silviucm/pgx,kelvich/pgx,silviucm/pgx,jackc/tern,jackc/tern-deb,jackc/pgx,josephglanville/pgx,jackc/pgx,jackc/pgx,jonasi/pgx,axsy-dev/tern,jackc/pgx | conn_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\"database/sql\"\n\t_ \"github.com/go-sql-driver/mysql\"\n\n\t\"log\"\n)\n\nfunc dbConnection() {\n\tdb, err := sql.Open(\"mysql\",\n\t\t\"root:@tcp(127.0.0.1:3306)/blog\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}... | go | edit | 0 | 2 | mit | 161a2bf9bf0bf6024d3ee4a9b9eb74fb07c915cf | nicholasrucci/blog,nicholasrucci/blog,nicholasrucci/blog | db.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.