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 gps\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc stripVendor(path string, info os.FileInfo, err error) error {\n\tif info.Name() == \"vendor\" {\n\t\tif _, err := os.Lstat(path); err == nil {\n\t\t\tsymlink := (info.Mode() & os... | go | edit | 3 | 9 | mit | edee8c8b410816b975fd26d80f11343925930958 | sdboyer/vsolver,sdboyer/gps | strip_vendor_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\n\npackage gps\n\nimport (\n\t\"os/exec\"\n\t\"testing\"\n)\n\n// setupUsingJunctions inflates fs onto the host file system, but uses Windows\n// directory junctions for links.\nfunc (fs filesystemState) setupUsingJunctions(t ... | go | edit | 9 | 3 | bsd-3-clause | d0ea5d5f730c5136152f99f05268b899b65ef4ff | ibrasho-forks/dep,golang/dep,ibrasho-forks/dep,golang/dep,golang/dep | filesystem_windows_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage graphdriver\n\nimport (\n\t\"syscall\"\n)\n\nvar (\n\t// Slice of drivers that should be used in an order\n\tpriority = []string{\n\t\t\"zfs\",\n\t}\n)\n\n// Mounted checks if the given path is mounted as the fs type\nfunc Mounted(fsTyp... | go | edit | 6 | 2 | apache-2.0 | fd93474d17f6a47b38929fd64c3123006d8fe910 | containers/storage,containers/storage,rhatdan/storage,rhatdan/storage,containers/storage,rhatdan/storage | drivers/driver_freebsd.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"encoding/json\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"time\"\n \"github.com/gorilla/mux\"\n)\n\ntype Request struct {\n\tSparkledBy string `json:\"sparkled_by\"`\n\tRecipient string `json:\"recipient\"`\n\tSparkl... | go | edit | 0 | 1 | mit | 87169a0c3b3ccea9634c7678cc834155641de07a | azizshamim/sparkles,pmn/sparkles,pmn/sparkles,azizshamim/sparkles,azizshamim/sparkles,pmn/sparkles | sparkles.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2018 The Hugo Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\... | go | edit | 3 | 0 | apache-2.0 | b665f1e8f16bf043b9d3c087a60866159d71b48d | anthonyfok/hugo,anthonyfok/hugo,anthonyfok/hugo,gohugoio/hugo,gohugoio/hugo,gohugoio/hugo | common/hugo/version_current.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage moz_test\n\nimport (\n\t\"bytes\"\n\t\"io\"\n\t\"testing\"\n\n\t\"github.com/influx6/faux/tests\"\n\t\"github.com/influx6/moz\"\n)\n\n// TestFunctionGen validates the expected output of a giving function generator.\nfunc TestFunctionGen... | go | edit | 0 | 4 | mit | a50380093d409fdda491f1acfbb39c619f78fa5e | influx6/moz | moz_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/docker/docker/api/types\"\n\t\"golang.org/x/net/context\"\n)\n\n// Ping pings the server and returns the value of the \"Docker-Experimental\" & \"API-Version\" headers\nfunc (cli *Client) ... | go | edit | 6 | 4 | apache-2.0 | 818c54a2ca38f1ec38a03467e2ea573f19fbcd20 | Zebrilee/cli,cpuguy83/cli,gdevillele/cli,e11137/cli,thaJeztah/cli,thaJeztah/cli,docker/cli,docker/cli,redpanda/cli,ashfall/cli,riyazdf/cli,redpanda/cli,riyazdf/cli,allencloud/cli,dnephin/cli,e11137/cli,allencloud/cli,dnephin/cli,Zebrilee/cli,cpuguy83/cli,ashfall/cli | ping.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage banner\n\nimport (\n\t\"errors\"\n\n\t\"github.com/variadico/noti\"\n)\n\n// Notify displays a notification. This will always return an error on Windows.\nfunc Notify(n noti.Params) error {\n\treturn errors.New(\"banner notification not... | go | edit | 0 | 1 | mit | 175b0ec7a9def133f0a122f5324f97419f4c0f0c | variadico/noti,variadico/noti | banner/banner_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage logging\n\nimport (\n\t\"fmt\"\n\tdurationfmt \"github.com/cloudfoundry/bosh-micro-cli/durationfmt\"\n\t\"time\"\n\n\tbmui \"github.com/cloudfoundry/bosh-micro-cli/ui\"\n)\n\ntype EventLogger interface {\n\t// NEW\n\tAddEvent(event Even... | go | edit | 0 | 5 | apache-2.0 | e50bfa853942eca1070fc7633acdeb8644bca683 | allomov/bosh-init,forrestsill/bosh-init,cloudfoundry/bosh-init,allomov/bosh-init,forrestsill/bosh-init,forrestsill/bosh-init,cloudfoundry/bosh-init,allomov/bosh-init,cloudfoundry/bosh-init | logging/event_logger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage brain\n\nimport (\n\t\"github.com/BytemarkHosting/bytemark-client/lib/prettyprint\"\n\t\"io\"\n)\n\n// BackupSchedule represents a schedule to take backups on. It is represented as a start date in YYYY-MM-DD hh:mm:ss format (and assumin... | go | edit | 0 | 1 | mit | c2125148de79fc205f46f14712ea693e5217abf2 | BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client,BytemarkHosting/bytemark-client | lib/brain/backup_schedule.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/ksonnet/kubecfg/cmd\"\n)\n\n// Version is overridden using `-X main.version` during release builds\nvar version = \"(dev build)\"\n\nfunc main() {\n\tcmd.Version = version\n\n\tif ... | go | edit | 0 | 2 | apache-2.0 | a9b4bbf76b0e9419843075bb73453d55fe988172 | anguslees/kubecfg-1,ksonnet/kubecfg | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n//-----------------------------------------------------------------------------\n// Package factored import statement:\n//-----------------------------------------------------------------------------\n\nimport (\n\n\t// Native i... | go | edit | 3 | 1 | apache-2.0 | d4b1f04fb84b791d32907df184ba5a77173aed9e | h0tbird/docker-volume-rsync | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage routers\n\nimport (\n\t\"github.com/gorilla/mux\"\n\t\"github.com/unrolled/secure\"\n)\n\nvar secureMiddleware = secure.New(secure.Options{\n\tFrameDeny: true,\n\tContentTypeNosniff: true,\n\tBrowserXssFilter: true,\n\tIsDeve... | go | edit | 12 | 1 | mit | b83e7455bd39cc65c02655241fead1840d826f2b | Alex1sz/shotcharter-go-api | routers/router.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"net/http\"\n\t\"net/url\"\n\t\"time\"\n\n\t\"github.com/zenazn/goji\"\n)\n\nfunc ping(w http.ResponseWriter, r *http.Request) {\n\tfmt.Fprintf(w, \"\")\n\n\treferrer := r.Referer()\n\tif refer... | go | edit | 3 | 5 | mit | 3644e23807308fc8d35d078176c8a49415fe1086 | parkr/ping,parkr/ping | ping.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pkg\n\nfunc fn1() {\n\tvar x int\n\tx = gen() // MATCH /this value of x is never used/\n\tx = gen()\n\tprintln(x)\n\n\tvar y int\n\tif true {\n\t\ty = gen() // MATCH /this value of y is never used/\n\t}\n\ty = gen()\n\tprintln(y)\n}\n\n... | go | edit | 9 | 2 | mit | cef3ff32d46d0eeafb4dd81d4229d6e538e114f8 | dominikh/go-tools,dominikh/go-tools,dominikh/go-tools,dominikh/go-tools | staticcheck/testdata/CheckUnreadVariableValues.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\"dao\"\n\t\"dto\"\n\t\"fmt\"\n\t\"log\"\n)\n\n//Before you execute the program, Launch `cqlsh` and execute:\n//create keyspace example with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };\n//... | go | edit | 0 | 3 | apache-2.0 | d15d53c7c197a69b6612b3bb5a46a30a59477a5b | jerome-laforge/mytweeter,jerome-laforge/mytweeter,jerome-laforge/mytweeter | src/cmd/cassandra/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage unittest\n\nimport (\n \"testing\"\n)\n\ntype Any interface{}\n\nfunc Failure(t *testing.T, msg ...Any) {\n t.Fail()\n t.Log(msg)\n}\n\nfunc CheckEqual(t *testing.T, x, y Any) {\n if x != y {\n Failure(t, x, \"!=\", y... | go | edit | 0 | 2 | mit | 6aa35591c605be93b71e60e3bca8ea7b926bd449 | quintenpalmer/attempt,quintenpalmer/attempt,quintenpalmer/attempt,quintenpalmer/attempt | src/unittest/testing.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/crockeo/personalwebsite/database\"\n\t\"github.com/crockeo/personalwebsite/handlers\"\n\t\"github.com/go-martini/martini\"\n)\n\n// The main function\nfunc main() {\n\tm := martini.Classic()\n\n\tm.use(d... | go | edit | 0 | 3 | mit | ca73de178216d5584113221f2d35216323e25b31 | crockeo/personalwebsite,crockeo/personalwebsite,crockeo/personalwebsite,crockeo/personalwebsite,crockeo/personalwebsite | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sortedmap\n\nfunc (sm *SortedMap) keys(lowerBound, upperBound interface{}) ([]interface{}, bool) {\n\tidxBounds := sm.boundsIdxSearch(lowerBound, upperBound)\n\tif idxBounds == nil {\n\t\treturn nil, false\n\t}\n\treturn sm.sorted[idxBo... | go | edit | 9 | 2 | mit | 56a8b046f196031932ce8aed7395f5b19257c642 | umpc/go-sortedmap | keys.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jupiterbrain\n\ntype Instance struct {\n\tID string `json:\"id\"`\n\tIPAddresses []string `json:\"ip_addresses\"`\n\tState string `json:\"state\"`\n}\n\n```\n\nApply this change: Remove JSON tags on Instance struct in... | go | edit | 0 | 0 | mit | a18141bd8c9c5e5c07ded69c0df3172ef885faac | Tiger66639/jupiter-brain,Tiger66639/jupiter-brain,travis-ci/jupiter-brain,travis-ci/jupiter-brain | instance.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc loadFromEnv(keys ...string) (map[string]string, error) {\n\tenv := make(map[string]string)\n\n\tfor _, key := range keys {\n\t\tv := os.Getenv(key)\n\t\tif v == \"\" {\n\t\t\treturn nil, ... | go | edit | 0 | 3 | mit | 2a00846b6fe3da7293bbd6f758c3db100654f058 | hackebrot/go-librariesio | librariesio/cmd/librariesio/main.go | rejected_duplicate | Near-duplicate of sample 117877 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gop\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/segmentio/go-loggly\"\n)\n\n// A timber.LogWriter for the loggly service.\n\n// LogglyWriter is a Timber writer to send logging to the loggly\n// service. See: https://loggly.com.\ntype Loggl... | go | edit | 6 | 2 | bsd-3-clause | 1d315088c82360946b127712b38ce28da7b2ee16 | cocoonlife/gop | timer_loggly_writer.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage webhook\n\nimport (\n\t\"os\"\n\t\"strings\"\n\t\"io/ioutil\"\n\t\"encoding/json\"\n)\n\ntype Configuration struct {\n\tWebServerPort uint16 `json:\"webserver-port\"`\n\tEndpointName string `json:\"endpoint-name\"... | go | edit | 9 | 2 | mit | 3c568797015b1bc4c375a72d20b7d603d9779762 | tappsi/airbrake-webhook,oscar-lopez/airbrake-webhook | webhook/config.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/cunnie/sslip.io/src/xip\"\n\t\"log\"\n\t\"net\"\n)\n\nfunc main() {\n\tconn, err := net.ListenUDP(\"udp\", &net.UDPAddr{Port: 53})\n\tif err != nil {\n\t\tlog.Fatal(err.Error())\n\t}\n\n\tquery := make([... | go | edit | 3 | 4 | apache-2.0 | d8603de7acebfbbd54101024afad03781375ea7e | cunnie/sslip.io,cunnie/sslip.io,cunnie/sslip.io,cunnie/sslip.io | src/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rss\n\nimport (\n\t\"strings\"\n\t\"time\"\n)\n\nfunc parseTime(s string) (time.Time, error) {\n\tformats := []string{\n\t\t\"Mon, _2 Jan 2006 15:04:05 MST\",\n\t\t\"Mon, _2 Jan 2006 15:04:05 -0700\",\n\t\ttime.ANSIC,\n\t\ttime.UnixDate... | go | edit | 0 | 3 | bsd-3-clause | df80468eeb1bf83a3b766b324badb36f6f0a6c82 | th3oSMith/rss | time.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ole\n\nimport (\n\t\"fmt\"\n\t\"syscall\"\n\t\"unicode/utf16\"\n\t\"unsafe\"\n)\n\ntype SAFEARRAYBOUND struct {\n\tCElements uint32\n\tLLbound int32\n}\n\ntype SAFEARRAY struct {\n\tCDims uint16\n\tFFeatures uint16\n\tCbElements... | go | edit | 0 | 0 | mit | b0da8cb83e5737c5da4e2c324ea130ed84913e09 | go-ole/go-ole | safearray.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n \"fmt\"\n \"encoding/json\"\n \"net/http\"\n \"menteslibres.net/gosexy/redis\"\n)\n\nvar client *redis.Client\nvar redisKey = \"analytics\"\n\nfunc redisConnect(host string, port uint)(error) {\n var err error\n ... | go | edit | 0 | 2 | mit | f929c3791e4c1f05d4bdd507086b0a5befdbffbd | joshmcarthur/go-analytics,joshmcarthur/go-analytics | analytics.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\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\"`\n}\n\ntype OidcTo... | go | edit | 0 | 5 | mit | b11ea30dd5352e96e5de46f8960895d62478fa95 | buildkite/agent,buildkite/agent,buildkite/agent | api/oidc.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage goage\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\ntype AgeTestCandidate struct {\n\tBirthDate time.Time\n\tCheckingTime time.Time\n\tExpectedAge int\n}\n\nvar AgeTestCandidates = []AgeTestCandidate{\n\t{time.Date(2000, 3, 14, 0, 0,... | go | edit | null | null | mit | 23dd91036aaad0bde8cccbf15ecb6d8a4047efee | bearbin/go-age | go-age_test.go | rejected_syntax | Syntax error detected by tree-sitter | false |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sirius\n\nimport (\n\t\"time\"\n)\n\ntype Execution struct {\n\tExt Extension\n\tMsg Message\n\tCfg ExtensionConfig\n}\n\ntype ExecutionResult struct {\n\tErr error\n\tAction MessageAction\n}\n\ntype ExtensionRunner interface {\n\tRu... | go | edit | 15 | 5 | mit | df2f61e1c3cf44afb30b7fa9a7a5995ac25af062 | kayex/sirius | execution.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage net\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"github.com/onsi/gomega\"\n)\n\nfunc HaveAllRequestsCalled() gomega.OmegaMatcher {\n\treturn allRequestsCalledMatcher{}\n}\n\ntype allRequestsCalledMatcher struct{}\n\nfunc (matcher allReques... | go | edit | 3 | 4 | apache-2.0 | 1e64cdea4514027e815b24f56f68f3f3cdf621ec | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli | src/testhelpers/net/all_requests_called_matcher.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\n\t. \"github.com/VonC/godbg\"\n\t\"github.com/VonC/godbg/exit\"\n\t. \"github.com/smartystreets/goconvey/convey\"\n)\n\nfunc TestMain(t *testing.T) {\n\n\texiter = exit.New(func(int) {})\n\n\tConvey(\"... | go | edit | 30 | 1 | mit | bc62a11c24fc6c40d97c4d198fdec9846502bcb0 | VonC/senvgo,VonC/senvgo | senv_test.go | rejected_lint | Too many lint violations: 30 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/cloudfoundry/cli/plugin\"\n)\n\ntype BasicPlugin struct{}\n\nfunc (c *BasicPlugin) Run(cliConnection plugin.CliConnection, args []string) {\n\tif args[0] == \"nuke-pave\" {\n\t\tfmt.Println(... | go | edit | 0 | 3 | mit | 71092572448c3e529982877e29d7ed0b6da68228 | JesseTAlford/nuke-pave,JesseTAlford/nuke-pave | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage pqx\n\nimport (\n\t\"testing\"\n)\n\nfunc TestConnect(t *testing.T) {\n\tconn, err := Connect(map[string]string{\"socket\": \"/private/tmp/.s.PGSQL.5432\"})\n\tif err != nil {\n\t\tt.Fatal(\"Unable to establish connection\")\n\t}\n\n\te... | go | edit | 6 | 4 | mit | b04166bcf50aa5009a05348be6afd1697bdd3575 | rsto/pgx,jackc/pgx,jackc/tern,silviucm/pgx,deoxxa/pgx,silviucm/pgx,jackc/pgx,jackc/pgx,josephglanville/pgx,jonasi/pgx,silviucm/pgx,plopik/pgx,plopik/pgx,jackc/tern-deb,plopik/pgx,jackc/pgx,axsy-dev/tern,kelvich/pgx | conn_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage git\n\n/*\n#include <git2.h>\n*/\nimport \"C\"\nimport (\n\t\"runtime\"\n)\n\nfunc (repo *Repository) GraphDescendantOf(commit, ancestor *Oid) (bool, error) {\n\truntime.LockOSThread()\n\tdefer runtime.UnlockOSThread()\n\n\tret := C.git... | go | edit | 15 | 2 | mit | dddcbb71c45932feef3c2d0fe6fbdf375b0de644 | orivej/git2go,treejames/git2go,treejames/git2go,Acidburn0zzz/git2go,kissthink/git2go,sygool/git2go,pks-t/git2go,sygool/git2go,hwjeong/git2go,clns/git2go,pks-t/git2go,libgit2/git2go,clearr/git2go,joseferminj/git2go,michaeledgar/git2go,ezwiebel/git2go,TheDahv/git2go,AaronO/git2go,AaronO/git2go,libgit2/git2go,ezwiebel/git... | graph.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage config\n\nimport (\n\t\"github.com/stretchr/testify/assert\"\n\t\"regexp\"\n\t\"testing\"\n)\n\nvar configYaml = `---\nrepos:\n df: zerowidth/dotfiles\n`\nvar invalidYaml = \"---\\nrepos: []\"\n\nvar repoMap = map[string]string{\n\t\"d... | go | edit | 12 | 3 | mit | 1d1bad07b82a823e6e1a2bd1d7156ac85bdf43a1 | zerowidth/gh-shorthand,zerowidth/gh-shorthand | config/config_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 Martin Hebnes Pedersen (LA5NTA). All rights reserved.\n// Use of this source code is governed by the MIT-license that can be\n// found in the LICENSE file.\n\npackage main\n\nimport \"unicode\"\n\nfunc SplitFunc(c rune) bool {... | go | edit | 0 | 3 | mit | a7ca5852fe502197889fe664d95e333897defb73 | la5nta/pat,la5nta/pat,la5nta/pat,la5nta/pat | utils.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Challenge 51 - Compression Ratio Side-Channel Attacks\n// http://cryptopals.com/sets/7/challenges/51\n\npackage cryptopals\n\nimport (\n\t\"bytes\"\n\t\"compress/flate\"\n\t\"crypto/aes\"\n\t\"crypto/cipher\"\n\t\"io\"\n\t\"text/template\"\n... | go | edit | 6 | 1 | mit | 1be1c86dee54acb44eab9e009e01993eb3f4faf8 | Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go | challenge51.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage perms\n\nimport (\n\t\"database/sql\"\n\n\t\"github.com/techjanitor/pram-libs/db\"\n\te \"github.com/techjanitor/pram-libs/errors\"\n)\n\n// get the user info from id\nfunc Check(uid, ib uint) (allowed bool, err error) {\n\n\t// check f... | go | edit | 0 | 8 | mit | d64c4059d3dbdc4f0251e98ab9583824a31301d8 | eirka/eirka-libs | perms/perms.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net\"\n\n\t\"github.com/sirupsen/logrus\"\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc handleConnection(conn net.Conn, sshServerConfig *ssh.ServerConfig) {\n\tdefer conn.Close()\n\tdefer logrus.WithField(\"... | go | edit | 12 | 5 | apache-2.0 | b7cac8362a2c6cde5f96a278aefa500e8a8d296f | jaksi/sshesame | connection.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*-\n * Copyright (c) 2016, 1&1 Internet SE\n * Copyright (c) 2016, Jörg Pernfuß <<EMAIL>>\n * All rights reserved\n *\n * Use of this source code is governed by a 2-clause BSD license\n * that can be found in the LICENSE file.\n */\n\n// Packa... | go | edit | 0 | 1 | bsd-2-clause | 1f3f00407aec774e47493353390622ee1efd5a24 | 1and1/soma | internal/stmt/name.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nfunc main() {\n}\n\n```\n\nApply this change: Implement the command and accept the profit value as a command line parameter"
},
{
"role": "assistant",
"content": "package main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"... | go | edit | 9 | 3 | mit | 9eb88c578b43a36fca89513f00e4b0cfe3fbbca7 | ghthor/lottery-scraper | main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage qexec\n\nimport (\n\t\"bytes\"\n\t\"github.com/kballard/go-shellquote\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n)\n\n// Run executes the command in parameter after having correctly quoted it.\n// The command stdout is returned.\nfunc R... | go | edit | 3 | 4 | mit | 9a10b651b45fc520cd73106575371e7024702d0a | tbruyelle/qexec | qexec.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\"net/http\"\n\t\"net/http/httptest\"\n\t\"net/http/httputil\"\n\n\t\"golang.org/x/crypto/ssh\"\n)\n\nfunc handleDirectTCPIPChannel(channel ssh.Channel, port uint32) (string, error) {\n\tswitc... | go | edit | 0 | 4 | apache-2.0 | 36289f7a5e1cc17bb19d2c100374120fb97fb157 | jaksi/sshesame | tcpip.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !no_ldflags\n\npackage oiio\n\n// #cgo LDFLAGS: -L/usr/local/lib -lOpenImageIO -lboost_thread-mt -lboost_system-mt\nimport \"C\"\n\n```\n\nApply this change: Update LDFLAGS for newer boost libs"
},
{
"role": "assistant",
"... | go | edit | 0 | 0 | mit | ceb9c91e2b449142055d4de1f3928b8fa06cb0dd | justinfx/openimageigo,justinfx/openimageigo,justinfx/openimageigo | clibs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mock\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"runtime\"\n\n\thttpmock \"gopkg.in/jarcoal/httpmock.v1\"\n)\n\n// RegisterURL for given url and return 200 status register mock http responder\nfunc RegisterURL(url ... | go | edit | 0 | 3 | apache-2.0 | 8d972ed4312ed6337878d56e05cf7e5b57bed0db | cloudflare/unsee,cloudflare/unsee,cloudflare/unsee,cloudflare/unsee,cloudflare/unsee | mock/mock.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage fnlog_test\n\nimport (\n\t\"github.com/northbright/fnlog\"\n\t\"log\"\n)\n\nvar (\n\tnoTagLog *log.Logger\n)\n\nfunc Example() {\n\tiLog := fnlog.New(\"i\")\n\twLog := fnlog.New(\"w\")\n\teLog := fnlog.New(\"e\")\n\n\tiLog.Printf(\"prin... | go | edit | 3 | 1 | mit | 3f748b82e899a672665114b3efa600ec8261fbbb | vonwenm/fnlog | unit_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage jwp\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"net/http\"\n)\n\nfunc CheckHTTPStatus(res *http.Response, body []byte) (err error) {\n\tif res.StatusCode >= 400 && res.StatusCode < 600 {\n\t\tfmt.Println(\"\\t...\")\n\t\terr = errors.New(... | go | edit | 72 | 25 | mit | 682d2160fb1f53f969736ac90e0ccdf97e4d1127 | kofj/go.jwp,kofj/go.jwp | errors.go | rejected_lint | Too many lint violations: 72 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/binary\"\n\t\"fmt\"\n)\n\ntype OneTimeAuthHandler struct {\n\tusername string\n\tpassword string\n}\n\nfunc (a *OneTimeAuthHandler) Init(username string) {\n\ta.username = username\n}\n\... | go | edit | 3 | 2 | mit | 9d5a3cdf1fa4223c0f8da2b74ab0dd3b35df7fda | ninjasphere/sphere-setup-assistant,ninjasphere/sphere-setup-assistant | OneTimeAuthHandler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage diff\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/kr/pretty\"\n\t\"github.com/xchapter7x/enaml\"\n)\n\ntype boshReleaseDiffer struct {\n\trelease1 *boshRelease\n\trelease2 *boshRelease\n}\n\nfunc (d boshReleaseDiffer) Diff() (result Result,... | go | edit | 18 | 3 | apache-2.0 | 029fd7079281fd491e5b7df9b41dad7c41025984 | enaml-ops/enaml,xchapter7x/enaml | diff/boshreleasediffer.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage speaker\n\nconst speakerTmpl = `+++\nTitle = \"{{ .Title }}\"\ntype = \"speaker\"\n{{- with .Website }}\nwebsite = \"{{ . }}\"\n{{- end }}\n{{- with .Twitter }}\ntwitter = \"{{ . }}\"\n{{- end }}\n{{- with .Facebook }}\nfacebook = \"{{ ... | go | edit | 0 | 0 | mit | 9027c2840aee7112d5c8ae0161ac93b2aef7aee1 | devopsdays/devopsdays-cli,mattstratton/probablyfine,devopsdays/devopsdays-cli | speaker/templates.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/kayex/sirius\"\n\t\"github.com/kayex/sirius/config\"\n\t\"github.com/kayex/sirius/extension\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc main() {\n\tcfg := config.FromEnv()\n\n\trmt := sirius.NewRemote(c... | go | edit | 0 | 2 | mit | 4af63e93bb712667decea0e764ed1f6a0fa91cd9 | kayex/sirius | cmd/sirius-cloud/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"gopkg.in/wolfeidau/go-buildkite.v1\"\n\t\"gopkg.in/alecthomas/kingpin.v2\"\n)\n\nvar (\n\tapiToken = kingpin.Flag(\"token\", \"API token\").Required().String()... | go | edit | 9 | 4 | bsd-2-clause | 2ff2d63c780ab137d6e974ca999bcef9eeb245a0 | buildkite/go-buildkite,wolfeidau/go-buildkite | examples/projects/main.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"fmt\"\n\t\"os/exec\"\n\t\"strings\"\n)\n\n// GpgDetachedSign signs file with detached signature in ASCII format\nfunc GpgDetachedSign(source string, destination string) error {\n\tfmt.Printf(\"v = %#v\\n\", string... | go | edit | 0 | 2 | mit | c1c1776768902f26160af59b689f14c17e80068a | jola5/aptly,aptly-dev/aptly,scalp42/aptly,jola5/aptly,seaninspace/aptly,adfinis-forks/aptly,adfinis-forks/aptly,ceocoder/aptly,sobczyk/aptly,seaninspace/aptly,gearmover/aptly,vincentbernat/aptly,scalp42/aptly,vincentbernat/aptly,neolynx/aptly,gearmover/aptly,adfinis-forks/aptly,bsundsrud/aptly,ceocoder/aptly,bsundsrud/... | utils/gpg.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/WhiteHatCP/seclab-listener/backend\"\n\t\"github.com/WhiteHatCP/seclab-listener/server\"\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"syscall\"\n)\n\nfunc main() {\n\tsyscall.Umask(0007)\n\n\tsocket := \"seclab.... | go | edit | 3 | 2 | mit | 784eed897602168d52d364e2bc9ee4d22a103152 | WhiteHatCP/seclab-listener,WhiteHatCP/seclab-listener | seclab.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage octokit\n\nconst (\n\tgitHubAPIURL = \"https://api.github.com\"\n\tuserAgent = \"Octokit Go \" + version\n\tversion = \"0.3.0\"\n\tdefaultMediaType = \"application/vnd.github.v3+json; charset=utf-8\"\n)\n\n```\n\nApp... | go | edit | 0 | 0 | mit | fc9ce3b8e8ab11cdb3a804a8ad382e1e509076d4 | octokit/go-octokit,half-ogre/go-octokit,pcasaretto/go-octokit,calavera/go-octokit,pcasaretto/go-octokit,half-ogre/go-octokit,octokit/go-octokit,calavera/go-octokit | octokit/octokit.go | rejected_duplicate | Near-duplicate of sample 116989 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gobatch\n\nimport (\n\t\"errors\"\n\t\"testing\"\n\n\t\"github.com/MasterOfBinary/gobatch/mocks\"\n)\n\nfunc TestMust(t *testing.T) {\n\tbatch := &mocks.Batch{}\n\tif Must(batch, nil) != batch {\n\t\tt.Error(\"Must(batch, nil) != batch\... | go | edit | 6 | 3 | mit | db082120723090c878a54148f2bf40d91b9fbf33 | MasterOfBinary/gobatch | batch_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage norman\n\nimport (\n\tnormanapi \"github.com/rancher/norman/api\"\n\t\"github.com/rancher/norman/types\"\n\t\"github.com/rancher/rancher/pkg/settings\"\n)\n\nfunc NewServer(schemas *types.Schemas) (*normanapi.Server, error) {\n\tserver ... | go | edit | 0 | 4 | apache-2.0 | b7aec6d78fbf88acc71f1fc97c20f2dd67ae9396 | rancher/rancher,rancher/rancher,rancherio/rancher,rancher/rancher,rancher/rancher,rancherio/rancher | pkg/api/norman/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/************************************************\n* client.go\n* Author: Jeramy Singleton\n* Date: 12 April 2015\n*\n* Description: A client is a remote user that\n* has connected to the server. Information for\n* the client should be stored... | go | edit | 0 | 0 | mit | 01333813814eb47fd91c6181733d921b6e2aa4f4 | HamsterWheels/magenta-server-go | client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage engine_test\n\nimport (\n\t\".././engine\"\n\t\"github.com/ghthor/gospec/src/gospec\"\n\t\"testing\"\n)\n\nfunc TestAllSpecs(t *testing.T) {\n\tr := gospec.NewRunner()\n\n\tr.AddSpec(engine.DescribeClock)\n\tr.AddSpec(engine.DescribeTim... | go | edit | 0 | 1 | mit | e48a9fb49874f322386d04b7cee4e8789154677a | ghthor/filu | spec_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/jutkko/mindown/input\"\n\t\"github.com/urfave/cli\"\n)\n\nfunc main() {\n\tapp := cli.NewApp()\n\tapp.Name = \"mindown\"\n\tapp.Usage = \"convert mind to files\"\n\tapp.Flags = []c... | go | edit | 0 | 3 | mit | 706570f82a9a921be943e0c196049969c3eaf25e | jutkko/mindown,jutkko/mindown | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage boardgame\n\ntype State struct {\n\t//The version number of the state. Increments by one each time a Move is\n\t//applied.\n\tVersion int\n\t//The schema version that this state object uses. This number will not\n\t//change often, but i... | go | edit | 0 | 0 | apache-2.0 | 57d2287c5cdbd33f08589ca941d887cbad7f3ab9 | jkomoros/boardgame,jkomoros/boardgame,jkomoros/boardgame | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage golog\n\nimport . \"github.com/mndrix/golog/term\"\n\nimport \"testing\"\n\nfunc TestFacts (t *testing.T) {\n db := NewDatabase().\n Asserta(NewTerm(\"father\", NewTerm(\"michael\"))).\n Asserta(NewTerm(\"father... | go | edit | 12 | 6 | mit | b7c9d3a292dc21878b26e437e4f2ed0e8ce911b9 | samuell/golog,mndrix/golog,samuell/golog,bransorem/golog,mndrix/golog,bransorem/golog,vzaramel/golog,vzaramel/golog | prove_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage db\n\nimport (\n\t\"database/sql\"\n\tsq \"github.com/lann/squirrel\"\n\t\"time\"\n)\n\nvar LedgerRecordSelect sq.SelectBuilder = sq.\n\tSelect(\"hl.*\").\n\tFrom(\"history_ledgers hl\")\n\ntype LedgerRecord struct {\n\tHistoryRecord\n\... | go | edit | 3 | 0 | apache-2.0 | ca4cbeca56eeff402465984327e61c0d1fd9a723 | masonforest/go-horizon,irisli/horizon,irisli/horizon,masonforest/horizon,masonforest/horizon,irisli/horizon,nullstyle/go-horizon,masonforest/horizon,stellar/horizon,nullstyle/go-horizon,stellar/horizon,masonforest/go-horizon,nullstyle/go-horizon,stellar/horizon,masonforest/go-horizon | src/github.com/stellar/horizon/db/record_ledger.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage daemon\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/elves/elvish/util\"\n)\n\nfunc TestDaemon(t *testing.T) {\n\tutil.InTempDir(func(string) {\n\t\tserverDone := make(chan struct{})\n\t\tgo func() {\n\t\t\tServe(\"sock\", \"... | go | edit | 6 | 5 | bsd-2-clause | c355c0c6adc5c37ff76963240968fbeeb2f8ce55 | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | daemon/daemon_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2021 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 | 9 | 4 | apache-2.0 | 0467af4b6f410ed145819955547637f704f15d21 | tektoncd/operator,tektoncd/operator,tektoncd/operator | pkg/apis/operator/v1alpha1/tektonconfig_defaults.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage diego_errors\n\nfunc SanitizeErrorMessage(message string) string {\n\tswitch message {\n\tcase\n\t\tINSUFFICIENT_RESOURCES_MESSAGE,\n\t\tMISSING_APP_BITS_DOWNLOAD_URI_MESSAGE,\n\t\tMISSING_APP_ID_MESSAGE,\n\t\tMISSING_TASK_ID_MESSAGE,\n... | go | edit | 18 | 2 | apache-2.0 | 9bdab6faa692cba4e5b21cf9563c41fce06e71ab | cloudfoundry-incubator/runtime-schema | diego_errors/sanitization.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage swarm\n\nimport (\n\t\"fmt\"\n\n\t\"golang.org/x/net/context\"\n\n\t\"github.com/docker/docker/cli\"\n\t\"github.com/docker/docker/cli/command\"\n\t\"github.com/spf13/cobra\"\n)\n\ntype leaveOptions struct {\n\tforce bool\n}\n\nfunc new... | go | edit | 0 | 2 | apache-2.0 | bfbdb15f555956fea7a377be30db31a4e231fb8d | Zebrilee/cli,allencloud/cli,thaJeztah/cli,ashfall/cli,thaJeztah/cli,cpuguy83/cli,dnephin/cli,riyazdf/cli,redpanda/cli,e11137/cli,Zebrilee/cli,gdevillele/cli,ashfall/cli,riyazdf/cli,dnephin/cli,docker/cli,cpuguy83/cli,e11137/cli,redpanda/cli,docker/cli,allencloud/cli | command/swarm/leave.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// $G $D/$F.go && $L $F.$A && (! ./$A.out || echo BUG: should not succeed)\n\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npa... | go | edit | 18 | 4 | bsd-3-clause | 016fd1dee1d652fa6589db05cb2d9aac9e50249a | abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go | test/bugs/bug113.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cloudsql\n\nimport (\n\t\"crypto/rand\"\n\t\"encoding/base64\"\n\t\"fmt\"\n)\n\nconst (\n\tmaxUsernameLength = 16 // Limit from http://dev.mysql.com/doc/refman/5.7/en/user-names.html\n\tgeneratedPasswordLength = 32\n)\n\nfunc Gene... | go | edit | 0 | 3 | apache-2.0 | 393d60c08e460f3af329e3c2bd1d0e15df58e3fc | joshlong/gcp-service-broker,GoogleCloudPlatform/gcp-service-broker,joshlong/gcp-service-broker,rifung/gcp-service-broker,rifung/gcp-service-broker,rifung/gcp-service-broker,GoogleCloudPlatform/gcp-service-broker,rifung/gcp-service-broker | brokerapi/brokers/cloudsql/credentials_generator.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage middleware\n\nimport (\n\t\"net/http\"\n\n\tnextSkyerr \"github.com/skygeario/skygear-server/pkg/core/skyerr\"\n\t\"github.com/skygeario/skygear-server/pkg/server/skyerr\"\n)\n\n// RecoverHandler provides an interface to handle recovere... | go | edit | 0 | 3 | apache-2.0 | 2940f98a891b236f31385344e48691d2e101c2fd | SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server,SkygearIO/skygear-server | pkg/core/middleware/recover.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"github.com/goerlang/node\"\n\t\"log\"\n)\n\nvar enableNode bool\nvar nodeName string\nvar nodeCookie string\n\nfunc init() {\n\tflag.BoolVar(&enableNode, \"node\", false, \"start erlang node\")\n\tflag.... | go | edit | 3 | 2 | mit | 13cf2a7d4342b448fc2722fb8e5e17f2cbd1bda4 | goerlang/eclus | src/eclus/enode.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage ergo\n\ntype Handler interface {\n\tServeHTTP(*Response, *Request)\n}\n\ntype HandlerFunc func(*Response, *Request)\n\nfunc (f HandlerFunc) ServeHTTP(w *Response, r *Request) {\n\tf(w, r)\n}\n\n// Operation\n\ntype Operation struct {\n\... | go | edit | 12 | 1 | mit | 762d4cf4d60a92365c2644cd014ce650553885ac | wlMalk/ergo | operation.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage xbmc\n\nimport (\n\t\"github.com/streamboat/xbmc_jsonrpc\"\n\n\t. \"github.com/pdf/xbmc-callback-daemon/log\"\n)\n\n// Execute takes an XBMC JSON-RPC Connection and a callback, and performs the\n// RPC request contained in the callback\... | go | edit | 3 | 2 | mit | 2909ffee3945d714a9a028f45066ae2f9a0b4761 | pdf/kodi-callback-daemon,siam28/kodi-callback-daemon | xbmc/execute.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage client\n\nimport (\n\t\"github.com/Symantec/Dominator/lib/hash\"\n\t\"github.com/Symantec/Dominator/lib/srpc\"\n\t\"github.com/Symantec/Dominator/proto/sub\"\n)\n\nfunc fetch(client *srpc.Client, serverAddress string,\n\thashes []hash.H... | go | edit | 0 | 1 | apache-2.0 | db9dc306681fe5ee02de7447f160dead84568d47 | keep94/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator,keep94/Dominator | sub/client/fetch.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage virtualboxclient\n\nimport (\n\t\"github.com/appropriate/go-virtualboxclient/vboxwebsrv\"\n)\n\ntype Medium struct {\n\tmanagedObjectId string\n}\n\nfunc (svc *VirtualBoxClient) CreateHardDisk(format, location string) (*Medium, error) {... | go | edit | 3 | 2 | mit | 36117bf0dd5eab601ee1996c6392f288efab81f6 | appropriate/go-virtualboxclient | virtualboxclient/medium.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Copyright 2015 Benoit LETONDOR\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * ... | go | edit | 0 | 3 | apache-2.0 | 89f8794cea81b5be2f5cf5377ee2ece011118c3e | benoitletondor/TwitterBot | app/db/db.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015, Klaus Post, see LICENSE for details.\n\npackage mgopw\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/klauspost/password/drivers\"\n\t\"gopkg.in/mgo.v2\"\n)\n\n// Test a Mongo database\nfunc TestMongo(t *testing.T) {... | go | edit | 6 | 6 | mit | 759482113028cc097cf3ea5af9786a1f1ab13433 | klauspost/password | drivers/mgopw/mgo_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\nimport (\n\tapi \"github.com/diyan/assimilator/api/endpoints\"\n\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// Organizations\n\... | go | edit | 0 | 1 | mit | cb9094a671d738607f9af4185c3b8bd722c69b93 | diyan/assimilator,diyan/assimilator,diyan/assimilator | api/routes.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage app\n\nimport (\n\t\"github.com/go-kit/kit/log\"\n\t\"github.com/goph/emperror\"\n)\n\n// Service implements the RPC server\ntype Service struct {\n\tlogger log.Logger\n\terrorHandler emperror.Handler\n}\n\n// NewService creates a... | go | edit | 0 | 1 | mit | b542d297643b3872808a65c867e915fa0b6b36c9 | deshboard/boilerplate-grpc-service,deshboard/boilerplate-model-service | app/service.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage state\n\n// State represents the state of a hosts\ntype State int\n\nconst (\n\tNone State = iota\n\tRunning\n\tPaused\n\tSaved\n\tStopped\n\tStopping\n\tStarting\n\tError\n)\n\nvar states = []string{\n\t\"\",\n\t\"Running\",\n\t\"Pause... | go | edit | 0 | 3 | apache-2.0 | 484f81e1cea226267bb4256bb21ebaa1427d16d0 | justintung/machine,bfirsh/machine,legal90/machine,abstractitptyltd/machine,kunalkushwaha/machine,danix800/docker.github.io,usmanismail/machine,menglingwei/denverdino.github.io,mjtrefethen/machine,ksasi/machine,rillig/docker.github.io,shot/machine,seegno-forks/machine,emsi/machine,erikdejonge/machine,anweiss/docker.gith... | state/state.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage caddycmd\n\nimport (\n\t\"log\"\n\n\t\"bitbucket.org/lightcodelabs/caddy2\"\n)\n\n// Main executes the main function of the caddy command.\nfunc Main() {\n\terr := caddy2.StartAdmin(\"127.0.0.1:1234\")\n\tif err != nil {\n\t\tlog.Fatal(... | go | edit | 0 | 2 | apache-2.0 | c24a3e389fc63a2cf3d51e0afd743047514ff1d5 | mholt/caddy,l3dlp/caddy,l3dlp/caddy,abiosoft/caddy,l3dlp/caddy,mholt/caddy,abiosoft/caddy | cmd/run.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build !windows\n\npackage input\n\nimport (\n\t\"os\"\n\t\"syscall\"\n\n\t\"github.com/elastic/libbeat/logp\"\n)\n\nfunc IsSameFile(path string, info os.FileInfo, state *FileState) bool {\n\tfstat := info.Sys().(*syscall.Stat_t)\n\n\treturn... | go | edit | 6 | 2 | mit | 07a04f22530e038f734a98c7f30702b869479527 | yapdns/yapdnsbeat,yapdns/yapdnsbeat | input/filecompare.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage consumergroup\n\nimport \"testing\"\n\nfunc TestConfigValidate(t *testing.T) {\n\tconf := NewConfig()\n\tconf.ZkList = []string{}\n\tconf.TopicList = []string{}\n\tif err := conf.validate(); err == nil {\n\t\tt.Fatal(\"config invalidate... | go | edit | 3 | 7 | mit | 24ab4dace4fe2f6b0d96d6d7db576b84bfda31eb | meitu/go-consumergroup,meitu/go-consumergroup | config_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage nsqhandler\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"github.com/apex/log\"\n)\n\nvar start = time.Now()\n\ntype PublishFunc func(topic string, body []byte) error\n\ntype MarshalFunc func(x interface{}) ([]byte, error)\n\ntype Handler s... | go | edit | 0 | 2 | bsd-3-clause | ea5db870b81b0f62a62e21f3c7cf2fedce051255 | avct/apexovernsq | nsqhandler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage data\n\n// Definition stores information about a system, used for importing data.\ntype Definition struct {\n\tTitle string\n\tType string\n\tEnv string\n\tLocation string\n\tUser string\n\tPassword string\n\tURL st... | go | edit | 0 | 0 | apache-2.0 | c8c481f32f876b848ba05a4dfef2e7f9ef08da9f | appPlant/alpinepass,appPlant/alpinepass | data/structs.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tword := os.Args[1]\n\tif len(os.Args) != 2 {\n\t\tfmt.Println(\"Exactly one argument is required\")\n\t\tos.Exit(1)\n\t}\n\ts := strings.Split(word, \"\")\n\tge... | go | edit | 0 | 4 | mit | e2bd4261796d40a3bb47ce84cb30c72e328c483d | rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/ple,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/ple,rtoal/polyglot,rtoal/polyglot,rtoal... | go/anagrams.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage github\n\ntype User struct {\n\tId int `json:\"id\"`\n\tLogin string `json:\"login\"`\n}\n\n```\n\nApply this change: Rename Id field to ID"
},
{
"role": "assistant",
"content": "package github\n\ntype User struct {\n\... | go | edit | 0 | 0 | mit | 993224ed2c05c8589d07f201bfe509d42913e6f2 | jaggs6/rebasebot,chrisledet/rebasebot | github/user.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n\t\"net/http\"\n\t\"strconv\"\n\n\t\"github.com/guregu/kami\"\n\t\"golang.org/x/net/context\"\n)\n\nfunc main() {\n\tkami.Get(\"/contacts\", getContacts)\n\tkami.Serve()\n}\n\nfunc getCo... | go | edit | 3 | 4 | mit | a6ccdd01a60743d7eae5e5ac3b2df3e697bd0325 | konjoot/benches,konjoot/benches,konjoot/benches | kami/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dmm\n\n// Base may not be needed, but the idea is that there are some functions that\n// could be abstracted out to the general DMM.\ntype Base interface {\n\tDCVolts() (v float64, err error)\n\tACVolts() (v float64, err error)\n}\n\n``... | go | edit | 0 | 1 | mit | 6ac9735e4a5b47830bdb2cdaf30bc0c20437157b | gotmc/ivi | dmm/dmm.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage model\n\nimport (\n\t\"errors\"\n\n\t\"gopkg.in/mgo.v2/bson\"\n)\n\n// A user of the system\ntype User struct {\n\tID bson.ObjectId `json:\"-\" bson:\"_id,omitempty\"`\n\tUsername string `json:\"user-name\" bson:\"u... | go | edit | 0 | 2 | apache-2.0 | 4802cfd22e2ce8d1ee17e171c4543edcc000afe1 | LewisWatson/carshare-back | model/user.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n\n\t\"github.com/stretchr/testify/assert\"\n)\n\nfunc TestUnderscoreCaseName(t *testing.T) {\n\tassert.Equal(t, \"notify_event\", underscoreCaseName(\"NotifyEvent\"))\n\tassert.Equal(t, \"repository\", u... | go | edit | 18 | 1 | bsd-3-clause | ef0841a2efe46ed2626407e34ec1153c8eedc83c | tehleach/mockery,vektra/mockery,codeactual/mockery,vektra/mockery | cmd/mockery/mockery_test.go | rejected_lint | Too many lint violations: 18 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2017 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// Package number formats numbers according to the customs of different locales.... | go | edit | 0 | 0 | bsd-3-clause | 29bf0102df0c3c8844ae296826d1a9e7302f26df | golang/text | number/doc.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\"net\"\n\t\"os\"\n\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc main() {\n\tconfigFileName := flag.String(\"config\", \"\", \"config file\")\n\tflag.Parse()\n\n\tcfg, err := getConfig(*configF... | go | edit | 6 | 6 | apache-2.0 | 46d79400e1ac5818a81fcbd7794bf38401f3195c | jaksi/sshesame | main.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage core\n\n// Writer describes an object that tuples can be written to\n// as the output for a Box. Note that this interface was chosen\n// because it also allows a Box to write multiple (or none)\n// output tuples. It is expected that the... | go | edit | 9 | 1 | mit | e1ee8637064c4adaad191fc0bfb0485d6bdb5985 | sensorbee/sensorbee,sensorbee/sensorbee | core/writer.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage virtualboxclient\n\nimport (\n\t\"github.com/appropriate/go-virtualboxclient/vboxwebsrv\"\n)\n\ntype VirtualBox struct {\n\t*vboxwebsrv.VboxPortType\n\n\tusername string\n\tpassword string\n\n\tmanagedObjectId string\n}\n\nfunc New(user... | go | edit | 0 | 3 | mit | de2a451f9c30ada011f0b5e471fd04a3770f9be1 | appropriate/go-virtualboxclient | virtualboxclient/virtualbox.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage puddle\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"github.com/nlopes/slack\"\n\t\"os\"\n)\n\n// RunCLI Starts the command line input shell\nfunc RunCLI() {\n\tfmt.Println(\"Starting Puddle CLI Input...\\n\")\n\tscanner := bufio.NewScanner(... | go | edit | 3 | 2 | mit | 1b80d9bec952c3231479cc7ff3fc80a3ea30addb | perthgophers/puddle,perthgophers/puddle,perthgophers/puddle | puddle/cli.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage netconf\n\ntype NetworkConfig struct {\n\tPreCmds []string `yaml:\"pre_cmds,omitempty\"`\n\tDns DnsConfig `yaml:\"dns,omitempty\"`\n\tInterfaces map[string]InterfaceConfig `yaml:\"interfaces,... | go | edit | 0 | 0 | apache-2.0 | 912bbe55b5a3e0288dc073f5416647434d8c59c1 | rancher/netconf | types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage reporters\n\nimport (\n\t\"os/exec\"\n\n\t\"github.com/approvals/go-approval-tests/utils\"\n)\n\n// NewFrontLoadedReporter creates the default front loaded reporter.\nfunc NewFrontLoadedReporter() Reporter {\n\treturn NewFirstWorkingRep... | go | edit | 39 | 2 | apache-2.0 | 8cc746de7f9a633ec1314779c965fd56b2184044 | approvals/go-approval-tests | reporters/diff_reporter.go | rejected_lint | Too many lint violations: 39 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage image\n\nimport (\n\t\"github.com/Symantec/Dominator/lib/filesystem\"\n\t\"github.com/Symantec/Dominator/lib/filter\"\n\t\"github.com/Symantec/Dominator/lib/triggers\"\n)\n\ntype Image struct {\n\tFilter *filter.Filter\n\tFileSystem... | go | edit | 0 | 0 | apache-2.0 | 59efa7609d196dd3e026473172df99dd75be19b1 | Symantec/Dominator,Symantec/Dominator,keep94/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator | lib/image/api.go | accepted | null | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.