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 window\n\n/*\n#cgo darwin CFLAGS: -F/Library/Frameworks -D_GOSMF_OSX_\n#cgo darwin LDFLAGS: -F/Library/Frameworks -framework SDL2\n\n#cgo linux CFLAGS: -D_GOSMF_LINUX_\n#cgo linux LDFLAGS: -lSDL2main -lSDL2\n\n#cgo windows CFLAG... | go | edit | 0 | 0 | mit | 4c24eac9bfe4c21ac6a65c3d06ec442b685471f2 | anthonyrego/gosmf,anthonyrego/dodge | window/build.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestTrackIgnoreString(t *testing.T) {\n\ttrack := &Track{\n\t\tIgnorePatterns: []string{\n\t\t\t\"con[.]txt\",\n\t\t\t\"pro.f\",\n\t\t},... | go | edit | 3 | 2 | mit | a4a50f8a69a72689b1700e4a1f9031e8ed9dab3d | exercism/cli,exercism/cli | config/track_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage regex\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"cirello.io/gochatbot/bot\"\n)\n\nvar regexRules = []regexRule{\n\t{\n\t\t`{{ .RobotName }} jump`, `tells the robot to jump`,\n\t\tfunc(bot bot.Self, msg string, matches []string) []string ... | go | edit | 3 | 5 | mit | e1f719daee0790811f8f22c6f304396b1f6c309e | ccirello/gochatbot,ccirello/gochatbot,ccirello/gochatbot | rules/regex/rules.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage allyourbase\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc ConvertToBase(inputBase int, inputDigits []int, outputBase int) (outputDigits []int, e error) {\n\tbase10 := getBase10Input(inputBase, inputDigits)\n\tif base10 == 0 {\n\t\tretur... | go | edit | 0 | 4 | mit | 09971f297453cc7a98e8fb6058c265efdee02c44 | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/all-your-base/all_your_base.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package thread is designed for manage OS thread parameters. Usually you\n// need to call runtime.LockOSThread before use it.\n//\n// Only String methods allocates memory (mainly because using of fmt package)\n// so don't use them when GC is ... | go | edit | 0 | 2 | bsd-3-clause | f23f229f4583cf0e5e0aab4cd265023ba7f525bb | ziutek/thread | thread_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ws2801_test\n\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t. \"github.com/declanshanaghy/bbqberry/ws2801\"\n)\n\nvar _ = Describe(\"WS2801\", func() {\n\tvar (\n\t\tstrand Strand\n\t)\n\n\tBeforeEach(fu... | go | edit | 30 | 1 | apache-2.0 | 22ac3679c9ffa3e7dd0ea0f90c4aea6b93e56b9a | declanshanaghy/bbqberry,declanshanaghy/bbqberry,declanshanaghy/bbqberry,declanshanaghy/bbqberry | ws2801/ws2801_test.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gist8065433\n\nimport \"net\"\n\n// GetPublicIps returns a string slice of non-loopback IPs.\nfunc GetPublicIps() (publicIps []string, err error) {\n\tifis, err := net.Interfaces()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _... | go | edit | 0 | 8 | mit | 241f8379347845280c5ae1d6d8947103ea9abe28 | shurcooL/go | gists/gist8065433/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\t\"flag\"\n\t\n\t\"github.com/golang/glog\"\n\t\n\t\"github.com/asobti/kube-monkey/config\"\n\t\"github.com/asobti/kube-monkey/kubemonkey\"\n)\n\nfunc glogUsage() {\n fmt.Fprintf(os.Stderr,... | go | edit | 0 | 2 | apache-2.0 | 338564c0fff2f3e67890d163093b7cbd78e4bfc9 | asobti/kube-monkey | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage melrose\n\nimport \"time\"\n\ntype Playable interface {\n\tPlay(Player, time.Duration)\n}\n\ntype Player interface {\n\tPlayNote(Note, time.Duration)\n\tPlaySequence(Sequence, singleNoteDuration time.Duration)\n}\n\n```\n\nApply this ch... | go | edit | 6 | 0 | mit | 85bb2a28c949625e96d9d6b8c7d08f958cebcb1f | emicklei/melrose | playable.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage bamstats\n\nimport (\n\t\"encoding/json\"\n\t\"os\"\n\n\tlog \"github.com/Sirupsen/logrus\"\n)\n\nfunc check(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc max(a, b uint32) uint32 {\n\tif a < b {\n\t\treturn b\n\t}\... | go | edit | 0 | 2 | bsd-3-clause | 2dad7e6a75806d1cc903b083b4c3ed69ab949764 | guigolab/bamstats,guigolab/bamstats | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"log\"\n\t\"strconv\"\n\n\t\"git.astuart.co/andrew/limio\"\n)\n\nvar t = flag.String(\"t\", \"search\", \"the type of search to perform\")\nvar rl = flag.String(\"r\", \"\", \"the rate limit\")\nvar nc =... | go | edit | 0 | 7 | mit | 2c39fd0fc4e9a245bb3984bcfd38f333c6eaafc0 | andrewstuart/dlite | flag.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"os\"\nimport \"github.com/codegangsta/cli\"\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"exercism\"\n\tapp.Usage = \"fight the loneliness!\"\n\tapp.Action = func(c *cli.Context) {\n\t\tprintln(\"Hello friend!... | go | edit | 0 | 1 | mit | 3165608fb29d17d33ebeb88095e8d4c801b7ed68 | lcowell/cli,arvidsaur/cli,exercism/cli,Tonkpils/cli,Tonkpils/cli,yeah-right/cli,arvidsaur/cli,yeah-right/cli,Tonkpils/cli,neslom/cli,lcowell/cli,neslom/cli,zabawaba99/cli,exercism/cli,lcowell/cli,yeah-right/cli,arvidsaur/cli,zabawaba99/cli,zabawaba99/cli,neslom/cli | src/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage s3\n\nimport (\n\t\"testing\"\n\n\t\"github.com/rlmcpherson/s3gof3r\"\n\t\"polydawn.net/repeatr/input/tests\"\n\t\"polydawn.net/repeatr/lib/guid\"\n\t\"polydawn.net/repeatr/output/s3\"\n)\n\nfunc TestCoreCompliance(t *testing.T) {\n\tif... | go | edit | 0 | 2 | apache-2.0 | b0a8d01e9708f2c90130ad8163ac75247ac14e96 | polydawn/repeatr,subuser-security/repeatr,kkroening/repeatr,polydawn/repeatr,kkroening/repeatr,subuser-security/repeatr | input/s3/s3_input_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t\"github.com/flynn/go-flynn/migrate\"\n\t\"github.com/flynn/go-flynn/postgres\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lmicroseconds | log.Lshortfile)\n\n\tdb, err :... | go | edit | 0 | 4 | bsd-3-clause | e903b18af1f3a3947e56fd59de90f16c6d75bcfa | flynn-examples/go-flynn-example,yunfanapp/go-flynn-example | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"math/rand\"\nimport \"time\"\n\nconst DEFAULT_AD_CHANCE = 85\n\ntype Plug struct {\n\tID int\n\tS3ID string\n\tOwner string\n\tViewsRemaining int\n}\n\nfunc (p Plug) IsDefault() bool {\n\t... | go | edit | 0 | 5 | mit | 517c75bbc0175398cfff84342040e63b54016b9f | liam-middlebrook/csh-plug | plug.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage buildah\n\nimport (\n\t\"os/user\"\n\t\"strconv\"\n\n\t\"github.com/opencontainers/runtime-spec/specs-go\"\n)\n\n// TODO: we should doing these lookups using data that's actually in the container.\nfunc getUser(username string) (specs.U... | go | edit | 9 | 5 | apache-2.0 | 5b7aa1add5567b64bcaf4a247d732acaec55077d | projectatomic/buildah,rhatdan/buildah,TomSweeneyRedHat/buildah,ipbabble/buildah,projectatomic/buildah,ipbabble/buildah,TomSweeneyRedHat/buildah,nalind/buildah-1,nalind/buildah-1,nalind/buildah-1,nalind/buildah,projectatomic/buildah,TomSweeneyRedHat/buildah,rhatdan/buildah,nalind/buildah,rhatdan/buildah | user.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tools\n\nimport (\n\t\"gopkg.in/mgo.v2\"\n\t\"fmt\"\n\t\"errors\"\n)\n\ntype SessionConf struct {\n\tHosts []string\n\tDatabase string\n}\n\nvar (\n\tsession *mgo.Session\n)\n\nfunc InitSession(conf SessionConf) *mgo.Session {\n\tvar... | go | edit | 9 | 2 | apache-2.0 | 14692307d99ad47f6cdc7b00cdb66dad8c6971dc | kalcok/jc | tools/session.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\npackage parallel\n\nimport (\n\t\"fmt\"\n)\n\nfunc ExampleFanOutIn() {\n\t... | go | edit | 6 | 3 | apache-2.0 | 558cc60452da006f956fb2da6e2778df2b9cc9aa | luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go | common/parallel/parallel_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\"errors\"\n\t\"log\"\n\n\t\"github.com/mattn/go-mastodon\"\n\t\"github.com/urfave/cli\"\n)\n\nfunc cmdToot(c *cli.Context) error {\n\tif !c.Args().Present() {\n\t\treturn errors.New(\"arguments required\")\n\t}\n\n\... | go | edit | 9 | 4 | mit | effa489b8a1bf052bc897458d3e7e2528353076c | mattn/go-mastodon,178inaba/go-mastodon,mattn/go-mastodon | cmd/mstdn/cmd_toot.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2012 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// +build solaris\n\n// Sockets for Solaris\n\npackage net\n\nimport (\n\t\"sys... | go | edit | 0 | 1 | bsd-3-clause | 24ebe73ed5c7e7a13dccf3c069440b67f5bdcad8 | qskycolor/gofrontend,anlhord/gofrontend,golang/gofrontend,golang/gofrontend,anlhord/gofrontend,anlhord/gofrontend,golang/gofrontend,anlhord/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,anlhord/gofrontend,qskycolor/gofrontend,golang/... | libgo/go/net/sock_solaris.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\nimport (\n\t\"github.com/guregu/null\"\n)\n\n// Subscription represents user's notification settings.\ntype Subscription struct {\n\tID int `json:\"id\"`\n\tUserID null.Int `json:\"user_id\"`\n\tProjectUUID s... | go | edit | 3 | 0 | mit | 2ec46e98aee6122f629401bb40c06c1a5f3556a7 | torinos-io/api,torinos-io/api | type/model/subscription.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\"os\"\n\n\t\"code.google.com/p/go-uuid/uuid\"\n\t\"github.com/jsgoecke/nest\"\n\t\"gopkg.in/yaml.v2\"\n)\n\nvar thermostat *nest.Thermostat\n\ntype NestConf struct {\n\tProductid stri... | go | edit | 3 | 5 | mit | ae5a619e10dcd2324f26e11d00e7bae5269f4ec4 | guildencrantz/ask_nest,guildencrantz/ask_nest | nest.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage editor\n\nimport (\n\t\"bytes\"\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/elpinal/coco3/config\"\n)\n\ntype testScreen struct {\n}\n\nfunc (ts *testScreen) Refresh(prompt string, s []rune, pos int) {\n}\n\nfunc (ts *testScreen) Se... | go | edit | 6 | 5 | mit | d070bd6b739a30f8efe4b20363ba1adc5ece0531 | elpinal/coco3 | editor/editor_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !js\n\npackage model\n\nimport (\n\t\"context\"\n\n\t\"github.com/flimzy/kivik\"\n\t_ \"github.com/flimzy/kivik/driver/memory\" // Memory driver\n)\n\nfunc localConnection() (kivikClient, error) {\n\tc, err := kivik.New(context.Backgr... | go | edit | 12 | 2 | mit | ad63b9c0275dff00bdbdceed7e724295bbf0e943 | FlashbackSRS/flashback,flimzy/flashback,flimzy/flashback,FlashbackSRS/flashback,flimzy/flashback,FlashbackSRS/flashback | model/model_nonjs.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\"polydawn.net/dockctrl/confl\"\n\t\"polydawn.net/dockctrl/crocker\"\n)\n\n/*\n\tHelps run anything that requires a docker connection.\n\tHandles creation & cleanup in one place.\n\tDocker daemon config ... | go | edit | 0 | 2 | apache-2.0 | 5f1b48afb2f772e2967bb7aa8c3743de5c8b6c47 | polydawn/hroot,polydawn/hroot | main/common.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage storageconsul\n\nimport (\n\t\"github.com/caddyserver/caddy/v2\"\n\t\"github.com/caddyserver/certmagic\"\n)\n\ntype TLSConsul struct {\n\tstorage *ConsulStorage\n}\n\nfunc init() {\n\tcaddy.RegisterModule(TLSConsul{})\n}\n\nfunc (TLSCon... | go | edit | 15 | 2 | apache-2.0 | 46506118c33c960d82d87a822c3ac99dfaeaa494 | pteich/caddy-tlsconsul | main.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\"github.com/buchgr/bazelremote/cache\"\n)\n\n// TODO: Add command line flags\n\nfunc main() {\n\te := cache.NewEnsureSpacer(0.8, 0.5)\n\th := cache.NewHTTPCache(\":8080\", \"/Users/buchgr/cache\", 10*1024*1024, e)\n... | go | edit | 0 | 2 | apache-2.0 | b02341bcf440acf5f1a8c89e14de035e8da65946 | buchgr/bazel-remote,buchgr/bazel-remote | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage steamapi\n\nimport (\n\t\"net/url\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype playerBansJSON struct {\n\tPlayers []PlayerBan\n}\n\n// PlayerBan contains all ban status for community, VAC and economy\ntype PlayerBan struct {\n\tSteamID ... | go | edit | 3 | 3 | mit | f76533cb653a281b68473f14d7ee9bebea9ba48a | Philipp15b/go-steamapi | bans.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n\t\"github.com/aws/aws-sdk-go/service/cloudwatchevents\"\n)\n\nfunc main() {\n\tvar apply bool\n\tvar dryrun bool\n\tvar file string\n\n\tflag.BoolV... | go | edit | 12 | 3 | mit | 63c68d4b2de4b6cccab1d16472efe9d7bd7e3f7f | unasuke/maekawa | main.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage meep\n\nfunc Try(fn func(), plan TryPlan) {\n\tdefer func() {\n\t\tif err := coerce(recover()); err != nil {\n\t\t\tplan.MustHandle(err)\n\t\t}\n\t}()\n\tfn()\n}\n\nfunc coerce(rcvrd interface{}) error {\n\tswitch err := rcvrd.(type) {\... | go | edit | 12 | 3 | apache-2.0 | 2856f7cfb5abe5a4dd55b57e4dd21ad260711aad | polydawn/meep,polydawn/meep | try.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage validate\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"path\"\n\n\t\"github.com/gobuffalo/packr\"\n\t\"github.com/xeipuuv/gojsonschema\"\n)\n\n// ValidateJSON is used to check for validity\nfunc ValidateJSON(doc string) bool {\n\n\tf... | go | edit | 0 | 4 | apache-2.0 | aa7d88fe8939fd5f494827509e18be9dc8ab1a6a | resumic/schema,resumic/schema | cmd/resumic/validate/validator.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tmdb\n\nimport (\n\t. \"gopkg.in/check.v1\"\n)\n\nfunc (s *TmdbSuite) TestConfiguration(c *C) {\n\tresult, err := s.tmdb.Configuration()\n\ts.baseTest(&result, err, c)\n\tc.Assert(result.Images.BaseURL, Equals, \"http://image.tmdb.org/t... | go | edit | 15 | 1 | mit | 2055ca4715326e78bb1d670aaefc3b0c82e01dfd | ryanbradynd05/go-tmdb,ryanbradynd05/go-tmdb,ryanbradynd05/go-tmdb | configuration_test.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\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"path/filepath\"\n)\n\nconst FILE string = \"Makefile\"\nconst PROG string = \"make\"\n\n/* TODO:\nadd stopping at homedir\nconfigurable filename for aliases?\n*/\nfunc... | go | edit | 0 | 5 | mit | 635dfa6a30f9227809296d528839dbca10a36b19 | wnh/home.bin | cmd/mk/mk.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// The census package is used to query data from the census API.\n//\n// It's centered more so around data from Planetside 2\npackage census\n\nimport (\n\t\"strings\"\n)\n\nvar BaseURL = \"http://census.daybreakgames.com/\"\nvar BaseURLOld = \... | go | edit | 0 | 2 | mit | 6428a6cfc41e39fbc377f4182b80be28bd3dffef | THUNDERGROOVE/census | census.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage eparser\n\nimport (\n\t\"testing\"\n)\n\nfunc TestLex(t *testing.T) {\n\tl := newLexer()\n\tres, errs := l.Lex(\"a **= (7 ** (3 + 4 - 2)) << 1.23 % 0.3\")\n\texpected := []tokenType{\n\t\tIDENT, POW_EQ, LPAREN, INT, POW, LPAREN, INT, AD... | go | edit | 15 | 4 | mit | a2b8d636f3207a7d27b2f9512c5185d269936e2d | soudy/eparser,sodoz/mathcat,soudy/mathcat | lexer_test.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n Copyright The containerd Authors.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://w... | go | edit | 0 | 1 | apache-2.0 | ad8e5980606c5e4bc1bc1a140ddc24f2a626969c | containerd/containerd,mikebrow/containerd,containerd/containerd,estesp/containerd,thaJeztah/containerd,mikebrow/containerd,thaJeztah/containerd,estesp/containerd | oci/mounts_freebsd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/larzconwell/moln/config\"\n\t\"github.com/larzconwell/moln/loggers\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc main() {\n\tenv := \"development\"\n\tif len(os.Args) > 1 {\n\t\tenv = os.Args[1]... | go | edit | 0 | 7 | mit | 8366af8a08f06687fa9538154c70209497fd1cc5 | larzconwell/moln,larzconwell/moln | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gmws\n\nimport (\n\t\"os\"\n\n\t\"github.com/svvu/gomws/mwsHttps\"\n)\n\n// MwsConfig is configuraton to create the gomws base.\n// AccessKey and SecretKey are optional, bette to set them in evn variables.\ntype MwsConfig struct {\n\tSe... | go | edit | 0 | 1 | mit | 4ce854b81fe1c3731952a4885845f647f425aed9 | ShijunWu/gomws,svvu/gomws | gmws/gmws.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"errors\"\n\t\"sync\"\n)\n\ntype ClientPool struct {\n\tmutex sync.RWMutex\n\tclients map[string]*Client\n}\n\nfunc NewClientPool() *ClientPool {\n\tp := new(ClientPool)\n\tp.clients = make(map[string]*Client)\n... | go | edit | 9 | 2 | mit | 386a6a88c80998a3214af9001935eb5335fd7fc6 | MStoykov/mazungumzo | server/client_pool.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pack\n\nimport (\n\t\"errors\"\n\t\"restic/backend\"\n)\n\n// Loader loads data from somewhere at a given offset. In contrast to\n// io.ReaderAt, off may be negative, in which case it references a position\n// relative to the end of the... | go | edit | 0 | 4 | bsd-2-clause | a5cbbb8b5ac8b133ca943888c58edfe4502067ae | restic/restic,kurin/restic,byo/restic,middelink/restic,jayme-github/restic,restic/restic,stuertz/restic,fawick/restic,kurin/restic,ckemper67/restic,ar-jan/restic,arithmetric/restic,jayme-github/restic,fawick/restic,stuertz/restic,middelink/restic,ar-jan/restic,byo/restic | src/restic/pack/loader.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage image\n\nimport (\n\t\"path\"\n\t\"strings\"\n\n\t\"github.com/rancher/rancher/pkg/settings\"\n)\n\nfunc Resolve(image string) string {\n\treg := settings.SystemDefaultRegistry.Get()\n\tif reg != \"\" && !strings.HasPrefix(image, reg) {... | go | edit | 0 | 4 | apache-2.0 | 3d4176df547cf7a4dceca5e488cc283681065364 | cjellick/rancher,rancher/rancher,rancher/rancher,rancherio/rancher,rancher/rancher,rancher/rancher,rancherio/rancher,cjellick/rancher,cjellick/rancher | pkg/image/resolve.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n\n\tc \"github.com/flynn/flynn/Godeps/_workspace/src/github.com/flynn/go-check\"\n\t\"github.com/flynn/flynn/pkg/exec\"\n)\n\ntype PostgresSuite struct {\n\tHelper\n}\n\nvar _ = c.ConcurrentSuite(&Postgres... | go | edit | 12 | 1 | bsd-3-clause | d0631c8d725713ac3138359fab1dae915eb030cb | tonicbupt/flynn,pkdevbox/flynn,arekkas/flynn,whouses/flynn,supermario/flynn,TribeMedia/flynn,pkdevbox/flynn,benbjohnson/flynn,tonicbupt/flynn,clifff/flynn,justintung/flynn,whouses/flynn,arekkas/flynn,jzila/flynn,lmars/flynn,josephglanville/flynn,schatt/flynn,justintung/flynn,TribeMedia/flynn,GrimDerp/flynn,schatt/flynn... | test/test_postgres.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\"strings\"\n\n\t\"github.com/bewuethr/advent-of-code/go/convert\"\n\t\"github.com/bewuethr/advent-of-code/go/intcode\"\n\t\"github.com/bewuethr/advent-of-code/go/ioutil\"\n\t\"github.com/bewuethr/advent-of-code/go/l... | go | edit | 0 | 8 | mit | 53cb2dfe8aee123419562476d24181a6b6f2874c | bewuethr/advent_of_code,bewuethr/advent_of_code,bewuethr/advent_of_code | 2019/day05/second/day05b.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage finder\n\nimport (\n\t\"context\"\n)\n\ntype MockFinder struct {\n\tresult [][]byte // from new\n\tquery string // logged from execute\n}\n\nfunc NewMockFinder(result [][]byte) *MockFinder {\n\treturn &MockFinder{\n\t\tresult: result... | go | edit | 0 | 2 | mit | ac7a33826c035068fbd85b7c51f17a941793590f | lomik/graphite-clickhouse,lomik/graphite-clickhouse | finder/mock.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handle\n\nimport (\n\t\"github.com/smotti/ircx\"\n\t\"github.com/smotti/tad/config\"\n\t\"github.com/smotti/tad/report\"\n\t\"github.com/sorcix/irc\"\n)\n\n// CmdHostOs handles the CMD_HOST_OS bot command, by sending back data about\n//... | go | edit | 6 | 2 | unlicense | f35e4ea0d2371e53dc7dc284ea5c2c9c581c3b07 | smotti/cfengine-tad | handle/hostinfo.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage middleware\n\nimport (\n\t\"github.com/gin-gonic/gin\"\n\n\toauth_service \"github.com/torinos-io/api/service/oauth_service\"\n\tuser_store \"github.com/torinos-io/api/store/user_store\"\n\t\"github.com/torinos-io/api/type/system\"\n)\n... | go | edit | 0 | 3 | mit | 927cc44a64657f5c2cc5a2f22bd051a7fa859d68 | torinos-io/api,torinos-io/api | server/middleware/current_user.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\nimport (\n\t\"fmt\"\n)\n\ntype Host struct {\n\tId int\n\tName string\n}\n\nfunc (this *Host) String() string {\n\treturn fmt.Sprintf(\n\t\t\"<id:%s,name:%s>\",\n\t\tthis.Id,\n\t\tthis.Name,\n\t)\n}\n\n```\n\nApply this chang... | go | edit | 0 | 1 | apache-2.0 | 7b08eaef24cbded87eea3a47dc76cabcec73bbfe | Cepave/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend,Cepave/open-falcon-backend | common/model/host.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage schema\n\nimport \"testing\"\n\nfunc TestParse(t *testing.T) {\n\n text := `\n package users\n\n from locale import Location\n // this is a comment\n // This is also a comment\n // This is one too\n type User {\n ... | go | edit | null | null | mit | c23a2f4ae8e82058b5b123b33b331cec098bd6c9 | swiftkick-io/namedtuple,blacklabeldata/namedtuple | schema/parser_test.go | rejected_code_smell | Internal duplication: ~98% of the file is inside repeated 12+ line blocks | null |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage node\n\nimport (\n\t\"encoding/json\"\n\t\"testing\"\n)\n\nfunc TestPacketMarshalling(t *testing.T) {\n\tsk, _ := NewECDSAKey()\n\tm := Packet{sk.PublicKey().Hash(), 3, \"test\"}\n\tb, err := json.Marshal(m)\n\tif err != nil {\n\t\tt.Fa... | go | edit | 9 | 4 | mit | 6c2a06f97f03a1170b592f366e42a4dc229fc85a | AutoRoute/node,AutoRoute/node | packet_test.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\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\n\t\"code.google.com/p/gcfg\"\n)\n\nconst Version = \"0.1a\"\n\nconst DEFAULT_NICKNAME = \"perpetua\"\nconst DEFAULT_USER = \"perpetua\"\n\nvar BASE_DIR = filepath.Join(os.E... | go | edit | 0 | 5 | bsd-3-clause | f3e9154a707d5cd2fb288cbfe625cee64b122087 | eriol/perpetua | config/options.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage templates\n\nfunc ScopeTemplateContent() string {\n\treturn `#cloud-config\n\n{{ .Name}}:\n {{ range .Services }}{{ .GetName }}:\n {{ range $key, $value := .GetParameters }}{{ $key }}: {{ $value }}\n {{ end }}\n {{ end }}units:\... | go | edit | 0 | 1 | apache-2.0 | 3865a8069ea3feb520dd23550b0fa19d04a6f26b | bernardolins/clustereasy,bernardolins/clustereasy | templates/content.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestParseTemplateFiles(t *testing.T) {\n\tparse := parseTemplateFiles(templatePath)\n\tt.Log(parse)\n\n}\n\n```\n\nApply this change: Add firts demo test function for studding testing procedure... | go | edit | 0 | 1 | bsd-2-clause | 500fa50ecc2da00f42cee67b43f514577515c4ca | davidescus/simple-web-app,davidescus/simple-web-app,davidescus/simple-web-app | main_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage types\n\nimport (\n\t\"time\"\n\n\t\"github.com/joshheinrichs/geosource/server/types/fields\"\n)\n\n// \"github.com/joshheinrichs/geosource/server/transactions\"\n\ntype PostInfo struct {\n\tId string `json:\"id\" gorm:\"colum... | go | edit | 6 | 1 | mit | 1d0f638ac2b262a3719bedfe2a2d504d112e16a4 | Decateron/geosource,Decateron/geosource,Decateron/geosource | server/types/post.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package `fmtmail` builds on top of the standard library's `net/mail`, by\n// adding a single function:\n//\n// func WriteMessage(w io.Writer, msg *mail.Message) error\n//\n// ...Which outputs the message to `w`.\n//\n// The basic functio... | go | edit | 0 | 0 | isc | 31ceaa732741ddbb2c9254ca13ed14ccf6d5aaa5 | zenhack/go.fmtmail | README.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"testing\"\n)\n\nfunc BenchmarkMapLookupKeyStringFromBytes(b *testing.B) {\n\tentries := 4096\n\tlookup := make(map[string]int, entries)\n\tfor i := 0; i < entries; i++ {\n\t\tlookup[fmt.Sprintf(\"foo.%d\... | go | edit | 0 | 4 | mit | 1de238dc7bf8902f1d210df841eed6426b0928b5 | robskillington/benchmarks-go | bench_map_key_lookup_string_from_bytes_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slack\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"net/http\"\n\n\t\"github.com/pkg/errors\"\n)\n\ntype WebhookMessage struct {\n\tUsername string `json:\"username,omitempty\"`\n\tIconEmoji string `json:\"icon_emo... | go | edit | 6 | 4 | bsd-2-clause | c7ea41e910b97dba76ae574a7a9e0538e6fe9ed3 | 178inaba/slack,james-lawrence/slack,nlopes/slack | webhooks.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build tools\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 | a9894e2dce3ecfd2a17e6a3f8c3c317b05a750e6 | GoogleCloudPlatform/testgrid,GoogleCloudPlatform/testgrid,GoogleCloudPlatform/testgrid,GoogleCloudPlatform/testgrid,GoogleCloudPlatform/testgrid,GoogleCloudPlatform/testgrid | hack/tools.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage framework\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nfunc Test_getMethods_OneMethod(t *testing.T) {\n\n\ttestType := reflect.TypeOf(TestController{})\n\n\tmethods := getMethods(testType)\n\n\texpectedLen, actualLen := 1, len(method... | go | edit | 12 | 4 | mit | ec6709764629c64904d63f799dca9954fafe34e6 | icambridge-old/framework | reflection_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pci\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n)\n\nfunc isHex(b byte) bool {\n\treturn ('a' <= b && b <= 'f') || ('A' <= b && b <= 'F') || ('0' <= b && b <= '9')\n}\n\n// scan searches for Vendor and Device lines from the input *bufio.Scan... | go | edit | 12 | 8 | bsd-3-clause | b34aa2c43af424dd53718db6008874029b33a20d | hugelgupf/u-root,hugelgupf/u-root,rminnich/u-root,GanShun/u-root,hugelgupf/u-root,rminnich/u-root,GanShun/u-root,hugelgupf/u-root,u-root/u-root,u-root/u-root,u-root/u-root,rminnich/u-root,GanShun/u-root,rminnich/u-root | pkg/pci/parse.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\"net/http\"\n\t\"time\"\n\n\tct \"github.com/flynn/flynn/controller/types\"\n\t\"github.com/flynn/flynn/pkg/rpcplus\"\n\trpc \"github.com/flynn/flynn/pkg/rpcplus/comborpc\"\n)\n\nfunc rpcHandler(repo *FormationRepo)... | go | edit | 6 | 6 | bsd-3-clause | dd8d8d63a3b7930a85815ba1090ca178a63159bb | justintung/flynn,felixrieseberg/flynn,mubassirhayat/flynn,jzila/flynn,flynn/flynn,TribeMedia/flynn,benbjohnson/flynn,schatt/flynn,TribeMedia/flynn,kgrz/flynn,jzila/flynn,TribeMedia/flynn,tonicbupt/flynn,tonicbupt/flynn,GrimDerp/flynn,whouses/flynn,arekkas/flynn,Brandywine2161/flynn,kgrz/flynn,whouses/flynn,schatt/flynn... | controller/rpc.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage frame\n\n// Interface Sequence is used to manipulate with frames, which can be used more\n// than one time (e.g. APIC, COMM, USLT, SYLT and etc.)\ntype Sequencer interface {\n\tAddFrame(Framer)\n\tFrames() []Framer\n}\n\n```\n\nApply th... | go | edit | 6 | 0 | mit | 82d30addc5b6bdbe27f8c21fca830274d909d6c6 | bogem/id3v2 | frame/sequence.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage tumblr\n\n// Defines each subtype of Post (see consts below) and factory methods\n\n// Post Types\nconst (\n\tText = \"text\"\n\tQuote = \"quote\"\n\tLink = \"link\"\n\tAnswer = \"answer\"\n\tVideo = \"video\"\n\tAudio = \"audio\... | go | edit | 0 | 0 | mit | 62c1c6813b265f3796956ab58a174b0187798126 | hut8/tumblr-go | post_entities.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage algoholic\n\n// Merge Sort, O(n lg n) worst-case. Very beautiful.\nfunc MergeSort(ns []int) []int {\n\tif len(ns) < 2 {\n\t\treturn ns\n\t}\n\n\thalf := len(ns) / 2\n\n\tns1 := MergeSort(ns[:half])\n\tns2 := MergeSort(ns[half:])\n\n\tre... | go | edit | 0 | 6 | mit | 9cdde8b89f31d4873957652273e234b3a55740db | lorenzo-stoakes/algoholic | sort/msort/msort.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n//this file contains several examples by Golang\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\t//Check if number is odd or even\n\tfmt.Print(\"Enter a number: \")\n\tvar number int\n\tfmt.Scanf(\"%d\", &number)\n\n\tif (number % ... | go | edit | 3 | 2 | mit | c7dca71a2d6eb68d062ea035a3c01da268151281 | gaupoit/goRepository | gaupoitExamples/examples.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage passhash\n\nimport (\n\t\"testing\"\n)\n\nfunc TestDummyCredentialStoreStore(t *testing.T) {\n\tstore := DummyCredentialStore{}\n\tcredential := &Credential{}\n\tif err := store.Store(credential); err != nil {\n\t\tt.Error(\"Got error s... | go | edit | 21 | 3 | apache-2.0 | 38c5b09efa1a2d74b62c921b545601f1d5009496 | dhui/passhash | store_test.go | rejected_lint | Too many lint violations: 21 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage exercism\n\nimport (\n\t\"github.com/stretchr/testify/assert\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"testing\"\n)\n\nfunc TestReadingWritingConfig(t *testing.T) {\n\ttmpDir, err := ioutil.TempDir(\"\", \"\")\n\tassert.NoE... | go | edit | 12 | 1 | mit | f3cef41d6e27d68b18218cd81ba33c31810d0c1f | BhanuprakashVc/go-exercism,BhanuprakashVc/go-exercism | src/exercism/config_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !cgo !linux\n\npackage buildah\n\nimport (\n\t\"fmt\"\n)\n\nfunc lookupUserInContainer(rootdir, username string) (uint64, uint64, error) {\n\treturn 0, 0, errors.Wrapf(\"user lookup not supported\")\n}\n\nfunc lookupGroupInContainer(r... | go | edit | 0 | 1 | apache-2.0 | 215ded7892a3fcb4146ef4315d5a925e3b31d663 | projectatomic/buildah,nalind/buildah,TomSweeneyRedHat/buildah,nalind/buildah-1,rhatdan/buildah,nalind/buildah,ipbabble/buildah,nalind/buildah-1,TomSweeneyRedHat/buildah,TomSweeneyRedHat/buildah,projectatomic/buildah,nalind/buildah-1,projectatomic/buildah,rhatdan/buildah,ipbabble/buildah,rhatdan/buildah | user_basic.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2020 Google Inc. All Rights Reserved.\n// This file is available under the Apache license.\n\npackage mtail_test\n\nimport (\n\t\"os\"\n\t\"path\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/golang/glog\"\n\t\"github.com/google/mt... | go | edit | 0 | 1 | apache-2.0 | dd033c880e42bd4b9fd416f7869cac9baf0b8a28 | google/mtail,SuperQ/mtail,SuperQ/mtail,google/mtail | internal/mtail/log_deletion_integration_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t_ \"io/ioutil\"\n\t\"os\"\n)\n\nfunc main() {\n\t//f, err := ioutil.ReadFile(\"README.md\")\n\tf, err := os.Open(\"README.md\")\n\tif err != nil {\n\t\treturn\n\t}\n\tfmt.Println(f.Name())\n}\n\n```\n\nApp... | go | edit | 0 | 2 | mit | 1a76f94868e36fc7fe3747e4715a97ea0295a0f2 | rollbrettler/go-playground | read-file.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"github.com/simon-engledew/gocmdpev/gopev\"\n \"io/ioutil\"\n \"github.com/fatih/color\"\n \"log\"\n \"os\"\n)\n\nfunc main() {\n buffer, err := ioutil.ReadAll(os.Stdin)\n\n if err != nil {\n log.Fatalf(\"%... | go | edit | 0 | 3 | mit | 40e7cbe4c32a14253adbb9cb4cc5a17560f16814 | simon-engledew/gocmdpev | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\n\t\"github.com/ligato/vpp-agent/cmd/agentctl2/utils\"\n\t\"github.com/spf13/cobra\"\n)\n\n// RootCmd represents the base command when called without any subcommands.\nvar putConfig = &cobra.Co... | go | edit | 6 | 2 | apache-2.0 | 87c31cf8cdb4eae9b4921222967c6cb585fbd19e | ondrej-fabry/vpp-agent,ondrej-fabry/vpp-agent,VladoLavor/vpp-agent,VladoLavor/vpp-agent,ondrej-fabry/vpp-agent,VladoLavor/vpp-agent | cmd/agentctl2/cmd/put_cmd.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage machinelearning\n\nimport (\n\t\"net/url\"\n\n\t\"github.com/awslabs/aws-sdk-go/aws\"\n)\n\nfunc init() {\n\tinitRequest = func(r *aws.Request) {\n\t\tr.Handlers.Build.PushBack(updatePredictEndpoint)\n\t}\n}\n\n// updatePredictEndpoint ... | go | edit | 6 | 3 | apache-2.0 | 5df7b3485d5b0d07341e097faf4dac457766fdd3 | dragonfax/aws-sdk-go,keithpitt/aws-sdk-go,jkakar/aws-sdk-go,ebartels/aws-sdk-go,digantsh/aws-sdk-go,jjeffery/aws-sdk-go,jasdel/aws-sdk-go,radeksimko/aws-sdk-go,rosenhouse/aws-sdk-go,xibz/aws-sdk-go,rail/aws-sdk-go,digantsh/aws-sdk-go,gunosy/aws-sdk-go,vito/aws-sdk-go,myshen/aws-sdk-go,jkakar/aws-sdk-go,wolfspyre/aws-sd... | service/machinelearning/customizations.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage idling\n\nimport (\n\t\"time\"\n\n\t\"github.com/openshift/origin/pkg/util/errors\"\n\texutil \"github.com/openshift/origin/test/extended/util\"\n\tkapi \"k8s.io/kubernetes/pkg/api\"\n\t\"k8s.io/kubernetes/pkg/util/wait\"\n)\n\nfunc wai... | go | edit | 0 | 3 | apache-2.0 | 7d968f34a2a9427204bfa6e713b90b8bc7d7dad4 | enj/origin,dmage/origin,elyscape/origin,raffaelespazzoli/origin,maxamillion/origin,mfojtik/origin,sferich888/origin,sspeiche/origin,matthyx/origin,jim-minter/origin,ryanj/origin,wanghaoran1988/origin,danmcp/origin,pweil-/origin,enj/origin,pravisankar/origin,jsafrane/origin,pecameron/origin,jeremyeder/origin,php-coder/o... | test/extended/idling/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"go/format\"\n\t\"regexp\"\n)\n\nfunc GoFmt(buf string) string {\n\tformatted, err := format.Source([]byte(buf))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn string(formatted)\n}\n\nvar reTrim = regexp.MustComp... | go | edit | 0 | 2 | apache-2.0 | c8a756944d81687cc756f1f6a10466eee88e63e1 | ruseinov/aws-sdk-go,jasdel/aws-sdk-go,radeksimko/aws-sdk-go,rail/aws-sdk-go,marcosnils/aws-sdk-go,zmarois/aws-sdk-go,matematik7/aws-sdk-go,yxd-hde/aws-sdk-go,digantsh/aws-sdk-go,keithpitt/aws-sdk-go,bpot/aws-sdk-go,agworld/aws-sdk-go,fwiesel/aws-sdk-go,calgaryscientific/aws-sdk-go,calgaryscientific/aws-sdk-go,dafyddcro... | internal/util/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage signal\n\nimport (\n\t\"syscall\"\n)\n\n// Signals used in cli/command (no windows equivalent, use\n// invalid signals so they don't get handled)\nconst (\n\tSIGCHLD = syscall.Signal(0xff)\n\tSIGWINCH = syscall.Signal(0xff)\n\tSIGPIPE ... | go | edit | 0 | 0 | apache-2.0 | 8037ded8c5d7eead4dcd49a943626f08bac1f95b | moby/sys | signal/signal_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"bytes\"\n\t\"io/ioutil\"\n\t\"net/http\"\n\t\"testing\"\n\n\t\"golang.org/x/net/context\"\n)\n\nfunc TestContainerStartError(t *testing.T) {\n\tclient := &Client{\n\t\ttransport: newMockClient(nil, errorMock(http... | go | edit | 12 | 3 | apache-2.0 | e85d05fef61ff27773e25a38fc2f4ec5bdd2264b | jwhonce/engine-api,docker/engine-api,vdemeester/engine-api,thaJeztah/engine-api | client/container_start_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\"crypto/tls\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/cloudfoundry/noaa/consumer\"\n)\n\nconst firehoseSubscriptionId = \"firehose-a\"\n\nvar (\n\tdopplerAddress = os.Getenv(\"DOPPLER_ADDR\")\n\tauthToken = os.G... | go | edit | 0 | 4 | apache-2.0 | ea8759ba3628ce69b0c332ccea75ac6e373a938b | cloudfoundry/noaa,cloudfoundry/noaa | samples/firehose/main.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\tmacro \"github.com/nullstyle/go-codegen\"\n)\n\nfunc main() {\n\targs := os.Args[1:]\n\tif len(args) == 0 {\n\t\targs = []string{\".\"}\n\t}\n\n\tfor _, arg := range args {\n\t\terr := macro.Pr... | go | edit | 0 | 4 | isc | e88d3dff2e73ef9b10c3772bacc3e7d61453ad97 | nullstyle/go-codegen | src/github.com/nullstyle/go-codegen/cmd/go-codegen/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage seqimpl\n\nimport \"seq\"\n\ntype AMeta struct {\n\tmeta seq.PersistentMap\n}\n\nfunc (o *AMeta) Meta() seq.PersistentMap {\n\treturn o.meta\n}\n\n```\n\nApply this change: Add comment on AMeta type"
},
{
"role": "assistant",
... | go | edit | 0 | 1 | bsd-2-clause | 7648b654030e7b31b1ff915087efb1c05de8bf8a | dmiller/go-seq | src/seq/seqimpl/ameta.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage imageserver\n\ntype StatusResponse struct {\n\tSuccess bool\n\tErrorString string\n}\n\ntype AddRequest struct {\n\tName string\n\tFilter [][]string\n}\n\ntype AddResponse StatusResponse\n\ntype CheckRequest struct {\n\tName strin... | go | edit | 0 | 0 | apache-2.0 | 9f5bd2723198701b417f2deffd8b4f6d39dbf721 | keep94/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator | proto/imageserver/messages.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db_manager\n\nimport (\n \"fmt\"\n \"log\"\n \"github.com/garyburd/redigo/redis\"\n \"encoding/json\"\n \"../entities\"\n // \"github.com/garyburd/redigo/redisx\"\n)\n\nvar connection redis.Conn\n\nconst (\n HOSTNAM... | go | edit | 9 | 3 | mit | 699504d26434f2ba03804e7063823dd536b2e431 | WarCluster/warcluster-server,WarCluster/warcluster-server | db_manager/connection.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage asciidocgo\n\nimport \"io\"\n\nfunc Load(input io.Reader) *Document {\n\treturn nil\n}\n\n```\n\nApply this change: Add Package doc, and Lod function doc."
},
{
"role": "assistant",
"content": "/* Asciidocgo implements an As... | go | edit | 3 | 1 | mit | 51b04144d7a863cf32fff51769664ad09a915a4e | bep/asciidocgo,VonC/asciidocgo | asciidocgo.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\"strconv\"\n\t\"time\"\n)\n\nfunc Log(req *http.Request) {\n\tlog.Println(req.URL, req.UserAgent(), req.Form)\n}\n\nfunc Home(w http.ResponseWriter, req *http.Request) {\n\tw.Write([]byte(... | go | edit | 0 | 2 | mit | 114c8d926f1d12cc30e03cc996db665c82008aeb | toomore/gogrs,toomore/gogrs | tradingdays/server/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gorocksdb\n\n// #include \"rocksdb/c.h\"\nimport \"C\"\n\n// EnvOptions represents options for env.\ntype EnvOptions struct {\n\tc *C.rocksdb_envoptions_t\n}\n\n// NewDefaultEnvOptions creates a default EnvOptions object.\nfunc NewDefau... | go | edit | 0 | 1 | mit | ff25ae17c5ea12556f0900944740aa2fcac6b39a | tecbot/gorocksdb,tecbot/gorocksdb | options_env.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\nconst (\n\tDATAFILE_SIZE = 1024 * 1024 * 256 // 256 MB\n\tDATABLOCK_SIZE = 1024 * 4 // 4KB\n)\n\nfunc main() {\n\tfile, err := os.Create(\"metadata-db.dat\")\n\tif err != nil {\n\t\t... | go | edit | 9 | 5 | mit | 60a6f7c896230d54d7b040d6be332c66d770d703 | fgrehm/pucrs-simple-json-db,fgrehm/pucrs-metadata-db | src/metadata-db/main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cf\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nconst (\n\tVersion = \"6.0.0.rc2-SHA\"\n\tUsage = \"A command line tool to interact with Cloud Foundry\"\n)\n\nfunc Name() string {\n\treturn filepath.Base(os.Args[0])\n}\n\n```\n\nA... | go | edit | 0 | 1 | apache-2.0 | 1aa4a255b988855cc539221fbe172b32b8c62496 | hyenaspots/cli,simonleung8/cli,SrinivasChilveri/cli,mcintyred/cli,HuaweiTech/cli,carnell69/cli,ofer43211/cli,mcintyred/cli,nttlabs/cli,srikanth88infy/cli,nttlabs/cli,saravana76/cli,TomG713/cli,zhang-hua/cli,saurabhguptasg/cli,mcowger/cli,xingzhou/cli,saravana76/cli,kavoj/cli,pishro-cc/cli,ofer43211/cli,rastasheep/trash... | src/cf/app_constants.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"testing\"\n\nfunc TestFoo(t *testing.T) {\n\n}\n\n```\n\nApply this change: Add test for corner case with (deprecated)"
},
{
"role": "assistant",
"content": "package main\n\nimport (\n\t\"strings\"\n\t\"test... | go | edit | 0 | 2 | mit | 7598c409732afa6d8b1c6e20527cb475c216a20d | hvnsweeting/gosearch,hvnsweeting/gosearch | gosearch_test.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\"github.com/minamijoyo/myaws/cmd\"\n)\n\nfunc main() {\n\tif err := cmd.RootCmd.Execute(); err != nil {\n\t\tfmt.Printf(\"%+v\\n\", err)\n\t\tos.Exit(-1)\n\t}\n}\n\n```\n\nApply this change: C... | go | edit | 0 | 2 | mit | f96b19ad63d300927e7837809d041cacc1c44f54 | minamijoyo/myaws | main.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\"os\"\n\n\t\"github.com/ghodss/yaml\"\n)\n\nfunc main() {\n\n\tstat, _ := os.Stdin.Stat()\n\tvar bytes []byte\n\tif (stat.Mode() & os.ModeCharDevice) == 0 {\n\t\tbytes, _ = ioutil.ReadAll... | go | edit | 0 | 2 | apache-2.0 | 59539c9c780165d25b588b5c0e02295ca39ca231 | solarkennedy/uq | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage router\n\nimport (\n\t\"github.com/valyala/fasthttp\"\n)\n\n// RedirectHandler stores the URL and HTTP code of a redirect\ntype ProxyHandler struct {\n\turl string\n}\n\n// ServerHTTP writes a redirect to an HTTP response\nfunc (r *Prox... | go | edit | 0 | 2 | mit | 2e9f15fc25b592909783fc03fcf451f23260edd1 | tpbowden/swarm-ingress-router,tpbowden/swarm-ingress-router | router/proxy_handler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\tdocker \"github.com/fsouza/go-dockerclient\"\n)\n\nconst VERSION = \"0.1.0\"\n\nfunc main() {\n\terr := LoadLanguages(\"./languages.json\")\n\tif err != nil {\n\t\tlog.Fatalln(err)\n\t}\n\n\tconfig, err ... | go | edit | 9 | 4 | mit | ca3450e2ac99d1d79c0b34b6201381cde5afc44d | sosedoff/bitrun-api,bitrun/api | main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"fmt\"\n\nfunc main() {\n\tfmt.Printf(\"%v\", payload)\n}\n\n```\n\nApply this change: Send fake JSON payload to 127.0.0.1:8080"
},
{
"role": "assistant",
"content": "package main\n\nimport (\n\t\"fmt\"\n\t\"... | go | edit | 3 | 1 | mit | 638d5987e2e1d44402eb9ad5a8b887f71165e5ea | maiconio/fake-github-webhook | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build js\n\npackage strconv\n\nimport (\n\t\"github.com/gopherjs/gopherjs/js\"\n)\n\nconst maxInt32 float64 = 1<<31 - 1\nconst minInt32 float64 = -1 << 31\n\n// Atoi returns the result of ParseInt(s, 10, 0) converted to type int.\nfunc Atoi... | go | edit | 15 | 10 | bsd-2-clause | cc26e01722baacb23f2302f96ed37f64623e40aa | gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs,gopherjs/gopherjs | compiler/natives/src/strconv/atoi.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage input\n\nimport (\n\t\"github.com/antonienko/goandroid/device\"\n\t\"strings\"\n)\n\n// TextInput struct represents a text input subsystem for associated device.\ntype TextInput struct {\n\tdev device.Device // Associated device\n}\n\n/... | go | edit | 0 | 1 | mit | 688118c4b015dd6772693c36ebaeb5ce8cd1990b | antonienko/goandroid | input/text.go | accepted | null | true |
[
{
"role": "user",
"content": "Write go code for the following: Add basic primitives for building network daemons"
},
{
"role": "assistant",
"content": "// Package netd provides useful primitives for building network daemons.\npackage netd\n\nimport \"net\"\n\n// Backend handles incoming connecti... | go | new_file | 0 | 0 | mit | 36ee8777e7f369c143fe0acfe522a3df1a920dc7 | Invizory/netd | netd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// A set of packages that provide many tools for testifying that your code will behave as you intend.\n//\n// testify contains the following packages:\n//\n// The assert package provides a comprehensive set of assertion functions that tie in to... | go | edit | 0 | 0 | mit | a9851100fe5828794febedc8c553078acdd22ead | ifraixedes/testify,MCProHosting/testify,yxd-hde/testify,liudhzhyym/testify,glittershark/testify,irnnr/testify,brahmaroutu/testify,AnuchitPrasertsang/testify,dvln/testify,betable/testify,codygibb/testify,davelondon/ktest,outrightmental/go-testify,stretchr/testify,embroker/testify,mesosphere/testify,ernesto-jimenez/testi... | doc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage appletflag\n\nimport (\n\t\"runtime\"\n\t\"strings\"\n)\n\nfunc getCallerPackage() string {\n\tptr, _, _, ok := runtime.Caller(2)\n\tif !ok {\n\t\tpanic(\"Could not obtain caller’s function pointer\")\n\t}\n\tname := runtime.FuncForPC(p... | go | edit | 0 | 2 | mit | c53cf959ec108a4d21d044b0de23f2bcf2526387 | izissise/gobox | appletflag/runtime.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage server\n\nimport (\n\t\"github.com/xgfone/go-tools/atomics\"\n\t\"github.com/xgfone/go-tools/lifecycle\"\n)\n\nvar (\n\tmanager = lifecycle.GetDefaultManager()\n\tshutdowned = atomics.NewBool()\n\tshouldShutdown = make(chan b... | go | edit | 0 | 2 | apache-2.0 | f3c6187e8df2ee60caaf07851535588a20ab14c1 | xgfone/go-tools | lifecycle/server/shutdown.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// index=3\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t_ \"v.io/core/veyron/profiles\"\n\t\"v.io/core/veyron2/rt\"\n\n\t\"fortune\"\n)\n\nfunc main() {\n\truntime, err := rt.New()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer runti... | go | edit | 0 | 4 | bsd-3-clause | 40238135fe5870f4816a4a013c69c637ca71965f | vanadium/playground,vanadium/playground,vanadium/playground,vanadium/playground | client/content/playgrounds/code/fortune/ex0-go/src/client/client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main_test\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"github.com/onsi/gomega/gexec\"\n\n\t\"testing\"\n)\n\nfunc TestGaragepi(t *testing.T) {\n\tRegisterFailHandler(Fail)\n\tRunSpecs(t, \"GaragepiExe... | go | edit | 0 | 1 | mit | 465fe4a8fc62f4abd688565e2296c9e574427a21 | robdimsdale/garagepi,robdimsdale/garagepi,robdimsdale/garagepi | integration_test/main_suite_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.