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 restic\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\t\"time\"\n)\n\nfunc (node *Node) OpenForReading() (*os.File, error) {\n\tfile, err := os.OpenFile(node.path, os.O_RDONLY, 0)\n\tif os.IsPermission(err) {\n\t\treturn os.OpenFile(node.path, ... | go | edit | 15 | 1 | bsd-2-clause | a8be9c32d0a9567773d06078682251d2efb53ccb | episource/restic,jayme-github/restic,stuertz/restic,jayme-github/restic,pombredanne/restic,ar-jan/restic,arithmetric/restic,intfrr/restic,middelink/restic,ar-jan/restic,bchapuis/restic,restic/restic,fawick/restic,ckemper67/restic,stuertz/restic,kurin/restic,kurin/restic,mappu/restic,klauspost/restic,byo/restic,middelin... | node_freebsd.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"gearman\"\n \"log\"\n)\n\nfunc main() {\n client := gearman.NewClient()\n defer client.Close()\n client.AddServer(\"127.0.0.1:4730\")\n echo := []byte(\"Hello\\x00 world\")\n\n if data, err := c... | go | edit | 0 | 7 | mit | e34d969e472285fe547462507456e86b4ebd3f6a | sgrimee/gearman-go,echa/gearman-go,sgrimee/gearman-go,tacahilo/gearman-go,echa/gearman-go,mikespook/gearman-go,mikespook/gearman-go,mikespook/gearman-go,tacahilo/gearman-go | example/client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build darwin freebsd openbsd netbsd dragonfly\n// +build !appengine\n\npackage isatty\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n)\n\nconst ioctlReadTermios = syscall.TIOCGETA\n\n// IsTerminal return true if the file descriptor is terminal.\... | go | edit | 0 | 1 | mit | 27288b1b7adb8e07ab942b8c6e1f9c0df43fa4ab | mattn/go-isatty,mattn/go-isatty | isatty_bsd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage slack\n\nimport (\n\t\"net/url\"\n)\n\ntype AuthService struct {\n\tapi *SlackClient\n}\n\ntype Auth struct {\n\tUserId \t string `json:\"user_id\"`\n\tUsername string\t `json:\"user\"`\n\tTeam \t string `json:\"team\"`\n\tTeamId \t s... | go | edit | 6 | 2 | mit | 1e910fcb0dc2e58bc3ab3d9e80f906ba881ab69a | tappleby/slack_auth_proxy,tappleby/slack_auth_proxy | slack/auth.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n\t\"github.com/labstack/echo\"\n)\n\n// RegisterAPIRoutes adds API routes to the Echo's route group\nfunc RegisterAPIRoutes(g *echo.Group) {\n\t// Store endpoints first since they are the most active\n\t//e.GET(\"/api/s... | go | edit | 12 | 1 | mit | 8a55ab207daeb27609a2f4de402fdfde787d87e1 | diyan/assimilator,diyan/assimilator,diyan/assimilator | web/api/routes.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage steno\n\nimport (\n\t\"bufio\"\n\t\"os\"\n)\n\ntype IO struct {\n\twriter *bufio.Writer\n\tcodec Codec\n}\n\nfunc NewIOSink(file *os.File) *IO {\n\twriter := bufio.NewWriter(file)\n\n\tio := new(IO)\n\tio.writer = writer\n\n\treturn io\... | go | edit | 12 | 2 | apache-2.0 | 1fd216bbee4a0844d9aeac152f4d094f5048e194 | cloudfoundry/gosteno | io_sink.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\n\t\"github.com/jmoiron/sqlx\"\n\t_ \"github.com/lib/pq\"\n)\n\nconst (\n\tDBHOST string = \"localhost\"\n\tDATABASE string = \"lms2_development\"\n\tDBUSER string = \"lms\"\n\tDBPASS string = \"\"\n\... | go | edit | 0 | 2 | mit | 93c9d95a5a52429b3543ed9a05005292908cc41d | konjoot/benches,konjoot/benches,konjoot/benches | kami/db.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"path\"\n\t\"path/filepath\"\n)\n\nfunc newFileStorage(params *params) storager {\n\treturn &fileStorage{params}\n}\n\ntype fileStorage struct {\n\tparams *params\n}\n\nfunc (f fileStorage) isExist() bool ... | go | edit | 9 | 2 | mit | e02909f004d1d83127a43dad74a5217f2445fafd | monochromegane/torokko | file_storage.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Write go code for the following: Define necessary errors and functions"
},
{
"role": "assistant",
"content": "package protein\n\nimport \"errors\"\n\n// ErrStop represents a STOP codon\nvar ErrStop error = errors.New(\"stop codon\")\n\n// ErrInvalidBase represents a... | go | new_file | 0 | 1 | mit | b4683f4a5b6829ab7d409516239ed8c5b0a367f5 | rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism,rootulp/exercism | go/protein-translation/protein_translation.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hdf5\n\n// #cgo LDFLAGS: -lhdf5 -lhdf5_hl\n// #cgo darwin CFLAGS: -I/opt/local/include\n// #cgo darwin LDFLAGS: -L/opt/local/lib\n// #include \"hdf5.h\"\nimport \"C\"\n\n```\n\nApply this change: Update library and include paths for hom... | go | edit | 3 | 0 | bsd-3-clause | ed062868d3e91d3fc81b63191c6076ba1b769209 | sbinet/go-hdf5,disktnk/go-hdf5 | cgoflags.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ksonnet\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\n\t\"github.com/ksonnet/ksonnet-lib/ksonnet-gen/kubespec\"\n)\n\nconst constructorName = \"new\"\n\nvar specialProperties = map[kubespec.PropertyName]kubespec.Prop... | go | edit | 0 | 5 | apache-2.0 | 4257931f694a0379accdcb3abd47df5147d880e6 | ksonnet/ksonnet-lib,heptio/kube.libsonnet,Bradamant3/kube.libsonnet,ksonnet/ksonnet-lib | ksonnet-gen/ksonnet/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"flag\"\n\t\"github.com/pierrre/mangadownloader\"\n\t\"net/url\"\n\t\"os\"\n)\n\nfunc main() {\n\tflag.Parse()\n\n\tout, err := os.Getwd()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tmd := mangadownlo... | go | edit | 3 | 8 | mit | 122b2b857fee1a363d619a4de9783f242991f53a | pierrre/mangadownloader | cmd/mangadownloader.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage isolated\n\nimport (\n\t\"code.cloudfoundry.org/cli/integration/helpers\"\n\t\"code.cloudfoundry.org/cli/util/configv3\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Config\", func() {\n\tDesc... | go | edit | 15 | 1 | apache-2.0 | 149906099aa52b0363ab0d78ed6ff31b66a5f46f | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | integration/v7/isolated/config_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\"os\"\n\t\"io/ioutil\"\n\t\"pddl\"\n)\n\nconst dump = false\n\nfunc main() {\n\ts, err := ioutil.ReadAll(os.Stdin)\n\tif err != nil {\n\t\tpanic(\"Error reading standard input\")\n\t}\n\n\tp := pddl.Parse... | go | edit | 0 | 3 | mit | d180182e3ab2a2391788f4c7e2334ddaca62f0dd | eaburns/planit,eaburns/planit | pddltest/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build release\n\npackage main\n\nimport \"github.com/ninjasphere/go-ninja/bugs\"\n\n// BugsKey key used for reporting bugs\nconst BugsKey = \"57be7f895461a18014b0b325daf4ea3e\"\n\nfunc init() {\n\tbugs.Configure(\"release\", BugsKey, Versio... | go | edit | 0 | 1 | mit | 67cc124fef5cf6ae3ce7d4a3efae76ac39dcb793 | ninjasphere/driver-go-lifx,ninjasphere/driver-go-lifx | release.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n\npackage common\n\n\nimport (\n \"encoding/base64\"\n \"strings\"\n \"github.com/ricallinson/forgery\"\n \"github.com/spacedock-io/index/models\"\n)\n\nfunc UnpackAuth(raw string) (creds []string, err error) {\n auth := strings.Split(raw,... | go | edit | 3 | 4 | mit | 50bcc11856a4cf4951234cb29a56993789d69c7e | spacedock-io/index | common/common.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nvar CmdCurrent = &Cmd{\n\tName: \"current\",\n\tDesc: \"Reports whether direnv's view of a file is current (or stale)\",\n\tArgs: []string{\"PATH\"},\n\tPrivate: true,\n\tFn: currentCommandFn,\n}\n\nfunc currentCom... | go | edit | 12 | 3 | mit | ab99ac551bd95e1c2c611e6af1f8a4d625497c42 | direnv/direnv,direnv/direnv | cmd_current.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\"flag\"\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/simeji/jid\"\n)\n\nfunc main() {\n\tcontent := os.Stdin\n\n\tvar qm bool\n\tqs := \".\"\n\n\tflag.BoolVar(&qm, \"q\", false, \"Output query mode\")\n\tflag.Parse()\n\n\... | go | edit | 0 | 4 | mit | a906dc321b30096bfd4b3b489b2329c8e7d8a5d7 | simeji/jid | cmd/jid/jid.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage crossdomain\n\nimport (\n \"fmt\"\n \"net/http\"\n )\n \n// make a struct for our http handler\ntype CDHandler struct {}\n\n// use to build the xml\ntype crossdomain struct {\n}\n\nfunc (*c CDHandler) serveHTTP(w http.ResponseWriter... | go | edit | null | null | mit | ac6348e807764d8e2a0ad903addad8f62da7167e | matzhouse/go-crossdomain | crossdomain.go | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logger\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"github.com/mgutz/ansi\"\n)\n\n//Info output a green text line\nfunc Info(f string, args ...interface{}) {\n\tfmt.Printf(Colorize(f, \"green\")+\"\\n\", args...)\n}\n\n//Warn output a red t... | go | edit | 0 | 1 | mit | 0bcfe90be351f39af7f44b08408f3e6a6296e831 | dfeyer/flow-debugproxy | logger/logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controller\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/utahta/momoclo-channel/appengine/lib/crawler\"\n\t\"github.com/utahta/momoclo-channel/appengine/lib/reminder\"\n\t\"github.com/utahta/momoclo-channel/appengine/lib/ust... | go | edit | 18 | 2 | mit | 87e1b9163bd1ee3e7d5dfd79af59ff818e0b7849 | utahta/momoclo-channel,utahta/momoclo-channel | appengine/controller/cron.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage discord\n\nimport (\n\t\"fmt\"\n\t\"sync\"\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestBasicTicker(t *testing.T) {\n\t// t.Skip(\"TickOnce not implemented\")\n\n\tvar counter = 1\n\tvar i = 0\n\n\tmu := sync.Mutex{}\n\n\tf := func(to *Tic... | go | edit | 9 | 4 | mit | e9eec059d3a3a6718a531f0a0082f9664ef6a603 | therealfakemoot/alpha | src/tick/timers_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage persona\n\nimport (\n\t\"code.google.com/p/gorilla/sessions\"\n\t\"net/http\"\n)\n\ntype Store struct {\n\tstore sessions.Store\n}\n\nfunc NewStore(secret string) Store {\n\treturn Store{sessions.NewCookieStore([]byte(secret))}\n}\n\nfu... | go | edit | 0 | 2 | mit | 39e998a44037c182e0debdb83b03472c7da316c1 | hawx/persona | store.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cmd\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/spf13/cobra\"\n\t\"github.com/tsub/s3-edit/cli\"\n\t\"github.com/tsub/s3-edit/cli/s3\"\n)\n\nvar editCmd = &cobra.Command{\n\tUse: \"edit [S3 file path]\",\n\tShort: \"Edit direct... | go | edit | 3 | 1 | mit | 658aa8a4e5b5447cf74d600ee4ac62c20f0eabbc | tsub/s3-edit | cmd/edit.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/deevatech/manager/runner\"\n\t\"github.com/gin-gonic/gin\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n)\n\nfunc init() {\n\tlog.Println(\"Deeva Manager!\")\n}\n\nfunc main() {\n\trouter := gin.Defa... | go | edit | 0 | 2 | mit | b0ef20d4f8883925ae2bf38282395b3a21a81497 | deevatech/manager | manager.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sirius\n\nimport (\n\t\"golang.org/x/net/context\"\n)\n\ntype Service struct {\n\tloader ExtensionLoader\n\tclients []Client\n}\n\nfunc NewService(l ExtensionLoader) *Service {\n\treturn &Service{\n\t\tloader: l,\n\t}\n}\n\nfunc (s *Se... | go | edit | 15 | 3 | mit | fe67e8d8f00d64fb2de9728c157653d92aa8636a | kayex/sirius | sirius.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dev\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\n\t\"github.com/puma/puma-dev/homedir\"\n)\n\nconst supportDir = \"~/Library/Application Support/io.puma.dev\"\n\nfunc TrustCert(cert string) error {\n\tfmt.Printf(\"* Adding certification to ... | go | edit | 0 | 2 | bsd-3-clause | fba60db1256236a7f0ca56d617ed20067c29f3e2 | puma/puma-dev,attilagyorffy/puma-dev,puma/puma-dev,attilagyorffy/puma-dev,puma/puma-dev,attilagyorffy/puma-dev,puma/puma-dev,attilagyorffy/puma-dev | dev/ssl_darwin.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage testrail\n\n// ResultField represents a ResultField\ntype ResultField struct {\n\tConfigs []ResultFieldConfig `json:\"configs\"`\n\tDescription string `json:\"description\"`\n\tDisplayOrder int `json:\... | go | edit | 6 | 1 | mit | f6e5c2c2d521b6f36c7e14e05c2c343ad9c37172 | Etienne42/testrail | resultfield.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage acmedns\n\nimport (\n\t\"github.com/stretchr/testify/assert\"\n\t\"os\"\n\t\"testing\"\n)\n\nvar (\n\tacmednsLiveTest bool\n\tacmednsHost string\n\tacmednsAccountsJson []byte\n\tacmednsDomain string\n)\n\nfunc init() {... | go | edit | 3 | 3 | apache-2.0 | 9d1f233729426e7fca0c8cc5eefedac1b57a7e5f | jetstack-experimental/cert-manager,jetstack/cert-manager,cert-manager/cert-manager,jetstack-experimental/cert-manager,cert-manager/cert-manager,cert-manager/cert-manager,jetstack-experimental/cert-manager,jetstack/cert-manager,jetstack/cert-manager | pkg/issuer/acme/dns/acmedns/acmedns_test.go | rejected_duplicate | Near-duplicate of sample 117429 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage chalmers_chop\n\ntype Allergen int\n\nconst (\n\tGluten Allergen = iota\n\tEgg\n\tMilk\n)\n\ntype Dish struct {\n\tName string\n\tContents string\n\tPrice int\n\tAllergens []Allergen\n}\n\nfunc NewDish(name, contents string) *Dish {\n\t... | go | edit | 0 | 1 | mit | 4d2338cbdcf6b51ef83c1ea8037b5a956cd80ea8 | kayex/chalmers-chop | dish.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage example\n\n// Doer does things, sometimes repeatedly\ntype Doer interface {\n\tDoIt(task string, graciously bool) (int, error)\n}\n\ntype Delegater struct {\n\tDelegate Doer\n}\n\nfunc (d *Delegater) DoSomething(task string) (int, error... | go | edit | 0 | 1 | unlicense | 801ec2795baad4d74871dbf3c11a0b92809f0500 | enocom/fm,enocom/fm | example/doer.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage web\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/concourse/go-concourse/concourse\"\n)\n\ntype ClientFactory interface {\n\tBuild(request *http.Request) concourse.Client\n}\n\ntype clientFactory struct {\n\tapiEndpoint string\n}\n\nfun... | go | edit | 0 | 1 | apache-2.0 | d00ba6eacdab6fa18dabf91fa7ca8883dd9177e4 | concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse | client_factory.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\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// +build linux,!android darwin,!arm,!arm64\n\npackage sensor\n\nimport (\n\t\"e... | go | edit | 6 | 1 | bsd-3-clause | 80d1dba8f1ca95e9c8cc7b11b55d58c4442cbe50 | rakyll/sensors,rakyll/sensors | notmobile.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage negotiate\n\nimport (\n\t\"github.com/K-Phoen/negotiation\"\n\t\"net/http\"\n)\n\ntype formatNegotiator struct {\n\tacceptedFormats []string\n}\n\nfunc FormatNegotiator(acceptedFormats []string) *formatNegotiator {\n\treturn &formatNego... | go | edit | 0 | 3 | mit | 04b711be5ba380f0b0264f469d196d7f307a2a01 | K-Phoen/http-negotiate | negotiate/negotiate.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc TestDbConn(t *testing.T) {\n\tconn := func(name string) {\n\t\tt.Log(\"\\t\", name)\n\n\t\tif c1, err1 := Client(); err1 != nil {\n\t\t\tt.Error(err1)\n\t\t} else {\n\t\t\tdefer Relea... | go | edit | 0 | 2 | mit | 93e00e1656422e6d293917a01f93b373e3d0b83c | kuba--/yag,kuba--/yag | pkg/db/db_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/howeyc/fsnotify\"\n\t\"log\"\n\t\"os\"\n\t\"os/exec\"\n)\n\nfunc main() {\n\tif len(os.Args) < 3 {\n\t\tfmt.Fprintln(os.Stderr, \"Usage: aroc DIRECTORY COMMAND [ARGS…]\")\n\t\tos.Exit(1)\n\t}\... | go | edit | 3 | 5 | mit | 87c05540e252720ef8375b09c098a585b96dcb57 | mxey/aroc | aroc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/flowbase/flowbase\"\n)\n\n// --------------------------------------------------------------------------------\n// FileReader\n// --------------------------------------... | go | edit | 0 | 5 | mit | cc322e9db991a3a566335f22faecb298176f7fe6 | rdfio/rdf2smw,rdfio/rdf2smw | filereader.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"os/user\"\n\t\"path/filepath\"\n\n\t. \"github.com/kkdai/youtube\"\n)\n\nfunc main() {\n\tflag.Parse()\n\tlog.Println(flag.Args())\n\tusr, _ := user.Current()\n\tcurrentDir := fmt.... | go | edit | 3 | 3 | mit | 47a844f540b4faa61ba811da1cb4f8d57ee5dcce | kkdai/youtube | youtubedr/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"math/big\"\n\t\"testing\"\n)\n\nfunc sumOfPrimesBelow(x int64) int64 {\n\tvar i int64\n\tvar sum int64 = 0\n\tfor i = 2; i < x; i++ {\n\t\tif i > 2 && i%2 == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tj := big.NewInt(i)\n\t... | go | edit | 0 | 7 | bsd-2-clause | cb82e4bba6b3e526ffdd7cf607474ce3ea9ab953 | jmalonzo/project-euler-solutions,jmalonzo/project-euler-solutions | go/010_test.go | rejected_duplicate | Near-duplicate of sample 118250 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hamming\n\nimport (\n\t\"testing\"\n)\n\nvar testCases = []struct {\n\texpected int\n\tstrandA, strandB string\n\tdescription string\n}{\n\t{0, \"GGACTGA\", \"GGACTGA\", \"no difference between identical strands\"},\n\t{3, ... | go | edit | 3 | 3 | mit | 230c157f4c645efbf9ae64ec5c83ac1242b5d2fa | pminten/xgo,leenipper/xgo,robphoenix/exercism-go,pminten/xgo,exercism/xgo,exercism/xgo,leenipper/xgo,robphoenix/exercism-go | assignments/go/hamming/hamming_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n)\n\nvar ErrAudienceTooLong = errors.New(\"the API only supports at most one element in the audience\")\n\ntype OidcTokenRequest struct {\n\tAudience string `json:\"audience... | go | edit | 3 | 5 | mit | 37667238171d53e2f769de9c30930cb47dfbfacc | buildkite/agent,buildkite/agent,buildkite/agent | api/oidc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hellomessage // import \"myitcv.io/react/examples/hellomessage\"\n\nimport (\n\tr \"myitcv.io/react\"\n)\n\n//go:generate reactGen\n\n// HelloMessageDef is the definition of the HelloMessage component\ntype HelloMessageDef struct {\n\tr... | go | edit | 9 | 1 | bsd-3-clause | 80e8535442d75b511741e5f09badf52e9c5ca3b4 | myitcv/react,myitcv/react,myitcv/react,myitcv/react | examples/hellomessage/hello_message.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\"github.com/itsankoff/gotcha/client\"\n\t\"log\"\n)\n\nfunc main() {\n\tws := client.NewWebSocketClient()\n\tc := client.New(ws)\n\terr := c.Connect(\"ws://127.0.0.1:9000/websocket\")\n\tlog.Println(\"connected\", e... | go | edit | 0 | 2 | mit | 0dafb1c8b57e792e10345161d2e332874f9fde3b | itsankoff/gotcha,itsankoff/gotcha | cmd/client/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage zoom // Use this file for /user endpoints\n\n// CreateUserPath - v2 path for creating a user\nconst CreateUserPath = \"/users\"\n\ntype CreateUserInfo struct {\n\tEmail string `json:\"email\"`\n\tType UserType `json:\"type\"`... | go | edit | 24 | 1 | mit | 2ca82a147a28f7378183564f4578b8623497dd2c | himalayan-institute/zoom-lib-golang,himalayan-institute/zoom-lib-golang | user_create.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"database/sql\"\n \"log\"\n\n _ \"github.com/mattn/go-sqlite3\"\n)\n\nvar createUsers = `\nCREATE TABLE users (\n id INTEGER PRIMARY KEY,\n name VARCHAR\n);\n`\n\nvar insertUser = `INSERT INTO users (i... | go | edit | 0 | 5 | mit | 23ac6dad5762288d36f5379a20adfbcd6f0f8628 | aodin/gophersql | main.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\"net/http\"\n)\n\nvar config struct {\n\tpath string\n\taddress string\n\tport int\n}\n\nfunc main() {\n\tflag.StringVar(&config.path, \"path\", \"\", \"Optional path to serve static fil... | go | edit | 3 | 3 | mit | 9ad5f43d6d799b962395da9d535781e9063ed999 | rehearse/rehearse | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\n// Copyright 2020 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 th... | go | edit | 3 | 3 | apache-2.0 | f0721fff43a1e1cbaf9002b185c787c7e7800a79 | linux-on-ibm-z/cadvisor,linux-on-ibm-z/cadvisor,linux-on-ibm-z/cadvisor | resctrl/manager.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rethink\n\nimport (\n\tr \"github.com/dancannon/gorethink\"\n)\n\ntype DB struct {\n\tSession *r.Session\n}\n\nfunc NewDB(session *r.Session) *DB {\n\treturn &DB{\n\t\tSession: session,\n\t}\n}\n\nfunc (db *DB) Get(table, id string) (ma... | go | edit | 0 | 3 | mit | b19a8d49ee591e75be0a1bff44505ecfe3344408 | materials-commons/gohandy,materials-commons/gohandy | rethink/rethink.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handler\n\nimport (\n\t\"net/http\"\n\t\"time\"\n\n\t\"github.com/yuuki/dynamond/log\"\n\t\"github.com/yuuki/dynamond/timeparser\"\n)\n\nconst (\n\tDAYTIME = time.Duration(24 * 60 * 60) * time.Second\n)\n\nfunc Render(w http.ResponseWri... | go | edit | 6 | 5 | apache-2.0 | 820c4bf43f3328987730607aff8c2ef8107d3d56 | yuuki/diamondb,yuuki/diamondb | handler/render.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Copyright 2018 the original author or 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 ... | go | edit | 0 | 4 | apache-2.0 | 67290925446492809e647e82a28aeccdf4416fe1 | markfisher/sk8s,markfisher/sk8s,markfisher/sk8s,markfisher/sk8s | riff-cli/pkg/initializers/utils/resolve_opts.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t_ \"expvar\"\n\t\"github.com/codegangsta/negroni\"\n\t\"github.com/meatballhat/negroni-logrus\"\n\t\"github.com/unrolled/render\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tRun()\n}\n\nfunc Run() {\n\tm := http.DefaultSe... | go | edit | 3 | 2 | mit | f2a753d1df1c3b2188acde5fbfad5ed41a3865c6 | mattbostock/leavediary | main.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\"os\"\n\n\t\"github.com/go-distributed/gog/agent\"\n\t\"github.com/go-distributed/gog/config\"\n)\n\nfunc main() {\n\tconfig, err := config.ParseConfig()\n\tif err != nil {\n\t\tfmt.Println(\... | go | edit | 0 | 7 | apache-2.0 | 3888ce0ae1cde44c773bee68706fb9b1ec32ffe6 | go-distributed/gog,go-distributed/gog,go-distributed/gog | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ec2\n\nimport (\n\t\"github.com/jagregory/cfval/resources/common\"\n\t. \"github.com/jagregory/cfval/schema\"\n)\n\n// see: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-internet-gateway.html\nfunc Inter... | go | edit | 18 | 1 | mit | db1755682e45ea70489a382139721b19c25f6274 | jagregory/cfval,jagregory/cfval | resources/ec2/internet_gateway.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// gogl provides a framework for representing and working with graphs.\npackage gogl\n\ntype Vertex interface{}\n\ntype Graph interface {\n\tEachVertex(f func(vertex Vertex))\n\tEachEdge(f func(source Vertex, target Vertex))\n\tEachAdjacent(ver... | go | edit | 0 | 0 | mit | 4df1ae519f47f36b93e710abb8a9b468670bcf44 | sdboyer/gogl,sdboyer/gogl | graph.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jo\n\n// Events signal changes in scanning state.\ntype Event int\n\nconst (\n\t// Nothing of interest, continue scanning.\n\tNone Event = 0\n\n\t// Same as None, but specifically for whitespace.\n\tSpace = (1 << iota)\n\n\t// Start eve... | go | edit | 0 | 0 | isc | bc687b17b99abc42f2e1812efd06c153a905550a | erkl-old/jo | event.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build oracle\n\npackage testfixtures\n\nimport (\n\t_ \"gopkg.in/rana/ora.v3\"\n)\n\nfunc init() {\n\tdatabases = append(databases,\n\t\tdatabaseTest{\n\t\t\t\"ora\",\n\t\t\t\"ORACLE_CONN_STRING\",\n\t\t\t\"testdata/schema/oracle.sql\",\n\t... | go | edit | 9 | 1 | mit | 3cfa9839ae5c07a739f35840cac3d81f7cc6d1c2 | go-testfixtures/testfixtures,go-testfixtures/testfixtures | oracle_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build freebsd darwin\n\npackage main\n\nfunc (m *memData) Update() error {\n\treturn nil\n}\n\nfunc getifnum() (int, error) {\n\treturn 0, nil\n}\n\nfunc (nd *netData) Setup() error {\n\treturn nil\n}\n\nfunc (nd *netData) Update() error {\... | go | edit | 9 | 5 | mit | 6bcc2da3cdadf167849c94a5d56483471458ee3e | NHOrus/tgotop | stats_bsd.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\"bytes\"\n\t\"github.com/mitchellh/packer/packer\"\n\t\"testing\"\n)\n\n// This is totally not isolated from the filesystem\nfunc TestUpdateJsonFileWithString(t *testing.T) {\n\tfile := \"/tmp/testpathstring.json\"\... | go | edit | 0 | 1 | bsd-3-clause | 48e55018c150d6a69f0c22fe7c50cadf8370c8bc | cliffano/packer-post-processor-json-updater | updater_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\n\t\"github.com/calebthompson/ftree/tree\"\n)\n\nfunc main() {\n\tr := bufio.NewScanner(os.Stdin)\n\tlines := []string{}\n\tfor r.Scan() {\n\t\tlines = append(lines, r.Text())\n\t}\n\n\tt := tre... | go | edit | 0 | 4 | mit | 383dced28708b4a1c0e93b8e85bf4832bf75ec96 | thoughtbot/ftree,thoughtbot/ftree | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage lib\n\nconst (\n\tVersion = \"2.2.1\"\n)\n\n```\n\nApply this change: Put the Version comment back"
},
{
"role": "assistant",
"content": "package lib\n\nconst (\n\t// Version is the version number the client believes it is\n... | go | edit | 0 | 0 | mit | bdd73de656fa67d3c58e182cfa9209697b3d7358 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | lib/version.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015 Hajime Hoshi\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.apa... | go | edit | 0 | 1 | apache-2.0 | b33d5c5393e80ffc39fb31da8d88440803853a0a | hajimehoshi/ebiten,hajimehoshi/ebiten | _docs/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n\n\t\"github.com/nlopes/slack\"\n)\n\nfunc main() {\n\tapi := slack.New(\"SLACK-TOKEN\")\n\n\tslackMessage := \"[Atlassian Server] \"\n\tif len(os.Args) > 1 {\n\t\tslackMessage += st... | go | edit | 0 | 3 | apache-2.0 | f83d8fabb55f4258b36ed2a698f18ec1b140f7fa | luyaotsung/CompanyWorkJobs,luyaotsung/CompanyWorkJobs,luyaotsung/CompanyWorkJobs,luyaotsung/CompanyWorkJobs,luyaotsung/CompanyWorkJobs,luyaotsung/CompanyWorkJobs,luyaotsung/CompanyWorkJobs,luyaotsung/CompanyWorkJobs | Go/SlackMessage/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage softlayer\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\n// Artifact represents a Softlayer image as the result of a Packer build.\ntype Artifact struct {\n\timageName string\n\timageId string\n\tdatacenterName string\n\tclient ... | go | edit | 6 | 1 | mit | 7fc1e76e7e5e7b6e6f0ebf4753e5efacb59a6d69 | koding/packer-builder-softlayer,kgrvamsi/packer-builder-softlayer,leonidlm/packer-builder-softlayer | builder/softlayer/artifact.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cf_test\n\nimport (\n\t. \"cf\"\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t\"path/filepath\"\n)\n\nvar _ = Describe(\"AppFiles\", func() {\n\tfixturePath := filepath.Join(\"..\", \"fixtures\", \"applications\")\n... | go | edit | 27 | 2 | apache-2.0 | 95f5796f338fff910b2e84b9e20c85917bf17208 | SrinivasChilveri/cli,markstgodard/cli,HuaweiTech/cli,pishro-cc/cli,EngineerBetter/cli,cgvarela/cli,srikanth88infy/cli,saravana76/cli,ReachingOut/cli,rastasheep/trash-can,TomG713/cli,mcowger/cli,fujitsu-cf/cli,markstgodard/cli,xingzhou/cli,18F/cli,saravana76/cli,diatmpravin/cli,SrinivasChilveri/cli,markstgodard/cli,xing... | src/cf/app_files_test.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage anaconda\n\ntype Tweet struct {\n\tSource string\n\tId int64\n\tRetweeted bool\n\tFavorited bool\n\tUser TwitterUser\n\tTruncated bool\n\tText string\n\tRetweet_count int64\n\tId_str ... | go | edit | 6 | 1 | mit | f7094424d06f70dbc656e043f9fecae00d9576b2 | jmptrader/anaconda,logashoff/anaconda,rendon/anaconda,intfrr/anaconda,amit-lulla/twitterapi,ifross89/anaconda,jeffk/anaconda,rfsbraz/anaconda,cgag/anaconda,aatishnn/anaconda,140proof/anaconda,azr/anaconda,josephyzhou/anaconda,Fe4nn0r/anaconda | tweet.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage radius\n\nimport (\n\t\"encoding/binary\"\n\t\"io\"\n)\n\n// AttributeType defines types for an Attribute\ntype AttributeType int64\n\nconst (\n\n\t// Attributes for RFC2866/Radius accounting\n\tAccountingStatusType AttributeType = ... | go | edit | 0 | 1 | mit | 9cd1c9b1f88e04c420219b16e239a8f1a5846df9 | CyCoreSystems/radius,CyCoreSystems/radius | types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// The original error message returned by stdlib changed with go1.8.\n// We only test the latest release.\n//\n//+build go1.8 forcego1.8\n\npackage jsonptrerror_test\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/dolmen-go/jsonptrerror... | go | edit | 0 | 2 | apache-2.0 | 91e5b46ad966ca77fc8077e62fe6460c9c908188 | dolmen-go/jsonptrerror | decoder_example_test.go | rejected_duplicate | Near-duplicate of sample 118437 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2020 The Tekton 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/l... | go | edit | 0 | 1 | apache-2.0 | de8d72cecf8d300fece134709b45923f8d8d4fef | tektoncd/pipeline,tektoncd/pipeline | pkg/apis/pipeline/v1beta1/cluster_task_validation.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rdbtools\n\nimport (\n\t\"fmt\"\n\t\"time\"\n)\n\ntype KeyObject struct {\n\tExpiryTime time.Time\n\tKey interface{}\n}\n\nfunc NewKeyObject(key interface{}, expiryTime int64) KeyObject {\n\tk := KeyObject{\n\t\tKey: key,\n\t}\n\... | go | edit | 6 | 2 | mit | 4d7c2ef91577ebb13a64af7934e1f316533ab0b8 | vrischmann/rdbtools | key.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar (\n\tflBroker string\n\tflConsumerGroup string\n\tflTopic string\n\tflPartition int\n\tflNewest bool\n\n\tfsConsumerGroup = flag.NewFlagSet(\"cgo\", f... | go | edit | 0 | 1 | mit | e56691bc440882240695b15994b8719a155af0b5 | vrischmann/koff | flags.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 | 0 | apache-2.0 | be9d15b565a7223a0391ebb074f092cfaceabb95 | robinpercy/kops,tsupertramp/kops,mad01/kops,blakebarnett/kops,blakebarnett/kops,robinpercy/kops,gambol99/kops,chrislovecnm/kops,andrewsykim/kops,justinsb/kops,andrewsykim/kops,kubernetes/kops,blakebarnett/kops,mad01/kops,mad01/kops,mad01/kops,tsupertramp/kops,andrewsykim/kops,kubernetes/kops,chrislovecnm/kops,gambol99/... | upup/pkg/fi/cloudup/phase.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\nvar (\n\t// Whitelist crawlers here\n\tcrawlerPatterns = [...]string{\n\t\t\"Googlebot\",\n\t\t\"bingbot\",\n\t\t\"MSNbot\",\n\t\t\"facebookexternalhit\",\n\t\t\"PlurkBot\",\n\t\t\"T... | go | edit | 0 | 3 | mit | 4c43f8c181776bc705d97d6bf3c7818d58f220e5 | ptt/pttweb | useragent.go | rejected_duplicate | Near-duplicate of sample 118616 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !freebsd\n\npackage mint_test\n\nimport (\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/otiai10/mint\"\n)\n\n// Exit\nfunc TestExit(t *testing.T) {\n\tmint.Expect(t, func() {\n\t\tos.Exit(999999)\n\t}).Exit(999999)\n\n\tmint.Expect(t, fu... | go | edit | 0 | 1 | mit | 3533358e7de5a8b916dd032f691ca867ee0e4743 | otiai10/mint | exit_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Pygments wrapper for golang. Pygments is a syntax highlighter\n\npackage pygments\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n)\n\nvar (\n\tbin = \"pygmentize\"\n)\n\nfunc Binary(path string) {\n\tbin = path\... | go | edit | 0 | 4 | mit | c78acaddfc9bb52d20a38dcddc961ea3d95a6e3f | christoffer/pygments | pygments.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\"net/http/httptest\"\n\t\"os\"\n\t\"os/signal\"\n)\n\ntype LogplexPrint struct{}\n\nfunc (*LogplexPrint) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tlog.Printf(\"Requ... | go | edit | 3 | 4 | bsd-2-clause | 5ebd3b9188422504000cda3364ec6a3be488d14f | heroku/pg_logplexcollector,logplex/pg_logplexcollector | src/tool/logplexd/logplexd.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage h2spec\n\nimport (\n\t\"github.com/bradfitz/http2\"\n\t\"github.com/bradfitz/http2/hpack\"\n)\n\nfunc FrameSizeTestGroup() *TestGroup {\n\ttg := NewTestGroup(\"4.2\", \"Frame Size\")\n\n\ttg.AddTestCase(NewTestCase(\n\t\t\"Sends large s... | go | edit | 0 | 2 | mit | 962fe944f7c50862003969b11e4f1ceb2693b9a8 | shane-kearns/h2spec,summerwind/h2spec,rmoorman/h2spec | 4_2.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api_test\n\nimport (\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/jvikstedt/alarmy/api\"\n\t\"github.com/jvikstedt/alarmy/store\"\n)\n\nvar handler http.Handler\nvar mockStore *store.MockStore\n\nfunc TestMain(m... | go | edit | 0 | 2 | mit | 4946cbd9dcf72f518e1d7692a92a9b126592710b | jvikstedt/alarmy | api/api_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"path\"\n\n\t\"gnd.la/app\"\n\t\"gnd.la/apps/docs\"\n\t\"gnd.la/net/urlutil\"\n)\n\nconst (\n\t//gondolaURL = \"http://www.gondolaweb.com\"\n\tgondolaURL = \"ssh://abra.rm-fr.net/home/fiam/git/gondola.git\"\n)\n\nfu... | go | edit | 0 | 4 | apache-2.0 | 1ae1f5f0d55f5c75f6b3fb71db284d33359a8e5f | rainycape/gondolaweb,rainycape/gondolaweb,rainycape/gondolaweb,rainycape/gondolaweb | web.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"io/ioutil\"\n\n\t\"github.com/jinzhu/gorm\"\n\t_ \"github.com/lib/pq\"\n)\n\ntype ThumbnailSize struct {\n\tWidth uint\n\tHeight uint\n}\n\nvar ThumbnailSizes = map[string]ThumbnailSize{\n\t\"... | go | edit | 3 | 2 | mit | 0a76605fa3846edd5618a51ede510c4f4fd5466d | jaischeema/panorma,jaischeema/panorma,jaischeema/panorma | common.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/urfave/cli\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// init injects our \"ip\" related commands/options.\nfunc init() {\n\t// Fill-in the various commands\n\tcliCommands = append(cliCommand... | go | edit | 12 | 5 | mit | e698c7d8148dca96454ae7e5a6e08d288627ebe3 | keltia/ripe-atlas | cmd/atlas/cmd_ip.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\"flag\"\n\t\"os\"\n\n\t\"github.com/ian-kent/Go-MailHog/MailHog-Server/config\"\n\t\"github.com/ian-kent/Go-MailHog/MailHog-UI/assets\"\n\t\"github.com/ian-kent/Go-MailHog/MailHog-UI/http/web\"\n\t\"github.com/ian-k... | go | edit | 0 | 3 | mit | b9af80d16ddd4b5bcabf6805bd0063b5694de66d | thejameskyle/MailHog-UI,jjz/MailHog-UI,mailhog/MailHog-UI,mailhog/MailHog-UI,mailhog/MailHog-UI,jjz/MailHog-UI,jjz/MailHog-UI,danielwhite/MailHog-UI,thejameskyle/MailHog-UI,danielwhite/MailHog-UI,thejameskyle/MailHog-UI,danielwhite/MailHog-UI | main.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\"os\"\n)\n\nvar (\n\tPlaybookFile = flag.String(\"play\", \"site.yml\", \"Path to the playbook to execute\")\n\tInventoryFile = flag.String(\"i\", \"hosts\", \"Path to the inventory file\")\n... | go | edit | 6 | 9 | apache-2.0 | fc00f88b2c51f0af6e12e46434037102ef7cb61b | nesv/govern | main.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\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t)\n\nfunc main() {\n\tfile, err := os.Open(\"targetlist.txt\")\n\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanne... | go | edit | 0 | 4 | bsd-3-clause | 34942989e7ce36711ccc29e6f1ccc35c8dcb8aae | yorickdewid/gocraw,yorickdewid/gocraw | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage errors\n\nimport (\n\tnativeErrors \"errors\"\n\t\"net/http\"\n\t\"testing\"\n)\n\nfunc TestHTTPStatusCode(t *testing.T) {\n\tif HTTPStatusCode(nil) != http.StatusOK {\n\t\tt.Error(\"Status code does not match\")\n\t}\n\n\tif HTTPStatus... | go | edit | 9 | 8 | mit | f2201f6ba4a8758e618016fa2c047cb2ee9def65 | vardius/go-api-boilerplate,vardius/go-api-boilerplate,vardius/go-api-boilerplate | pkg/errors/http_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cli\n\nimport (\n\t\"testing\"\n\n\t\"github.com/libopenstorage/openstorage/api\"\n\t\"github.com/stretchr/testify/require\"\n)\n\nfunc TestCmdMarshalProto(t *testing.T) {\n\tvolumeSpec := &api.VolumeSpec{\n\t\tSize: 64,\n\t\tFormat: ... | go | edit | 3 | 1 | apache-2.0 | 69a58785f8501a1df0e25ff6abe6fceed5c75098 | pault84/openstorage,pault84/openstorage,libopenstorage/openstorage,libopenstorage/openstorage,pault84/openstorage,libopenstorage/openstorage | cli/cli_test.go | rejected_duplicate | Near-duplicate of sample 117021 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gofakes3\n\nimport (\n\t\"net/http\"\n\t\"strings\"\n)\n\nvar (\n\tcorsHeaders = []string{\n\t\t\"Accept\",\n\t\t\"Accept-Encoding\",\n\t\t\"Authorization\",\n\t\t\"Content-Disposition\",\n\t\t\"Content-Length\",\n\t\t\"Content-Type\",\... | go | edit | 3 | 2 | mit | 78ab1a9809872e77fb00c5863f4e3479d06b54f3 | johannesboyne/gofakes3,johannesboyne/gofakes3 | cors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build linux\n\npackage specs\n\n// LinuxSpec is the full specification for linux containers.\ntype LinuxSpec struct {\n\tSpec\n\t// Linux is platform specific configuration for linux based containers.\n\tLinux Linux `json:\"linux\"`\n}\n\n/... | go | edit | 3 | 0 | apache-2.0 | 31485faecb4738d1c25d556ec2a88f49fc7a2194 | vbatts/specs,vishh/specs,runcom/specs,hqhq/runtime-spec,ujuc/specs,HardikDR/specs,marcosnils/specs,wking/opencontainer-specs,cloudfoundry-incubator/specs,wangkirin/specs,wking/opencontainer-runtime-spec,talwai/specs,opencontainers/runtime-spec,jonboulle/specs,mheon/specs,laijs/specs,gao-feng/specs,opencontainers/specs,... | config_linux.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage plaintext\n\nimport (\n\t\"strings\"\n)\n\n// returns the mimetype of the full filename if none\nfunc getSuffix(filename string) string {\n\tidx := strings.LastIndex(filename, \".\")\n\tif idx == -1 || idx+1 == len(filename) {\n\t\tretu... | go | edit | 18 | 5 | mit | 60e826ef5a656ac79f8259339d768fc79c7fb298 | client9/plaintext | mime.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage of10\n\nimport . \"github.com/oshothebig/goflow/openflow\"\n\ntype FeaturesRequest struct {\n\tHeader\n}\n\ntype FeaturesReply struct {\n\tHeader\n\tDatapathId DatapathId\n\tBuffers uint32\n\tTables uint8\n\tpad [3... | go | edit | 0 | 0 | mit | 7318a8bfe605d031f8b814e41e2bc1ed1c67b412 | oshothebig/goflow | openflow/of10/message.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage apixu\n\nimport (\n\t\"os\"\n\t\"testing\"\n)\n\nfunc getAPIKey() string {\n\treturn os.Getenv(\"APIXU_KEY\")\n}\n\nfunc TestCurrentWeather(t *testing.T) {\n\n}\n\n```\n\nApply this change: Add currentWeather and forecastWeather tests"
... | go | edit | 9 | 4 | mit | c577f6d86026d9e92e54050cb41a3657bbaea24d | mohan3d/apixu-go | client_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage CoreModule\n\nimport (\n\t\"fmt\"\n\t\"github.com/bwmarrin/discordgo\"\n\t\"github.com/gendonl/genbot/Bot\"\n\t\"time\"\n)\n\nfunc initPingCommand() (cc CoreCommand) {\n\tcc = CoreCommand{\n\t\tname: \"ping\",\n\t\tdescription: \... | go | edit | 12 | 3 | mit | 50c1d10aa90894526f46da9232f543f6f22f7a56 | GenDoNL/GoDiscordBot | CoreModule/PingCommand.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// package core contains the core data structures and functionality\n// leveraged y the other other Goed packages.\npackage core\n\nimport \"os\"\n\nconst Version = \"0.0.3\"\nconst ApiVersion = \"v1\"\n\nvar Trace = false\n\n// Ed is thew edit... | go | edit | 6 | 0 | mit | 5eabc60fda9687cb3906680f1078e700975c523e | tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed,tcolar/goed | core/vars.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage disruptor\n\nimport \"sync/atomic\"\n\ntype SharedWriter struct {\n\twritten *Cursor\n\tupstream Barrier\n\tcapacity int64\n\tgate *Cursor\n\tmask int64\n\tshift uint8\n\tcommitted []int32\n}\n\nfunc NewSharedWriter(wr... | go | edit | 15 | 4 | apache-2.0 | 0bb38f07e118c8d6e6bb1f85ab199b3530ac6060 | yxd-hde/go-disruptor,smartystreets/go-disruptor,yxd-hde/go-disruptor,smartystreets/go-disruptor | shared_writer.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage v1\n\nimport \"encoding/json\"\n\n// UnmarshalJSON implements the json.Unmarshaller interface.\n// If the value is a string, it sets the Value field of the StringSource.\n// Otherwise, it is unmarshaled into the StringSourceSpec struct\... | go | edit | 9 | 2 | apache-2.0 | 60d16f5843d577ffade53154989174157ab66a3d | wjiangjay/origin,php-coder/origin,ramr/origin,mahak/origin,PI-Victor/origin,legionus/origin,ramr/origin,PI-Victor/origin,Miciah/origin,liggitt/origin,sdminonne/origin,linzhaoming/origin,jim-minter/origin,pweil-/origin,nak3/origin,dinhxuanvu/origin,hroyrh/origin,liangxia/origin,imcsk8/origin,jwhonce/origin,pecameron/ori... | pkg/cmd/server/apis/config/v1/stringsource.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package uuid creates pseudo uuid by using crypto/rand.\npackage uuid\n\nimport (\n\t\"crypto/rand\"\n\t\"fmt\"\n)\n\nvar (\n\tDEBUG bool = false // Enable / disable debug messages from this package.\n)\n\n// New() creates pseudo uuid.\nfunc ... | go | edit | 0 | 3 | mit | 8dcf62b827456a8196199798b395fd736e631355 | northbright/uuid | uuid.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n\nimport (\n \"fmt\"\n \"os\"\n \"path/filepath\"\n \"github.com/dmulholland/clio/go/clio\"\n \"sort\"\n)\n\n\n// Help text for the 'tags' command.\nvar tagsHelp = fmt.Sprintf(`\nUsage: %s tags [FLAGS] [OPTIONS]\n... | go | edit | 12 | 4 | mit | bf2cd93f50aac0e50acd68d17a2e3c80ca6ed623 | dmulholland/ironclad | ironclad/cmd-tags.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stats\n\nimport (\n\t\"fmt\"\n\t\"github.com/callpraths/gorobdd/internal/node\"\n)\n\nfunc CountNodes(n *node.Node) (int, error) {\n\tm := make(map[*node.Node]bool)\n\treturn countNodesHelper(n, m)\n}\n\nfunc countNodesHelper(n *node.No... | go | edit | 0 | 6 | mit | 97afad3a04431823d9f07ece330c7b04b302a708 | callpraths/gorobdd | internal/stats/count_nodes.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage struct_mommy_test\n\nimport (\n \"fmt\"\n\n \"github.com/mrfuxi/struct-mommy\"\n)\n\ntype MyStruct struct {\n FieldA float32\n FieldB uint8\n}\n\nfunc ExampleMake() {\n obj := MyStruct{}\n\n struct_mommy.SetSeed(26)\n ... | go | edit | 9 | 1 | mit | 5ae6f6de53b7cd0f22d1979ac9c76450e6c214e6 | mrfuxi/struct-mommy | example_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ast_test\n\nimport (\n\t\"strings\"\n\t\"testing\"\n\n\t\"github.com/DeedleFake/wdte/ast\"\n)\n\nfunc printTree(t *testing.T, cur ast.Node, depth int) {\n\tindent := strings.Repeat(\" \", depth)\n\tswitch cur := cur.(type) {\n\tcase *a... | go | edit | 0 | 5 | mit | ba755b61f373b824f6952a9b237223558c0e2f19 | DeedleFake/wdte,DeedleFake/wdte | ast/ast_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"reflect\"\n\t\"testing\"\n)\n\nvar parseIndexesListTests = []struct {\n\tlist string\n\tindexes []int\n}{\n\t// Only one index\n\t{\n\t\tlist: \"10\",\n\t\tindexes: []int{9},\n\t},\n\t{\n\t\tlist: \"120\",... | go | edit | 0 | 0 | mit | c119496c3bafb55af153bec02135fb11d2f5065d | kusabashira/csvp | selector_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.