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 jiffy\n\nconst (\n\tcancelTTL = iota\n\textendTTL\n)\n\nvar (\n\tregistry *Registry\n)\n\nfunc GetTopic(name string) *Topic {\n\treturn registry.GetTopic(name)\n}\n\nfunc init() {\n\tregistry = CreateRegistry()\n}\n\n```\n\nApply this c... | go | edit | 9 | 1 | mit | fb4898e962b28e395098cc28d5d1fb988711b6d6 | DavidHuie/jiffy | jiffy.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2016 The LUCI Authors. All rights reserved.\n// Use of this source code is governed under the Apache License, Version 2.0\n// that can be found in the LICENSE file.\n\npackage cloud\n\nimport (\n\t\"google.golang.org/cloud/datastor... | go | edit | 6 | 1 | apache-2.0 | 82bc6ebfec08d065bdf97beb59b632720504ac05 | luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go | gae/impl/cloud/context.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/localghost/packer-pp/parser\"\n\t\"os\"\n\t\"encoding/json\"\n)\n\nfunc main() {\n\ttemplatePath := os.Args[1]\n\tresult, err := parser.ParseFile(templatePath)\n\tif err != nil {\n\t\tfmt.Fpri... | go | edit | 0 | 2 | apache-2.0 | 5ce24b06479a4818d826a77e32f2c6ff970d84e8 | localghost/ppp | main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/minaguib/berlingo\"\n\t\"math/rand\"\n)\n\n/*\nThis example mimicks the functionality in the berlin-ai demo ruby gem at:\nhttps://github.com/thirdside/berlin-ai/\n*/\n\ntype AI1 struct{}\n\nfu... | go | edit | 0 | 5 | mit | 6b83eba8f5148f97f6fb7a31b25bfd24b2d7fa98 | minaguib/berlingo | berlingo/ai1.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage api\n\ntype AuthScope int\ntype AuthScopes map[AuthScope]string\n\ntype ServiceMethod int\ntype EventKey string\n\ntype ObjectFactory func() interface{}\n\ntype HttpMethod string\ntype QueryDefault interface{}\ntype UrlQueries map[strin... | go | edit | 0 | 0 | apache-2.0 | adf52d8d41bc87ea694d5873c8cd5724959e807d | qorio/omni,qorio/omni,qorio/omni,qorio/omni | api/api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage utils\n\nimport (\n\t\"github.com/gorilla/websocket\"\n)\n\ntype WebSocketManager interface {\n\tRegister(ws *websocket.Conn)\n\n\tWrite(msg []byte) (n int, e error)\n}\n\ntype wsManager struct {\n\tsockets []websocket.Conn\n}\n\nfunc C... | go | edit | 0 | 6 | apache-2.0 | 8aeed91e8ac690eb24e74b3cca5b714b69a3a85d | PufferPanel/pufferd | utils/websockettracker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage resources\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/aws/aws-sdk-go/aws/session\"\n\t\"github.com/aws/aws-sdk-go/service/cloudwatchevents\"\n)\n\nfunc init() {\n\tregister(\"CloudWatchEventsRule\", ListCloudWatchEventsRules)\n}\n\nfunc Li... | go | edit | 9 | 3 | mit | d7d429e4ad4063ee3afde696ef363ce49941b434 | rebuy-de/aws-nuke,rebuy-de/aws-nuke | resources/cloudwatchevents-rules.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage filu\n\nimport \"time\"\n\n// An Event is an immutable fact that happened at a single moment in time.\ntype Event interface {\n\tHappenedAt() time.Time\n}\n\n// A Time is a single moment in time. It is used by Implementors\n// of the Ev... | go | edit | 0 | 1 | mit | 527518bc0b99a861b8f544dd0f77673aafc49c3a | ghthor/filu | event.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package trinary implements a function for converting a trinary number to a decimal number.\npackage trinary\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\nconst testVersion = 1\n\n// ParseTrinary converts a trinary number to a decim... | go | edit | 0 | 5 | mit | 8676d52b4dcb792b16c4ecea17277cd4d6dd0c1e | DanShu93/exercism | solutions/go/trinary/trinary.go | rejected_duplicate | Near-duplicate of sample 118283 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/Felamande/filesync/syncer\"\n)\n\nfunc main() {\n\tsyncer.New().Run()\n\thttp.ListenAndServe(\":8070\", nil)\n}\n```\n\nApply this change: Test http server powered by martini"
},
{
... | go | edit | 0 | 3 | mit | af3e52eb0c2eec8c43865530e4b55c88a095b54a | Felamande/filesync,Felamande/filesync | sync.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2015-2016, Cyrill @ Schumacher.fm and the CoreStore contributors\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 co... | go | edit | 0 | 0 | apache-2.0 | 5538acec3cb941d4dfeeded8b75dc851d82cb241 | corestoreio/csfw,corestoreio/csfw | net/doc.go | rejected_duplicate | Near-duplicate of sample 117431 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n//\n// Copyright (c) 2014 The pblcache Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// ht... | go | edit | 3 | 1 | apache-2.0 | a68c6f52c93b7451dcf1d302fde1fb8bd4ccc7b4 | pblcache/pblcache,lpabon/pblcache,pblcache/pblcache,lpabon/pblcache,lpabon/pblcache,pblcache/pblcache | src/apps/pblcached/pblcached.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage scanner\n\nimport (\n\t\"github.com/Symantec/Dominator/lib/filesystem/scanner\"\n\t\"github.com/Symantec/Dominator/lib/objectcache\"\n)\n\nfunc scanFileSystem(rootDirectoryName string, cacheDirectoryName string,\n\tconfiguration *Config... | go | edit | 12 | 3 | apache-2.0 | 388655e8d22c17b3cc7ada6c91967d8813cea253 | keep94/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator | sub/scanner/walk.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage golog\n\nvar Global *LevelLogger = &LevelLogger{\n\t&loggerImpl{&defaultLogOuters, flag_minloglevel},\n}\n\nfunc Info(vals ...interface{}) {\n\tGlobal.Info(vals...)\n}\n\nfunc Infof(f string, args ...interface{}) {\n\tGlobal.Infof(f, ar... | go | edit | 15 | 1 | bsd-2-clause | 00d2c99d36b1cf0e1d317df0eeb2f659a51ae0f5 | awreece/golog | golog.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage storage\n\nimport (\n\t\"github.com/rafaeljusto/toglacier/internal/archive\"\n\t\"github.com/rafaeljusto/toglacier/internal/cloud\"\n)\n\n// Backup stores the cloud location of the backup and some extra information\n// about the files o... | go | edit | 0 | 1 | mit | 9aabba009b7acb2d6782f3ddf33928b9239e7185 | rafaeljusto/toglacier,rafaeljusto/toglacier,rafaeljusto/toglacier | internal/storage/storage.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\trouter := NewRouter()\n\terr := http.ListenAndServe(\":8080\", router)\n\tif err != nil {\n\t\tlog.Fatal(\"ListenAndServe Error: \", err)\n\t}\n}\n\n```\n\nApply this ch... | go | edit | 6 | 2 | mit | 213c80bc286672657ced52e03374b528f20a965e | eddturtle/imagio,eddturtle/imagio | imagio.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage http\n\nvar (\n\tdebugMode = false\n)\n\nfunc setDebug(debug bool) {\n\tdebugMode = debug\n}\n\ntype Error struct {\n\tError string `json:\"error,omitempty\"`\n\tStatusCode int `json:\"statusCode,omitempty\"`\n\tHttpCode int ... | go | edit | 0 | 1 | mit | 4d920ebf664c40e9756bc7a7738699c1041fb26f | pikanezi/http | rjson.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage stun\n\nimport (\n\t\"encoding/binary\"\n\n\t\"github.com/pkg/errors\"\n)\n\ntype ChannelData struct {\n\tChannelNumber uint16\n\tData []byte\n}\n\nfunc NewChannelData(packet []byte) (*ChannelData, error) {\n\tcn, err := getCha... | go | edit | 0 | 3 | mit | 726c5ae6ebedd85c330efb3a263d252f6a30b9a9 | pion/stun,pion/stun | stun/channel-data.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage enemy\n\nimport (\n\t\"board\"\n\t\"color\"\n)\n\ntype Enemy struct {\n\tboard.Board\n\tcolor.Color\n\tfirst [8][8]bool\n}\n\nfunc NewEnemy(b board.Board, c color.Color, first [8][8]bool) *Enemy {\n\tenemy := new(Enemy)\n\tenemy.Board =... | go | edit | 0 | 3 | mit | 2867515fac88917f8987e0c14e23ac6b68bc6821 | Roadagain/Chess | src/enemy/enemy.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage missinggo\n\nimport \"reflect\"\n\nfunc Max(_less interface{}, vals ...interface{}) interface{} {\n\tret := reflect.ValueOf(vals[0])\n\tless := reflect.ValueOf(_less)\n\tfor _, _v := range vals[1:] {\n\t\tv := reflect.ValueOf(_v)\n\t\to... | go | edit | 0 | 3 | mit | 11126a81a179dd0d40b081da8cd02d696cdc6c92 | anacrolix/missinggo | minmax.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"bytes\"\n)\n\n// Stack is a stack of matrices\ntype Stack struct {\n\tstack []*Matrix\n}\n\n// NewStack returns a new stack\nfunc NewStack() *Stack {\n\treturn &Stack{\n\t\tstack: make([]*Matrix, 0, 100),\n\t}\n}\n... | go | edit | 9 | 2 | mit | 9a812ba6d411ef10b32c14d83b852be9c1688f34 | james9909/graphics-engine,james9909/graphics-engine | stack.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage mp4parser\n\nimport \"time\"\nimport \"fmt\"\n\n//MediaInfo contain media information\ntype MediaInfo struct {\n\twidth float64 //\n\theight float64 //found in tkhd\n\tsoundSamplingRate uint32\n\n\tcreationTime *t... | go | edit | 0 | 1 | mit | 2e30cacd1a2753cce932e13bb5bcf93bb12d753a | Joe-xu/mp4parser | mediaInfo.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage services\n\nimport (\n\t\"os\"\n\t\"fmt\"\n\t\"net/http\"\n\t\"encoding/json\"\n\t\"github.com/jmoiron/jsonq\"\n\t\"strconv\"\n)\n\nconst (\n\tslackUserListURL = \"https://slack.com/api/users.list\"\n)\n\nfunc SlackUserList() (map[strin... | go | edit | 0 | 4 | mit | 533a3487dcecc0c2df2dfd1bf0310bebc1286ef5 | wantedly/developers-account-mapper | services/slack_api.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage goalfred\n\nimport (\n\t\"io/ioutil\"\n\t\"os/exec\"\n)\n\n// Normalize fixes problems with string encoding regarding the usage of special characters in Alfred.\n// For more info on this topic, please refer to this thread: http://www.al... | go | edit | 15 | 1 | mit | 8a2e90d05214d4919761b35992975f881aca2bdf | BenchR267/goalfred,BenchR267/goalfred | normalize.go | rejected_lint | Too many lint violations: 15 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage terraform_test\n\nimport (\n\t\"bytes\"\n\n\t\"github.com/cloudfoundry/bosh-bootloader/terraform\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"Cmd\", func() {\n\tvar (\n\t\tstdout *bytes.Bu... | go | edit | 24 | 1 | apache-2.0 | 95d229239005f5523ca5f03bea21a0099312b026 | niroyb/bosh-bootloader,niroyb/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader,pivotal-cf-experimental/bosh-bootloader | terraform/cmd_test.go | rejected_lint | Too many lint violations: 24 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage engine\n\nimport \"fmt\"\n\ntype Dot struct {\n\tX uint8\n\tY uint8\n}\n\n// Equals compares two dots\nfunc (d1 Dot) Equals(d2 Dot) bool {\n\treturn d1 == d2 || (d1.X == d2.X && d1.Y == d2.Y)\n}\n\n// Implementing json.Marshaler interfa... | go | edit | 0 | 4 | bsd-2-clause | 5e3d457f28f7d1ecbc60cdb60ff0d1b0b3f89493 | ivan1993spb/clever-snake | engine/dot.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2015, Peter Mrekaj. All rights reserved.\n// Use of this source code is governed by a MIT-style\n// license that can be found in the LICENSE.txt file.\n\npackage graphs\n\n// FindCelebrity returns an index into 2D slice f that ... | go | edit | 0 | 5 | mit | 736804a1326e0e2316c6b103824c61d88d137655 | mrekucci/epi,mrekucci/epi | graphs/celebrity.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage web\n\nimport (\n\t\"html/template\"\n\t\"net/http\"\n\n\t\"code.cloudfoundry.org/lager\"\n)\n\ntype templateData struct{}\n\ntype handler struct {\n\tlogger lager.Logger\n\ttemplate *template.Template\n}\n\nfunc NewHandler(logger lag... | go | edit | 6 | 3 | apache-2.0 | 0e7b07fc83f74da826bb29c5dc5442e2b4f8b8a0 | concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse,concourse/concourse | handler.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gobot\n\ntype commander struct {\n\tcommands map[string]func(map[string]interface{}) interface{}\n}\n\n// Commander is the interface which describes the behaviour for a Driver or Adaptor\n// which exposes API commands.\ntype Commander i... | go | edit | 0 | 1 | apache-2.0 | 801b1096548375642daa15fb221d6cdc9f5b5239 | nzmichaelh/gobot,nzmichaelh/gobot | commander.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage operation\n\ntype Manifest struct {\n\tApplications []AppManifest `yaml:\"applications\"`\n}\n\ntype AppManifest struct {\n\tName string `yaml:\"name\"`\n\tBuildpacks []string `yam... | go | edit | 0 | 0 | mit | 4f5e64d79213ab2fe417915d8be361bcca3f8bc5 | cloudfoundry-community/go-cfclient | operation/manifest.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage binaryutils\n\nimport (\n\t\"encoding/binary\"\n\t\"io/ioutil\"\n)\n\nfunc BE32(data []byte, index int) int {\n\treturn int(binary.BigEndian.Uint32(data[index : index+4]))\n}\n\nfunc LE32(data []byte, index int) int {\n\treturn int(bina... | go | edit | 0 | 2 | apache-2.0 | adc9f58df221cdfb8aae7a3f5af3c3a878d76dba | ktzar/scummatlas,ktzar/scummatlas,ktzar/scummatlas,ktzar/scummatlas | src/scummatlas/binaryutils/util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage webrtc\n\n// RTCIceTransport allows an application access to information about the ICE\n// transport over which packets are sent and received.\ntype RTCIceTransport struct {\n}\n\n```\n\nApply this change: Add RTCIceTransport commented ... | go | edit | 0 | 0 | mit | 57baa20575aefd6bae043b325d1d4134d3df07e1 | pion/webrtc,pion/webrtc,pion/webrtc,pion/webrtc | rtcicetransport.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage shared\n\ntype ServerStateEnvironment struct {\n\tAddresses []string `json:\"addresses\"`\n\tArchitectures []string `json:\"architectures\"`\n\tCertificate string `json:\"certificate\"`\n\tCertificateF... | go | edit | 0 | 1 | apache-2.0 | 0d172e3080f768fd419f0c97f5246983797db243 | ollie314/lxd,Skarlso/lxd,stgraber/lxd,lxc/lxd,stgraber/lxd,lxc/lxd,chrisglass/lxd,stgraber/lxd,stgraber/lxd,jsavikko/lxd,techtonik/lxd,georghopp/lxd,erikmack/lxd,hallyn/lxd,hallyn/lxd,lxc/lxd,atxwebs/lxd,chrisglass/lxd,lxc/lxd,pcdummy/lxd,akshaykarle/lxd,jsavikko/lxd,Skarlso/lxd,mjeanson/lxd,atxwebs/lxd,pcdummy/lxd,lxc... | shared/server.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage httphandlers\n\nimport (\n\t\"github.com/gin-gonic/gin\"\n\t\"github.com/pufferpanel/pufferd/logging\"\n)\n\nfunc Recovery() gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\tdefer func() {\n\t\t\tif err := recover(); err != nil {... | go | edit | 0 | 2 | apache-2.0 | 32d3e4397ecb9fb3cb8bf87ab9b07f7a551f5447 | PufferPanel/pufferd | httphandlers/errorlogging.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"html/template\"\n\t\"log\"\n\t\"os\"\n\t\"time\"\n)\n\n// Must method parses the template to ensure no errors;\n// New method creates and returns a new template\nvar report = template.Must(template.New(\"issuelist\... | go | edit | 6 | 3 | mit | 9a2175724af01291a82fdc2b9a790873036342dd | mlampedx/exercises-go | github/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\"bsearch/index\"\n\t\"bsearch/ops\"\n\t\"fmt\"\n\t\"os\"\n\t\"flag\"\n)\n\nfunc usage() {\n\tfmt.Fprintf(os.Stderr, \"usage: bsearch <path to index blob>\\n\")\n\tflag.PrintDefaults()\n\tos.Exit(1)\n}\n\nfunc main()... | go | edit | 0 | 5 | isc | fee5fd857d523feecb657dcf93153708fac48ea6 | art4711/bsearch | main/bsearch.go | rejected_duplicate | Near-duplicate of sample 119319 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage templates\n\nfunc ScopeTemplateContent() string {\n\treturn `#cloud-config\n\n{{ .Name}}:\n {{ range .Services }}{{ .GetName }}:\n {{ range $key, $value := .GetParameters }}{{ $key }}: {{ $value }}\n {{ end }}\n {{ end }}units:\... | go | edit | 0 | 1 | apache-2.0 | 3865a8069ea3feb520dd23550b0fa19d04a6f26b | bernardolins/clustereasy,bernardolins/clustereasy | templates/content.go | rejected_duplicate | Near-duplicate of sample 116954 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/davecheney/gpio\"\n\t\"os\"\n\t\"os/signal\"\n\t\"time\"\n)\n\nfunc main() {\n\t// set GPIO25 to output mode\n\tpin, err := gpio.OpenPin(25)\n\tif err != nil {\n\t\tfmt.Printf(\"Error opening ... | go | edit | 0 | 3 | bsd-2-clause | cb5e3affcc4d7991a6f9c9fdbb8487cbd9d2a87b | davecheney/gpio,griffina/gpio,alext/gpio | examples/blink/blink.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/bluele/slack\"\n)\n\n// Please change these values to suit your environment\nconst (\n\ttoken = \"your-api-token\"\n\tchannelName = \"general\"\n)\n\nfunc main() {\n\tapi := slack.New(to... | go | edit | 0 | 4 | mit | c0b4ff5e384f2a5df721bac01f388810e3e0d30e | bluele/slack | examples/channels_history.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage apps\n\nimport (\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n\t. \"github.com/vito/cmdtest/matchers\"\n\n\t. \"github.com/pivotal-cf-experimental/cf-acceptance-tests/helpers\"\n)\n\nvar _ = Describe(\"An application... | go | edit | 27 | 1 | apache-2.0 | 19ab1e9984763ad5590837c5dcd1f68a83ab89db | matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests,matt-royal/cf-acceptance-tests | apps/staging_log_test.go | rejected_lint | Too many lint violations: 27 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build darwin linux\n\npackage main\n\nimport (\n\t\"log\"\n\t\"strconv\"\n\t\"syscall\"\n)\n\nvar realUid int\n\nfunc init() {\n\tsudoUid, ok := syscall.Getenv(\"SUDO_UID\")\n\tif ok {\n\t\tvar err error\n\t\trealUid, err = strconv.Atoi(sud... | go | edit | 9 | 3 | mit | fe7f7447725d7d454d8f632e2947de6d606a6a43 | calmh/mole,reth-/mole,calmh/mole,reth-/mole | cmd/mole/root_unix.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage types\n\nconst (\n\tZigbeeCertificationType string = \"zigbee\"\n\tMatterCertificationType string = \"matter\"\n\tFullCertificationType string = \"Full\"\n\tCbSCertificationType string = \"CbS\" // CbS - Certification by Similarity... | go | edit | 0 | 3 | apache-2.0 | 466fd1c9b2bd34350b3372fc136c872e6b023913 | zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger,zigbee-alliance/distributed-compliance-ledger | x/compliance/types/types.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage collector\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"net/http\"\n)\n\nfunc HttpGet(endpoint string) (body []byte, err error) {\n\tresponse, err := http.Get(endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif res... | go | edit | 0 | 5 | apache-2.0 | 146912ae9c43da6eea390fc58e6777757fd9746b | dcos/dcos-metrics,dcos/dcos-metrics,dcos/dcos-metrics,dcos/dcos-metrics,dcos/dcos-metrics | collector/http_util.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage libcontainer\n\ntype Factory interface {\n\t// Creates a new container in the given path. A unique ID is generated for the container and\n\t// starts the initial process inside the container.\n\t//\n\t// Returns the new container with a... | go | edit | 6 | 0 | apache-2.0 | 24e7b86a87e618202a2983c716f43dd9e9eeb552 | estesp/runc,ddnbgroup/runc,subuser-security/runc,mrunalp/libcontainer,avagin/libcontainer,BrickXu/libcontainer,thaJeztah/libcontainer,justincormack/runc,boucher/libcontainer,chenchun/runc,hqhq/runc,ZJU-SEL/runc,wking/runc,mrunalp/runc,ZJU-SEL/libcontainer,rsampaio/runc,mikebrow/runc,dieface/runc,balajibr/runc,jhowardms... | factory.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/Symantec/Dominator/imagepublishers/amipublisher\"\n\tlibjson \"github.com/Symantec/Dominator/lib/json\"\n\t\"log\"\n\t\"os\"\n)\n\nfunc listUnpackersSubcommand(args []string, logger *log.Logge... | go | edit | 6 | 2 | apache-2.0 | f0db57cd1da3685c26ed3e307e210af611ab5729 | Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator | cmd/ami-publisher/listUnpackers.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"html\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\tgo http.ListenAndServe(\":8282\", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tfmt.Fprintf(w, \"Hello, %s... | go | edit | 3 | 3 | mit | 734c1e9c3f485356501f8ea561b7b79adae3e6f5 | fmi/go-lectures,fmi/go-lectures,fmi/go-lectures,fmi/go-lectures | code/course-info/hello_http.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Package elicit is a native go BDD testing framework using markdown for executable specifications\npackage elicit\n\nimport (\n\t\"flag\"\n\t\"regexp\"\n)\n\nvar (\n\treportFile = flag.String(\"elicit.report\", \"\", \"Path to save an executi... | go | edit | 9 | 3 | bsd-2-clause | e61acf6b42bf9ef446e6f9abd03c8b16030de1ae | mpwalkerdine/elicit | elicit.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage cryptopals\n\nimport (\n\t\"encoding/base64\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"testing\"\n)\n\nfunc TestDecryptRsaParityOracle(t *testing.T) {\n\tpriv := generateRsaPrivateKey(1024)\n\tpub := priv.public()\n\n\tfmt.Printf(\"n: %v\\n\\n\"... | go | edit | 9 | 1 | mit | 4a4d3e1ecdf1263d0b758076d07f883bb73c0bd9 | Metalnem/cryptopals-go,Metalnem/cryptopals-go,Metalnem/cryptopals-go | challenge46_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage imagestore\n\nimport (\n\t\"errors\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"strings\"\n)\n\ntype InMemoryImageStore struct {\n\tfiles map[string]string // name -> contents\n}\n\nfunc NewInMemoryImageStore() *InMemoryImageStore {\n\treturn &InM... | go | edit | 0 | 2 | mit | 47ae5d63b6f4c3e548d41cccabed2c619aae195a | Klaasvaak/mandible,briankassouf/mandible,henrylee2cn/mandible,Imgur/mandible,josephyzhou/mandible,briankassouf/mandible,Imgur/mandible,josephyzhou/mandible,henrylee2cn/mandible,Klaasvaak/mandible | imagestore/memorystore.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\nCopyright 2014 GoPivotal (UK) Limited.\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\nhttp://www.apache.org/... | go | edit | 9 | 2 | apache-2.0 | 83d4843f1a004f96a6011e77a9c53244ef9d10c7 | cf-guardian/guardian,cf-guardian/guardian | gerror/examples_test.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage dockercommand\n\nimport (\n\tdocker \"github.com/fsouza/go-dockerclient\"\n\t\"os\"\n)\n\ntype Docker struct {\n\tclient *docker.Client\n}\n\nfunc NewDocker(endpoint string) (*Docker, error) {\n\tendpoint = resolveDockerEndpoint(endpoin... | go | edit | 0 | 5 | mit | 02adfa95cc7ea83b13b135a67877b8669fb4ae0d | bywan/go-dockercommand | docker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage hdf5\n\n// #include \"hdf5.h\"\n//\n// herr_t _go_hdf5_unsilence_errors(void) {\n// return H5Eset_auto2(H5E_DEFAULT, (H5E_auto2_t)(H5Eprint), stderr);\n// }\n//\n// herr_t _go_hdf5_silence_errors(void) {\n// return H5Eset_auto2(H5E_... | go | edit | 9 | 3 | bsd-3-clause | a9748f2657b41b03a4209baa8a04e07ba1c023b8 | disktnk/go-hdf5,sbinet/go-hdf5 | errors.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright (c) 2014, Rob Thornton\n// All rights reserved.\n// This source code is governed by a Simplied BSD-License. Please see the\n// LICENSE included in this distribution for a copy of the full license\n// or, if one is not included, you... | go | edit | 0 | 4 | bsd-2-clause | 27bc0818b7cea9ad1d585d4be89832bc85a14c3e | rthornton128/calc | comp/comp_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"bufio\"\n\t\n\t\"image\"\n\t\"image/png\"\n\t\"draw2d\"\n)\n\nfunc saveToPngFile(filePath string, m image.Image) {\n\tf, err := os.Open(filePath, os.O_CREAT|os.O_WRONLY, 0600)\n\ti... | go | edit | 8 | 4 | bsd-2-clause | 4eaa1d6e1d082f89729f8447c4e5007b5d75fe65 | magj2006/draw2d,dddaisuke/draw2d,stephenwithav/draw2d,bigunagi/draw2d,dddaisuke/draw2d,zqc115322536/draw2d,iand/draw2d.newdraw2d,lain-dono/draw2d,xushiwei/draw2d,iand/draw2d,google-feinberg/feinberg-draw2d,bigunagi/draw2d,magj2006/draw2d.newdraw2d,google-feinberg/feinberg-draw2d,zqc115322536/draw2d.newdraw2d,stanim/dra... | draw2d/src/cmd/gettingStarted.go | rejected_lint | Too many lint violations: 8 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage wsmaterials\n\nimport (\n\t\"fmt\"\n\t\"github.com/emicklei/go-restful\"\n\t\"net/http\"\n)\n\ntype JsonpResponseWriter struct {\n\twriter http.ResponseWriter\n\tcallback string\n}\n\nfunc (j *JsonpResponseWriter) Header() http.Header... | go | edit | 0 | 2 | mit | 98e5cb3182490c8947c41fb7a50fb9d850f05474 | materials-commons/materials,materials-commons/materials | wsmaterials/jsonp.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// GCloud - Go Packages for Cloud Services.\n// Copyright (c) 2013 Garrett Woodworth (https://github.com/gwoo).\n\npackage identity\n\nimport ()\n\ntype Account struct{}\n\n```\n\nApply this change: Add some fields to Account."
},
{
"ro... | go | edit | 0 | 0 | bsd-3-clause | 824911e61202060dfa41f012546faf0601776c4c | gcloud/identity | account.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport(\n \"fmt\"\n \"os\"\n \"io/ioutil\"\n \"path/filepath\"\n)\n\nconst(\n LUNCHY_VERSION = \"0.1.0\"\n)\n\nfunc printUsage() {\n fmt.Printf(\"Lunchy %s, the friendly launchctl wrapper\\n\", LUNCHY_VERSION)\n fmt.Print... | go | edit | 0 | 4 | mit | ac78c8d8ca36008e9a8afbd4775eb450dcdb8b2b | sosedoff/lunchy-go,sosedoff/lunchy-go | lunchy.go | rejected_duplicate | Near-duplicate of sample 118580 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Copyright (C) 2019 IBM, Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy ofthe License at\n *\n * http://www... | go | edit | 0 | 1 | apache-2.0 | 5ff5f73465198312ab8f490a4a1dcbff125d351e | lebauce/skydive,lebauce/skydive,skydive-project/skydive,skydive-project/skydive,lebauce/skydive,lebauce/skydive,lebauce/skydive,skydive-project/skydive,skydive-project/skydive,skydive-project/skydive,skydive-project/skydive,lebauce/skydive,lebauce/skydive,skydive-project/skydive,lebauce/skydive | contrib/exporters/allinone/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage handler\n\nimport (\n\t\"encoding/json\"\n\t\"net/http\"\n\n\t\"github.com/yuuki/dynamond/log\"\n)\n\nfunc JSON(w http.ResponseWriter, status int, v interface{}) error {\n\tres, err := json.Marshal(v)\n\tif err != nil {\n\t\treturn err\... | go | edit | 0 | 2 | apache-2.0 | 6e8965f3d3bc78e86d747ec57b40702c684111f8 | yuuki/diamondb,yuuki/diamondb | handler/response.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage websocket\n\nimport (\n\t\"net/http\"\n\n\t\"github.com/gorilla/websocket\"\n\t\"github.com/spring1843/chat-server/src/chat\"\n\t\"github.com/spring1843/chat-server/src/shared/logs\"\n)\n\nvar (\n\tchatServerInstance *chat.Server\n\tupg... | go | edit | 3 | 2 | mit | 9fca5f3f39cabb2bb2e5a53fd273e2e45c3b00a2 | spring1843/chat-server | src/drivers/websocket/websocket.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\tMEL app backend\n\n\tAuthor:\t\tAlastair Hughes\n\tContact:\t<hobbitalastair at yandex dot com>\n*/\n\npackage main\n\nimport (\n\t\"net/http\"\n\t\"fmt\"\n\t\"html\"\n)\n\n// Handle a single HTTP request.\nfunc MELHandler(writer http.Respo... | go | edit | 3 | 4 | mit | 82cdf2486557310ad85a95647cf5a8b94d16de40 | mel-app/backend | backend.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nconst daemonBinary = \"dockerd\"\n\n// DaemonProxy acts as a cli.Handler to proxy calls to the daemon binary\ntype DaemonProxy struct{}\n\n// NewDaemonProxy returns a new handler\nfunc NewDaemonProxy() DaemonProxy {\n\treturn Da... | go | edit | 3 | 1 | apache-2.0 | eb35552fb363ccc70c0473a29e40161ead848e37 | ashfall/cli,gdevillele/cli,cpuguy83/cli,dnephin/cli,cpuguy83/cli,riyazdf/cli,redpanda/cli,thaJeztah/cli,allencloud/cli,Zebrilee/cli,thaJeztah/cli,docker/cli,allencloud/cli,redpanda/cli,ashfall/cli,dnephin/cli,Zebrilee/cli,e11137/cli,riyazdf/cli,e11137/cli,docker/cli | daemon.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"os\"\n\t\"fmt\"\n\t\"github.com/timakin/ts/loader\"\n\t\"github.com/codegangsta/cli\"\n)\n\nvar Commands = []cli.Command{\n\tcommandAll,\n\tcommandBiz,\n\tcommandHack,\n}\n\nvar commandAll = cli.Command{... | go | edit | 0 | 2 | mit | 184afbb9d4f2505218f5094575a5d40a706857d2 | timakin/ts,timakin/ts | commands.go | rejected_duplicate | Near-duplicate of sample 119557 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage sphere\n\nimport (\n\t\"bytes\"\n\t\"encoding/gob\"\n\t\"encoding/json\"\n\t\"errors\"\n)\n\n// Packet indicates the data of the message\ntype Packet struct {\n\tSuccess bool `json:\"success\"`\n\tType PacketType `json:\"type\"... | go | edit | 9 | 2 | mit | 572b1f31acd143eef188936cc2efba7ec433af6f | samuelngs/go-sphere | packet.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\"errors\"\n\t\"fmt\"\n)\n\ntype ErrMalformedDB struct {\n\tBucket string\n}\n\nfunc (e ErrMalformedDB) Error() string {\n\treturn fmt.Sprintf(\"malformed database no %s bucket\", e.Bucket)\n}\n\ntype ErrNoService st... | go | edit | 0 | 1 | mit | 49437f7515d62783e390757d1afb9ef96308249e | zan-xhipe/rest | errors.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2009 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage signal\n\nimport (\n\t\"syscall\"\n\t\"testing\"\n)\n\nfunc TestSignal(t... | go | edit | 6 | 2 | bsd-3-clause | 08e8f3bd51f8e816de5902069f80704ece1957f4 | abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go,abustany/go | src/pkg/os/signal/signal_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage gitmediafilters\n\nimport (\n\t\"..\"\n\t\"../client\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc Smudge(writer io.Writer, sha string) error { // stdout, sha\n\tmediafile := gitmedia.LocalMediaPath(sha)\n\treader, err := gitmediaclient.Get(mediafil... | go | edit | 6 | 8 | mit | e219224a98297212369e5576f5b203f498a8ea13 | ModernTechnologyPlayers01/git-lfs,dakotahawkins/git-lfs,ssgelm/git-lfs,iSC-Labs/git-lfs,ttaylorr/git-lfs,ModernTechnologyPlayers01/git-lfs,yonglehou/git-lfs,billygor/git-lfs,ssgelm/git-lfs,iSC-Labs/git-lfs,bozaro/git-lfs,beni55/git-lfs,billygor/git-lfs,ChaseFlorell/git-lfs,ryansimmen/git-lfs,WillHipschman/git-lfs,y12uc... | filters/smudge.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2020 the u-root 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 plan9\n\npackage rand\n\nimport (\n\t\"context\"\n\t\"crypto/rand\"... | go | edit | 0 | 3 | bsd-3-clause | efa3f7929d27a919286246551cb146506e734d13 | u-root/u-root,u-root/u-root,u-root/u-root | pkg/rand/random_std.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"./specify\"\n\nfunc init() {\n\tspecify.Behavior(\"Math\", func(it *specify.It) {\n\n\t\tit.Should(\"add integers\", func(expect *specify.Expect) {\n\n\t\t\texpect.That(1 + 2).Should.Be(4);\n\t\t\texpect.That(\"foo\").S... | go | edit | 0 | 1 | mit | 000813bb49d859b69cff62b16ac1ec7c7fb1ad59 | stesla/gospecify,stesla/gospecify | src/math_spec.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage metrics\n\nimport (\n\t\"testing\"\n\t\"time\"\n)\n\nfunc Test_RegisterServer(t *testing.T) {\n\n\tmetricsPort := 31111\n\n\tmetricsServer := MetricsServer{}\n\tmetricsServer.Register(metricsPort)\n\n\tcancel := make(chan bool)\n\tgo me... | go | edit | 3 | 5 | mit | fa93655d90d1518b04e7cfca7d7548d7d133a34e | alexellis/faas,rgee0/faas,rgee0/faas,alexellis/faas,rgee0/faas,alexellis/faas,rgee0/faas,alexellis/faas,rgee0/faas,alexellis/faas,openfaas/faas,rgee0/faas,rgee0/faas,openfaas/faas,alexellis/faas,alexellis/faas,rgee0/faas,rgee0/faas,alexellis/faas,alexellis/faas,rgee0/faas,openfaas/faas | watchdog/metrics/metrics_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage raft\n\nimport (\n\t\"bytes\"\n\t\"encoding/json\"\n\t\"testing\"\n)\n\nfunc BenchmarkAppendEntriesEncoding(b *testing.B) {\n\treq, _ := createTestAppendEntriesRequest(2000)\n for i := 0; i < b.N; i++ {\n\t\tvar buf bytes.Buffer\n ... | go | edit | 0 | 2 | mit | 628b86fe1df445f9b0544a980123365ff96db68a | nckturner/influxdb,marcosnils/influxdb,nckturner/influxdb,gdi2290/influxdb,samaitra/influxdb,jgeiger/influxdb,jipperinbham/influxdb,ninjasphere/influxdb,sudabon/influxdb,evanphx/influxdb,lgpeterson/influxdb,trigrass2/influxdb,Ancillas/influxdb,roobert/influxdb,linfangrong/influxdb,toorop/influxdb,mengjinglei/influxdb,m... | append_entries_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build windows\n\npackage config\n\nimport (\n\t\"os\"\n\t\"path/filepath\"\n)\n\nfunc defaultDirectory() string {\n\tbase := filepath.Base(os.Args[0])\n\text := filepath.Ext(base)\n\n\tdrv := os.Getenv(\"SystemDrive\")\n\tpdDir := \"Program... | go | edit | 0 | 1 | mit | fa834b3d2a342c0c2f7656f2a3191ed654f9bdb6 | codemodus/config | defdir_windows.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\"github.com/keybase/client/go/libkb\"\n\tbserver \"github.com/keybase/kbfs/bserver\"\n\t\"log\"\n\t\"math/rand\"\n\t\"testing\"\n\t\"time\"\n)\n\nvar (\n\tBServerRemote = flag.Bool(\"kbfs.bser... | go | edit | 0 | 2 | bsd-3-clause | d78491a4910526b59c42689781b4926f433cadb0 | keybase/kbfs,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/kbfs,keybase/client,keybase/client,keybase/kbfs,keybase/client,keybase/client,keybase/client,keybase/client,keybase/client,keybase/kbfs | kbfsfuse/test_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n/*\n * Copyright (c) 2014 ZionSoft. All rights reserved.\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file.\n */\n\npackage translation\n\nimport (\n \"net/http\"\n \"net/url\"\n\n ... | go | edit | 3 | 5 | bsd-3-clause | fca4ae33df3fb5eb3314f86b284711018bcdcc2f | ZionSoft/Bible-Server,ZionSoft/Bible-Server | src/translation/downloadhandler.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"os\"\n\t\"os/exec\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tuid := strconv.Itoa(os.Getuid())\n\n\tcmdargs := append([]string{\"run\", \"-u\", uid, \"--rm\", \"-i\"}, os.Args[1:]...)\n\tcmd := exec.Command(\"docker\",... | go | edit | 0 | 1 | apache-2.0 | 439cd689dff5fc041b0f8a451eda6916dbac4072 | ewindisch/udocker | udocker.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"github.com/jmcvetta/neoism\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"testing\"\n)\n\nfunc TestCreate(t *testing.T) {\n\tassert := assert.New(t)\n\tperson := person{UUID: \"123\", Name: \"Test\", Identifiers:... | go | edit | 12 | 1 | mit | 28223969d81015cd2ad11e54c3d65868999b97c8 | Financial-Times/people-rw-neo4j | people_cypher_test.go | rejected_lint | Too many lint violations: 12 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage state_machine\n\nimport \"strings\"\n\ntype State struct {\n\tState string\n\tStateChangeLogs []StateChangeLog\n}\n\nfunc (state *State) SetState(name string) {\n\tstate.State = name\n}\n\nfunc (state *State) GetState() string... | go | edit | 3 | 1 | mit | 44242d5740b531e5f8e914d7b5320c1432cd7d3d | strogo/qor,yanzay/qor,gavinzhs/qor,shaunstanislaus/qor,strogo/qor,lance2088/qor,qor/qor,trigrass2/qor,shidao-fm/qor,jmptrader/qor,codevlabs/qor,codedogfish/qor,qor/qor,trigrass2/qor,insionng/qor,gavinzhs/qor,amirrpp/qor,youprofit/qor,insionng/qor,amirrpp/qor,youprofit/qor,shidao-fm/qor,yanzay/qor,codedogfish/qor,jmptra... | state_machine/state.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rfc3797\n\nimport (\n\t\"math\"\n)\n\nfunc main() {\n\n}\n\nfunc Entropy(n int, p int) int {\n\ti := 0\n\tresult := 0.0\n\n\t// These cases represent invalid input values.\n\tif (n < 1) || (n >= p) {\n\t\treturn 0.0\n\t}\n\n\tfor i = p;... | go | edit | 0 | 5 | isc | b5429f99a49631390261994a5ca8283b548d0564 | kyleroot/go-sortition | rfc3797.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage commands\n\nimport (\n\t\"testing\"\n)\n\nfunc TestHelloworld(t *testing.T) {\n\twant := \"Hello world!\"\n\tgot := \"Hello world!\"\n\n\tif got != want {\n\t\tt.Errorf(\"Expected '%v' got '%v'\", want, got)\n\t}\n}\n\n```\n\nApply this... | go | edit | 3 | 2 | mit | bddf1a99a2f09e30e9e7bc082e4bf0594b6dd069 | nloadholtes/go-bot,go-chat-bot/bot,pyinx/bot,go-chat-bot/bot,martinusso/plugins,nloadholtes/go-bot,go-chat-bot/plugins,fabioxgn/go-bot,fabioxgn/go-bot,pyinx/bot,go-chat-bot/plugins-br,martinusso/bot | commands/helloworld_command_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage integration_test\n\nimport (\n\t\"path/filepath\"\n\n\t\"github.com/cloudfoundry/libbuildpack/cutlass\"\n\n\t. \"github.com/onsi/ginkgo\"\n\t. \"github.com/onsi/gomega\"\n)\n\nvar _ = Describe(\"pushing an app a second time\", func() {\... | go | edit | 39 | 1 | apache-2.0 | 6631db9b4532973843688d419acddea0eec51942 | cloudfoundry-community/asp.net5-buildpack | src/dotnetcore/integration/push_app_second_time_test.go | rejected_lint | Too many lint violations: 39 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net/http\"\n\n\t\"github.com/google/go-github/github\"\n)\n\nfunc fetchLicenseList() ([]github.License, error) {\n\t// Create default client\n\tclient := github.NewClient(nil)\n\n\t// Fetch list of LICEN... | go | edit | 6 | 3 | mit | 4273e30e47896655080ffb57b4585adf3af69eb7 | tcnksm/license,tcnksm/license | github.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage webapp\n\nimport (\n\t\"github.com/gorilla/mux\"\n\t\"net/http\"\n)\n\ntype WebApp struct {\n\t*mux.Router\n\thandler http.Handler\n}\n\ntype routeAgent interface {\n\tBindRoute(app *WebApp)\n}\n\nfunc NewWebApp() *WebApp {\n\tapp := &W... | go | edit | 0 | 1 | mit | a0d849d3a5a1334fb18d24e0c8888f259bbce669 | tsinghua-io/api-server | webapp/webapp.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage coinbase\n\ntype Message struct {\n Type string `json:\"type\"`\n TradeId int `json:\"trade_id,number\"`\n OrderId string `json:\"order_id\"`\n Sequence int `json:\"sequence,number\"`\n MakerOrderId string `json:\"maker_order_id\"`... | go | edit | 3 | 0 | mit | 5c3ed5d14c129b7cf0370081e0d73203341c11a1 | preichenberger/go-coinbase-exchange | message.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage rel\n\n// A Pair consisting of an element and its real value.\ntype Pair struct {\n\tElement interface{}\n\tValue float64\n}\n\n// MakePair evaluates the input function f at the input x and returns\n// the associated (element, mass) p... | go | edit | 0 | 1 | mit | ee8f3f8991405d6fda391e883d4df5340cfb264a | shawnohare/go-rel | pair.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n)\n\nfunc main() {\n\n\thttp.HandleFunc(\"/version\", func(w http.ResponseWriter, r *http.Request) {\n\t\tio.WriteString(w, \"gatekeeper v0\")\n\t})\n\n\tlog.Fatal(http.ListenAndSer... | go | edit | 3 | 4 | apache-2.0 | 3c9f390b2a7ca2afe293fde604a8cd821687e99b | c00w/skeleton,c00w/skeleton,c00w/skeleton | src/gatekeeper/main.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage verstr\n\nimport (\n\t\"testing\"\n)\n\nfunc TestLess(t *testing.T) {\n\tvar tests = []struct {\n\t\tleft, right string\n\t\twant bool\n\t}{\n\t\t{\"file.1.ext\", \"file.10.ext\", true},\n\t\t{\"file.10.ext\", \"file.1.ext\", fal... | go | edit | 3 | 3 | apache-2.0 | 56ab6a330a050dc12ef42888fb02386e2d378b43 | rgooch/Dominator,keep94/Dominator,keep94/Dominator,keep94/Dominator,Symantec/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator | lib/verstr/less_test.go | rejected_duplicate | Near-duplicate of sample 117822 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage controllers\n\nimport (\n \"net\"\n \"github.com/ohrite/gopher\"\n . \"github.com/ohrite/gopherchan/models\"\n)\n\ntype PostCreateController struct {\n Host string\n Port string\n}\n\nfunc NewPostCreateController(host string, port ... | go | edit | 9 | 1 | mit | 356ce08f4fdb669e7e942abf81a62f0ee87deda2 | ohrite/gopherchan | controllers/post_create_controller.go | rejected_lint | Too many lint violations: 9 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clc\n\nimport (\n\t\"github.com/CenturyLinkCloud/clc-sdk/aa\"\n\t\"github.com/CenturyLinkCloud/clc-sdk/alert\"\n\t\"github.com/CenturyLinkCloud/clc-sdk/api\"\n\t\"github.com/CenturyLinkCloud/clc-sdk/dc\"\n\t\"github.com/CenturyLinkCloud... | go | edit | 0 | 1 | apache-2.0 | 6cc7365d2ec992f24519ec51445495d5d95888cc | mikebeyer/clc-sdk,mikebeyer/clc-sdk,CenturyLinkCloud/clc-sdk,ack/clc-sdk,ack/clc-sdk,CenturyLinkCloud/clc-sdk | client.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"os\"\nimport \"fmt\"\nimport \"net\"\nimport \"bufio\"\n\nfunc main() {\n\tconn, err := net.Dial(\"tcp\", \"127.0.0.1:1350\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t\tos.Exit(1)\n\t}\n\tfor {\n\t\tdata, err := bufi... | go | edit | 0 | 6 | mit | fd8f334f2670cd4c500cad1471ef2df73327cea7 | UniversityRadioYork/bifrost,UniversityRadioYork/bifrost,UniversityRadioYork/heimdallr,UniversityRadioYork/heimdallr,UniversityRadioYork/bifrost,UniversityRadioYork/heimdallr | ury-rapid-go.go | rejected_duplicate | Near-duplicate of sample 117450 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// +build freebsd darwin\n\npackage operatingsystem // import \"github.com/docker/docker/pkg/parsers/operatingsystem\"\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os/exec\"\n)\n\n// GetOperatingSystem gets the name of the current operating system... | go | edit | 0 | 2 | apache-2.0 | fa29ff22124b41e30360b83b93072fbab53d99b8 | Ramzec/docker,nawawi/docker,bearstech/moby,flavio/docker,Mokolea/docker,moby/moby,trebonian/docker,justincormack/docker,yosifkit/docker,vdemeester/docker,jvanz/docker,gnailuy/docker,jameszhan/docker,estesp/docker,SvenDowideit/docker,SvenDowideit/docker,paralin/docker,nawawi/docker,trebonian/docker,paralin/docker,mahak/... | pkg/parsers/operatingsystem/operatingsystem_unix.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage clique\n\nimport \"fmt\"\n\ntype BitVector uint64\n\nfunc (b *BitVector) Set(i int) {\n\tcheckBitIndex(i)\n\t*b |= (1 << uint(i))\n}\n\nfunc (b BitVector) Has(i int) bool {\n\tcheckBitIndex(i)\n\treturn b&(1<<uint(i)) != 0\n}\n\nfunc (b... | go | edit | 0 | 3 | mit | e0d13239b8f0aa9e11e2fe9ad0e70fdd01939be8 | peferron/algo,peferron/algo,peferron/algo,peferron/algo,peferron/algo,peferron/algo | clique/go/bit_vector.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage leetcode\n\nfunc searchMatrix(matrix [][]int, target int) bool {\n\tfor _, nums := range matrix {\n\t\tleft, right := 0, len(nums)-1\n\t\tfor left <= right {\n\t\t\tmid := (left + right) / 2\n\t\t\tif nums[mid] == target {\n\t\t\t\tretu... | go | edit | 0 | 8 | mit | 4eed07db53f99f7845589b282cc54466d7ccb110 | motomux/go-algo | leetcode/240_search_a_2d_matrix_ii.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage util\n\nimport (\n\t\"os/exec\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestRootNames(t *testing.T) {\n\t// NOTE: will fail if there are newlines in /*.\n\twant, err := exec.Command(\"ls\", \"/\").Output()\n\... | go | edit | 6 | 3 | bsd-2-clause | be3ca4d050d41ba9e24d9814ca4b77c2a006235a | elves/elvish,elves/elvish,elves/elvish,elves/elvish,elves/elvish | util/rootnames_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype lockerEXNB struct {\n}\n\nfunc newLockerEXNB() *lockerEXNB {\n\treturn new(lockerEXNB)\n}\n\nfunc (l *lockerEXNB) lock(file *os.File) error {\n\tmsg := \"setlock: fatal: win... | go | edit | 0 | 1 | mit | 42cb4ec74af075ef77eedf5fc7a3e7b8e31649e6 | mattn/go-setlock,moznion/go-setlock,moznion/go-setlock,mattn/go-setlock,maroekun/go-setlock,maroekun/go-setlock | locker_exnb_windows.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage reply\n\nimport (\n\t\"regexp\"\n\n\t\"github.com/tucnak/telebot\"\n\t\"github.com/asdine/storm\"\n\n\t\"github.com/focusshifter/muxgoob/registry\"\n)\n\ntype ReplyPlugin struct {\n}\n\nvar db *storm.DB\n\nfunc init() {\n\tregistry.Regi... | go | edit | 0 | 6 | mit | f7838042f1f316c5d48c843696d27b384b467d07 | focusshifter/muxgoob | plugins/reply/reply.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\n// Copyright 2014 Alea Soluciones SLL. All rights reserved. Use of this\n// source code is governed by a MIT-style license that can be found in the\n// LICENSE file.\n\npackage crontask\n\nimport (\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/gorh... | go | edit | 0 | 2 | mit | 587ee141548af5fe6f241ee13e759bd12da209b9 | aleasoluciones/goaleasoluciones | crontask/crontask.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage metrics\n\nimport (\n\t\"testing\"\n\n\t\"github.com/icecrime/octostats/fixtures\"\n\t\"github.com/icecrime/octostats/github\"\n)\n\nfunc TestCollectIssues(t *testing.T) {\n\tfixtures.Setup()\n\tfixtures.SetupMux(t, \"issues\")\n\tdefer... | go | edit | 3 | 2 | apache-2.0 | 7217b8951e619aa1a5fb5c3fce50392630e470ce | icecrime/octostats | metrics/metrics_test.go | accepted | null | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport \"encoding/json\"\nimport \"fmt\"\nimport \"io/ioutil\"\nimport \"net/http\"\n\nfunc GetInfo(url string) map[string]interface{} {\n\tresp, err := http.Get(url)\n\tCheck(err)\n\tdefer resp.Body.Close()\n\tbody, err := iout... | go | edit | 6 | 3 | mit | 6af9fabc9afe4e2f0e127130332e00d858ff394d | waits/ntwrk-cli | info.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage filter\n\nimport (\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/toomore/gogrs/tradingdays\"\n\t\"github.com/toomore/gogrs/twse\"\n)\n\nvar stock = twse.NewTWSE(\"2618\", tradingdays.FindRecentlyOpened(time.Now()))\n\nfunc TestCheckGroup... | go | edit | 6 | 3 | mit | c8fe8c5d2ddb56ce412cc49385605f2140131bde | toomore/gogrs,toomore/gogrs | cmd/twsereport/filter/filter_test.go | rejected_lint | Too many lint violations: 6 | true |
[
{
"role": "user",
"content": "Here is the current file:\n```go\npackage main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestRunRandom(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\targs []string\n\t\twantErr bool\n\t}{\n\t\t{\n\t\t\tname: \"success\",\n\t\t\targs: nil,\n\t\t\twantErr: f... | go | edit | 6 | 1 | mit | 499af57d5377c8eb31096424f900fbb309c6d2a1 | hackebrot/turtle | cmd/turtle/random_test.go | rejected_lint | Too many lint violations: 6 | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.