commit stringlengths 40 40 | old_file stringlengths 4 264 | new_file stringlengths 4 264 | old_contents stringlengths 0 4.24k | new_contents stringlengths 1 5.44k | subject stringlengths 14 778 | message stringlengths 15 9.92k | lang stringclasses 277
values | license stringclasses 13
values | repos stringlengths 5 127k |
|---|---|---|---|---|---|---|---|---|---|
2a014c0b295530dbe111d4568664fcd0b431e1be | server/extractable_unit.go | server/extractable_unit.go | package server
import (
"strings"
"github.com/bmorton/deployster/fleet"
)
type ExtractableUnit fleet.Unit
func (eu *ExtractableUnit) ExtractBaseName() string {
s := strings.Split(eu.Name, "-")
return s[0]
}
func (eu *ExtractableUnit) ExtractVersion() string {
s := strings.Split(eu.Name, "-")
end := strings.I... | package server
import (
"strings"
"github.com/bmorton/deployster/fleet"
)
// ExtractableUnit is the local struct for a fleet.Unit with added functions
// for extracting the name, version, and instance that deployster encodes into
// the Fleet unit name.
type ExtractableUnit fleet.Unit
// ExtractBaseName returns t... | Add documentation to ExtractableUnit in the server package. | Add documentation to ExtractableUnit in the server package.
| Go | mit | bmorton/deployster |
ca9d70d427b4281d71d24b30e6e9ca12082614fc | test/Only/doc.go | test/Only/doc.go | /*
Only (e.g. OnlyInt32) filters the value stream of an observable and lets
only the values of a specific type pass.
So in case of OnlyInt32 it will only let int32 values pass through.
*/
package Only
| /*
Only filters the value stream of an observable and lets only the
values of a specific type pass.
So in case of OnlyInt32 it will only let int32 values pass through.
*/
package Only
| Make Only operator appear correctly in pkg.go.dev | Make Only operator appear correctly in pkg.go.dev
| Go | mit | ReactiveGo/rx |
084999949e1504601ea290927f65ee4bddc94a28 | volumes.go | volumes.go | package gobrightbox
// Volume represents a Brightbox Volume
// https://api.gb1.brightbox.com/1.0/#volume
type Volume struct {
ID string
Name string
Status string
Description string
Encrypted bool
Size int
StorageType string `json:"storage_type"`
Server *Server
Account *A... | package gobrightbox
// Volume represents a Brightbox Volume
// https://api.gb1.brightbox.com/1.0/#volume
type Volume struct {
ID string
Name string
Status string
Description string
Encrypted bool
Size int
StorageType string `json:"storage_type"`
Server *Server
Account *A... | Add struct labels to ResizeOptions | Add struct labels to ResizeOptions
| Go | mit | brightbox/gobrightbox,brightbox/gobrightbox,brightbox/gobrightbox |
5633aa34830c1e6cae84072d34f0d7a8fcd4e2b8 | crawler/types.go | crawler/types.go | package crawler
import (
"net/url"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
}
type Page struct {
Url *url.URL
Links []*url.URL
Assets []string
}
type Link struct {
Source *url.URL
Tar... | package crawler
import (
"net/url"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.
Fetch(url string) (body string, urls []string, err error)
}
type Page struct {
Url *url.URL
Links []*Link
Assets []string
}
type Link struct {
Source *url.URL
Target... | Store links as Link type | Store links as Link type
| Go | mit | mattheath/kraken |
27c1bd6dd362116f27263f95295f52a564532e85 | consts/consts.go | consts/consts.go | /*
Package consts implements constants for the entire project
*/
package consts
// ConfigurationFileName is the configuration file name of Goyave
const ConfigurationFileName = ".goyave.toml"
| /*
Package consts implements constants for the entire project
*/
package consts
// ConfigurationFileName is the configuration file name of Goyave
const ConfigurationFileName = ".goyave"
| Change .goyave.toml file to .goyave | Change .goyave.toml file to .goyave
| Go | mit | k0pernicus/goyave |
e27569261abf08d8fc8383e238812d735454f4c7 | app/v1/manage_user.go | app/v1/manage_user.go | package v1
import "git.zxq.co/ripple/rippleapi/common"
type setAllowedData struct {
UserID int `json:"user_id"`
Allowed int `json:"allowed"`
}
// UserManageSetAllowedPOST allows to set the allowed status of an user.
func UserManageSetAllowedPOST(md common.MethodData) common.CodeMessager {
data := setAllowedData{... | package v1
import (
"time"
"git.zxq.co/ripple/rippleapi/common"
)
type setAllowedData struct {
UserID int `json:"user_id"`
Allowed int `json:"allowed"`
}
// UserManageSetAllowedPOST allows to set the allowed status of an user.
func UserManageSetAllowedPOST(md common.MethodData) common.CodeMessager {
data := s... | Update ban_datetime on allowed status change | Update ban_datetime on allowed status change
| Go | agpl-3.0 | osuripple/api |
84d6c382347f5c26a628719966555d84f63f5ed2 | dispatcher.go | dispatcher.go | package main
import (
"log"
"time"
)
var (
onemin = time.Minute * 1
fivemin = time.Minute * 5
tenmin = time.Minute * 10
onehour = time.Hour * 1
oneminTimer = time.NewTimer(onemin)
fiveminTimer = time.NewTimer(fivemin)
tenminTimer = time.NewTimer(tenmin)
onehourTimer = time.NewTimer(onehour)
)
func Sta... | package main
import (
"log"
"time"
)
var (
onemin = time.Minute * 1
fivemin = time.Minute * 5
tenmin = time.Minute * 10
onehour = time.Hour * 1
oneminTicker = time.NewTicker(onemin)
fiveminTicker = time.NewTicker(fivemin)
tenminTicker = time.NewTicker(tenmin)
onehourTicker = time.NewTicker(onehour)
)
... | Switch to the proper "Ticker" implementation | Switch to the proper "Ticker" implementation
A timer will only fire once. A ticker will fire once per interval
| Go | mit | mojotech/situation-room,mojotech/situation-room |
59dbea768c75a7ce07453010fcf6c392738771b8 | middleware/markdown/watcher_test.go | middleware/markdown/watcher_test.go | package markdown
import (
"fmt"
"strings"
"sync"
"testing"
"time"
)
func TestWatcher(t *testing.T) {
expected := "12345678"
interval := time.Millisecond * 100
i := 0
out := ""
stopChan := TickerFunc(interval, func() {
i++
out += fmt.Sprint(i)
})
// wait little more because of concurrency
time.Sleep(i... | package markdown
import (
"fmt"
"strings"
"sync"
"testing"
"time"
)
func TestWatcher(t *testing.T) {
expected := "12345678"
interval := time.Millisecond * 100
i := 0
out := ""
stopChan := TickerFunc(interval, func() {
i++
out += fmt.Sprint(i)
})
// wait little more because of concurrency
time.Sleep(i... | Fix race condition on AppVeyor. Increase timeout a bit. | Fix race condition on AppVeyor. Increase timeout a bit.
| Go | apache-2.0 | captncraig/caddy,tw4452852/caddy,tpng/caddy,yukimochi/caddy,eiszfuchs/caddy,buddhamagnet/caddy,tw4452852/caddy,evermax/caddy,tobya/caddy,Karthic-Hackintosh/caddy,tpng/caddy,hackintoshrao/caddy,joshix/caddy,hackintoshrao/caddy,yukimochi/caddy,ollie314/caddy,DenBeke/caddy,eiszfuchs/caddy,elcore/caddy,DenBeke/caddy,everma... |
fb9bfd1541e59b435738cf4f62f72d90e0f4dcb2 | module.go | module.go | package alice
// Module is a marker interface for structs that defines how to initialize instances.
type Module interface {
// IsModule indicates if this is a module.
IsModule() bool
}
// BaseModule is an implementation of Module interface. It should be embeded into each module defined in the
// application.
//
// ... | package alice
// Module is a marker interface for structs that defines how to initialize instances.
type Module interface {
// IsModule indicates if this is a module.
IsModule() bool
}
// BaseModule is an implementation of Module interface. It should be embeded into each module defined in the
// application.
//
// ... | Fix code format in documentation | Fix code format in documentation
| Go | mit | magic003/alice |
cf6eadf3074519d7665f7bbf230789abe71c65cd | env_tree_test.go | env_tree_test.go | package envh
import (
"regexp"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCreateTreeFromDelimiterFilteringByRegexp(t *testing.T) {
setTestingEnvsForTree()
n := createTreeFromDelimiterFilteringByRegexp(regexp.MustCompile("ENVH"), "_")
for key, expected := range map[string]string{"TEST3": "test1... | package envh
import (
"regexp"
"testing"
"github.com/stretchr/testify/assert"
)
func TestCreateTreeFromDelimiterFilteringByRegexp(t *testing.T) {
setTestingEnvsForTree()
n := createTreeFromDelimiterFilteringByRegexp(regexp.MustCompile("ENVH"), "_")
for key, expected := range map[string]string{"TEST3": "test1... | Split test function in 2 functions | Split test function in 2 functions
| Go | mit | antham/envh |
fee27f461a983e57c37fe12e0e4e2aef3034c7c6 | etcd_shim.go | etcd_shim.go | package reception
import (
etcd "github.com/coreos/etcd/client"
"golang.org/x/net/context"
)
type (
keysAPI interface {
Get(path string) (*etcd.Response, error)
Set(path, value string, opts *etcd.SetOptions) error
Watcher(path string) etcd.Watcher
}
etcdShim struct {
api etcd.KeysAPI
}
)
func (s *etcd... | package reception
import (
"context"
etcd "github.com/coreos/etcd/client"
)
type (
keysAPI interface {
Get(path string) (*etcd.Response, error)
Set(path, value string, opts *etcd.SetOptions) error
Watcher(path string) etcd.Watcher
}
etcdShim struct {
api etcd.KeysAPI
}
)
func (s *etcdShim) Get(path s... | Update one remaining context import. | Update one remaining context import.
| Go | mit | efritz/reception |
65e20959a2131b0273088d4717e9ec97fe08bffe | binpacket_pool.go | binpacket_pool.go | package tarantool
type BinaryPacketPool struct {
queue chan *BinaryPacket
}
func newPackedPacketPool() *BinaryPacketPool {
return &BinaryPacketPool{
queue: make(chan *BinaryPacket, 512),
}
}
func (p *BinaryPacketPool) GetWithID(requestID uint64) (pp *BinaryPacket) {
select {
case pp = <-p.queue:
pp.Reset()
... | package tarantool
type BinaryPacketPool struct {
queue chan *BinaryPacket
}
func newPackedPacketPool() *BinaryPacketPool {
return &BinaryPacketPool{
queue: make(chan *BinaryPacket, 1024),
}
}
func (p *BinaryPacketPool) GetWithID(requestID uint64) (pp *BinaryPacket) {
select {
case pp = <-p.queue:
default:
... | Fix the binary packet pool and x2 its capacity | Fix the binary packet pool and x2 its capacity
| Go | mit | viciious/go-tarantool |
458be07095fa95464d99ccc4d17c3def8682f49e | sluice/sluice_test.go | sluice/sluice_test.go | package sluice
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func Test(t *testing.T) {
Convey("Sluice can...", t, func() {
gondola := New()
Convey("pump values", func() {
gondola.Push("x")
gondola.Push("y")
gondola.Push("z")
So(<-gondola.Next(), ShouldEqual, "x")
So(<-gondo... | package sluice
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func Test(t *testing.T) {
Convey("Sluice can...", t, func() {
gondola := New()
Convey("pump values", func() {
gondola.Push("x")
gondola.Push("y")
gondola.Push("z")
So(<-gondola.Next(), ShouldEqual, "x")
So(<-gondo... | Fix a sluice test with probablistic failure. | Fix a sluice test with probablistic failure.
The synchronization wasn't wrong: the test was. If you sign up another channel first, *then* send, it's random -- up to map order -- which one will get it.
The test now sends that message, then signs up the next channel, making the behavior predictable.
Though it's alway... | Go | apache-2.0 | polydawn/go-sup,polydawn/go-sup |
e25741eadca9875c822f2df7bbdaad5c22d934ed | generator.go | generator.go | package acgen
import (
"fmt"
"io"
"sync"
)
type Command struct {
Name string
Flags []*Flag
}
type Flag struct {
Short []string
Long []string
Arg string
Description string
}
type Generator func(w io.Writer, c *Command) error
var (
generatorsMu sync.Mutex
generators = make(map[stri... | package acgen
import (
"fmt"
"io"
"sync"
)
// A Command represents a command which has flags.
type Command struct {
Name string
Flags []*Flag
}
// A Flag represents the information of a flag.
type Flag struct {
Short []string // short options
Long []string // long options
Arg string /... | Add comments for types and functions to be published | Add comments for types and functions to be published
| Go | mit | kusabashira/acgen |
ffaeeb1a92ec1fced6ec8181585f0089a2ce1cd4 | libtorrent_cgo.go | libtorrent_cgo.go | package libtorrent
// #cgo pkg-config: libtorrent-rasterbar openssl
// #cgo darwin LDFLAGS: -lm -lstdc++
// #cgo linux LDFLAGS: -lm -lstdc++ -ldl -lrt
// #cgo windows CXXFLAGS: -DIPV6_TCLASS=39 -O0 -g
// #cgo windows LDFLAGS: -static-libgcc -static-libstdc++
import "C"
| package libtorrent
// #cgo pkg-config: libtorrent-rasterbar openssl
// #cgo darwin LDFLAGS: -lm -lstdc++
// #cgo linux LDFLAGS: -lm -lstdc++ -ldl -lrt
// #cgo windows CXXFLAGS: -DIPV6_TCLASS=39
// #cgo windows LDFLAGS: -static-libgcc -static-libstdc++
import "C"
| Remove debug flags in cgo | Remove debug flags in cgo
Signed-off-by: Steeve Morin <7f3ba7bbc079b62d3fe54555c2b0ce0ddda2bb7c@gmail.com>
| Go | bsd-3-clause | dylanvee/libtorrent-go,dylanvee/libtorrent-go,steeve/libtorrent-go,waynus/libtorrent-go,dylanvee/libtorrent-go,sharkone/libtorrent-go,anteo/libtorrent-go,waynus/libtorrent-go,sharkone/libtorrent-go,steeve/libtorrent-go,steeve/libtorrent-go,waynus/libtorrent-go,sharkone/libtorrent-go,anteo/libtorrent-go |
135bbfe57b37ab28f1863f9b455db7399b7f7ba4 | handlers/errors.go | handlers/errors.go | package handlers
import (
"encoding/json"
"log"
"net/http"
)
//ReturnInternalServerError returns an Internal Server Error
func ReturnInternalServerError(w http.ResponseWriter, message string) {
log.Println(message)
response := make(map[string]string)
response["status"] = "false"
w.WriteHeader(http.StatusIntern... | package handlers
import (
"encoding/json"
"log"
"net/http"
)
//ReturnInternalServerError returns an Internal Server Error
func ReturnInternalServerError(w http.ResponseWriter, message string) {
log.Println(message)
response := make(map[string]interface{})
response["status"] = false
w.WriteHeader(http.StatusInt... | Change response status type from string to bool | Change response status type from string to bool
| Go | mit | jimmified/jimmify-server,jimmified/jimmify-server |
b1e3361e7fb6c1db1c01167dcd089d913ee15ef2 | test/acceptance/helper/assertions.go | test/acceptance/helper/assertions.go | package helper
import (
"encoding/json"
"testing"
)
// Asserts that the request did not return an error.
// Optionally perform some checks only if the request did not fail
func AssertRequestOk(t *testing.T, response interface{}, err error, check_fn func()) {
if err != nil {
response_json, _ := json.MarshalIndent... | package helper
import (
"encoding/json"
"reflect"
"testing"
)
// Asserts that the request did not return an error.
// Optionally perform some checks only if the request did not fail
func AssertRequestOk(t *testing.T, response interface{}, err error, check_fn func()) {
if err != nil {
response_json, _ := json.Ma... | Improve acceptance test assertion by printing out error type | Improve acceptance test assertion by printing out error type
This is useful to distinguish between e.g. a 500 and 404 status code.
| Go | bsd-3-clause | weaviate/weaviate,weaviate/weaviate |
5dcc09b513990cdae469bb073e287713a1315448 | main_unix.go | main_unix.go | package main
// +build linux darwin
import (
"errors"
"github.com/koding/klient/cmd/klientctl/util"
)
// AdminRequired parses through an arg list and requires an admin (sudo)
// for the specified commands.
//
// Note that if the command is required, *and* we failed to get admin
// permission information, let the ... | package main
// +build linux darwin
import (
"errors"
"github.com/koding/klient/cmd/klientctl/util"
)
// AdminRequired parses through an arg list and requires an admin (sudo)
// for the specified commands.
//
// Note that if the command is required, *and* we failed to get admin
// permission information, let the ... | Break from loop if requirement is found | klientctl: Break from loop if requirement is found
| Go | agpl-3.0 | kwagdy/koding-1,rjeczalik/koding,szkl/koding,drewsetski/koding,alex-ionochkin/koding,drewsetski/koding,jack89129/koding,acbodine/koding,gokmen/koding,cihangir/koding,koding/koding,drewsetski/koding,sinan/koding,mertaytore/koding,acbodine/koding,rjeczalik/koding,sinan/koding,jack89129/koding,usirin/koding,andrewjcasal/k... |
1bbe0e23a4e418cde7a25ec933a23426f46fe7aa | packagereader.go | packagereader.go | package gomposer
import (
"os"
"encoding/json"
)
type Reader interface {
Read(filename string) *Version
}
type PackageReader struct {
}
func (pr PackageReader) Read(filename string) (*Version, error) {
buf, err := os.Open(filename)
if err != nil {
return nil, err
}
output := &Ve... | package gomposer
import (
"os"
"encoding/json"
)
type Reader interface {
Read(filename string) *Version
}
type PackageReader struct {
}
func (pr PackageReader) Read(filename string) (*Version, error) {
buf, err := os.Open(filename)
if err != nil {
return nil, err
}
output := &Version{}
json.NewDecode... | Refactor dependency resolver + add test for later on | Refactor dependency resolver + add test for later on
| Go | mit | icambridge/gomposer |
2f6c1c4212b45d691891bc1276573546c6ab66cc | models/settings.go | models/settings.go | package models
import (
"github.com/herald-it/goncord/utils"
"gopkg.in/yaml.v2"
"io/ioutil"
)
type Setting struct {
Database struct {
Host string
DbName string
TokenTable string
UserTable string
}
}
var Set Setting
func LoadSettings() {
text, err := ioutil.ReadFile("./settings.yml")
util... | package models
import (
"github.com/herald-it/goncord/utils"
"gopkg.in/yaml.v2"
"io/ioutil"
)
type Setting struct {
Database struct {
Host string
DbName string
TokenTable string
UserTable string
}
}
var Set Setting
func LoadSettings() error {
text, err := ioutil.ReadFile("./settings.yml")... | Add returned value from LoadSettings method. | Add returned value from LoadSettings method.
| Go | mit | herald-it/goncord |
7d0245aa7bf2b1a1906f4264a046bada31d6b1ab | compare/compare_test.go | compare/compare_test.go | package compare_test
import (
"testing"
"github.com/xgfone/go-tools/compare"
)
func TestCompare(t *testing.T) {
v1 := []uint16{1, 2, 4}
v2 := []uint16{1, 2, 3}
if !compare.GT(v1, v2) {
t.Fail()
}
if !compare.LT(v2, v1) {
t.Fail()
}
if compare.EQ(v1, v2) {
t.Fail()
}
if !compare.EQ([]int{1, 2, 3},... | package compare_test
import (
"testing"
"github.com/xgfone/go-tools/compare"
)
func TestCompare(t *testing.T) {
v1 := []uint16{1, 2, 4}
v2 := []uint16{1, 2, 3}
if !compare.GT(v1, v2) {
t.Fail()
}
if !compare.LT(v2, v1) {
t.Fail()
}
if compare.EQ(v1, v2) {
t.Fail()
}
if !compare.EQ([]int{1, 2, 3},... | Add the test for compare | Add the test for compare
| Go | apache-2.0 | xgfone/go-tools |
22e40afc32f0467a3bad7d08ccd3594ee4160423 | docker-structs.go | docker-structs.go | package dockerguard
type Container struct {
Id string
Hostname string
}
| package dockerguard
type DockerInfo struct {
Containers int `json:"Containers"`
Debug int `json:"Debug"`
DockerRootDir string `json:"DockerRootDir"`
Driver string `json:"Driver"`
DriverStatus [][]string `json:"DriverStatus"`
ExecutionDriver ... | Add DockerInfo & DockerVersion struct | Add DockerInfo & DockerVersion struct
| Go | mit | 90TechSAS/libgo-docker-guard |
ef775b6a90143374b7d5d99ed8e44a512e3cd162 | osversion/windowsbuilds.go | osversion/windowsbuilds.go | package osversion
const (
// RS1 (version 1607, codename "Redstone 1") corresponds to Windows Server
// 2016 (ltsc2016) and Windows 10 (Anniversary Update).
RS1 = 14393
// RS2 (version 1703, codename "Redstone 2") was a client-only update, and
// corresponds to Windows 10 (Creators Update).
RS2 = 15063
// RS3... | package osversion
const (
// RS1 (version 1607, codename "Redstone 1") corresponds to Windows Server
// 2016 (ltsc2016) and Windows 10 (Anniversary Update).
RS1 = 14393
// RS2 (version 1703, codename "Redstone 2") was a client-only update, and
// corresponds to Windows 10 (Creators Update).
RS2 = 15063
// RS3... | Fix Windows Server version for RS4 in comment | Fix Windows Server version for RS4 in comment
Signed-off-by: Sebastiaan van Stijn <64b2b6d12bfe4baae7dad3d018f8cbf6b0e7a044@gone.nl>
| Go | mit | madhanrm/hcsshim,Microsoft/hcsshim |
0a1d699df9de68f98542acdb502f385db5c4c080 | flagparse.go | flagparse.go | package flagparse
import (
"fmt"
"os"
"path"
)
// ArgumentParser is a struct for parsing command line strings
type ArgumentParser struct {
prog string
}
// NewArgumentParser returns new ArgumentParser pointer
func NewArgumentParser(prog string) *ArgumentParser {
ap := &ArgumentParser{}
if prog == "" {
prog =... | package flagparse
import (
"fmt"
"os"
"path"
)
// ArgumentParser is a struct for parsing command line strings
type ArgumentParser struct {
prog string
}
// NewArgumentParser returns new ArgumentParser pointer
func NewArgumentParser(prog string) *ArgumentParser {
ap := &ArgumentParser{}
if prog == "" {
prog =... | Print error message when receive unrecogonized arguments. | Print error message when receive unrecogonized arguments.
| Go | mit | nekikara/flagparse,nekikara/clier,nekikara/clier,nekikara/flagparse |
ee0bb560054d6a1f103a1600838cf8e18c28bd88 | formats/0.go | formats/0.go | package formats
import (
"fmt"
"github.com/anaminus/rbxmk"
)
// registry contains registered Formats.
var registry []func() rbxmk.Format
// register registers a Format to be returned by All.
func register(f func() rbxmk.Format) {
registry = append(registry, f)
}
// All returns a list of Formats defined in the p... | package formats
import (
"fmt"
"github.com/anaminus/rbxmk"
"github.com/robloxapi/types"
)
// registry contains registered Formats.
var registry []func() rbxmk.Format
// register registers a Format to be returned by All.
func register(f func() rbxmk.Format) {
registry = append(registry, f)
}
// All returns a li... | Use Type method in error message, if possible. | Use Type method in error message, if possible.
| Go | mit | Anaminus/rbxmk,Anaminus/rbxmk |
c103003af6de2fa3edb72567afb5bcf1e8bc29da | databath/QueryConditions.go | databath/QueryConditions.go | package databath
import ()
type QueryConditions struct {
collection string
where []QueryCondition
pk *uint64
fieldset *string
limit *int64
filter *map[string]interface{}
offset *int64
sort []*QuerySort
search map[string]string
}
type QueryCondition interface {
GetCondi... | package databath
import ()
type QueryConditions struct {
collection string
where []QueryCondition
pk *uint64
fieldset *string
limit *int64
filter *map[string]interface{}
offset *int64
sort []*QuerySort
search map[string]string
}
func (qc *QueryConditions) CollectionName... | Add getters for query things (BM Portal) | Add getters for query things (BM Portal) | Go | mit | daemonl/go_lib |
3ad8d2dd6d92a0f909ed6ea102369759dc3518fe | src/testhelpers/assert/slices.go | src/testhelpers/assert/slices.go | package assert
import (
"fmt"
"strings"
)
type Line []string
func (line Line) String() string {
return strings.Join(line, ", ")
}
type Lines []Line
func SliceContains(actual []string, expected Lines, msgAndArgs ...interface{}) bool {
expectedIndex := 0
for _, actualValue := range actual {
allStringsFound :=... | package assert
import (
"fmt"
"strings"
)
type Line []string
func (line Line) String() string {
return strings.Join(line, ", ")
}
type Lines []Line
func SliceContains(actual Line, expected Lines, msgAndArgs ...interface{}) bool {
expectedIndex := 0
for _, actualValue := range actual {
allStringsFound := tru... | Improve error message for SliceContains | Improve error message for SliceContains
Also, use the types we defined in SliceContains for the params
| Go | apache-2.0 | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli |
1e626fddc09e34210ba9e4412eb1266a869d0d04 | main_test.go | main_test.go | package main
| package main
import "testing"
func TestHandleConfigFile(t *testing.T) {
if _, err := HandleConfigFile(""); err == nil {
t.FailNow()
}
// Depends on default config being avaiable and correct (which is nice!)
if _, err := HandleConfigFile("config.yaml"); err != nil {
t.FailNow()
}
}
| Add test for handling config files. | Add test for handling config files.
Checks also default config file which is a big plus as it will fail the
test if there will be errors.
| Go | apache-2.0 | pasinskim/deployments,pasinskim/deployments,pasinskim/deployments,pasinskim/deployments |
9e721e75ceeb61b1c7b0eec952f7e7ffb0be7978 | nodestatus.go | nodestatus.go | package main
import (
"fmt"
"github.com/pgombola/knowmads/client"
)
func main() {
nodes := client.Status()
for _, node := range nodes {
fmt.Printf("ID=%v;Name=%v;Drain=%v\n", node.ID, node.Name, node.Drain)
}
}
| package main
import (
"fmt"
"github.com/pgombola/gomad/client"
)
func main() {
nodes := client.Status()
for _, node := range nodes {
fmt.Printf("ID=%v;Name=%v;Drain=%v\n", node.ID, node.Name, node.Drain)
}
}
| Change name of package to 'gomad' | Change name of package to 'gomad'
| Go | apache-2.0 | pgombola/gomad |
8067cafd70c1a14d313ff1afec7e7f1faff39952 | scoring/score.go | scoring/score.go | package scoring
import (
"fmt"
"math"
"time"
)
// A point of reference Score.Update and Score.Relevance use to reference the
// current time. It is used in testing, so we always have the same current
// time. This is okay for this programs as it won't run for long.
var Now time.Time
// Represents a weight of a sc... | package scoring
import (
"fmt"
"math"
"time"
)
// A point of reference Score.Update and Score.Relevance use to reference the
// current time. It is used in testing, so we always have the same current
// time. This is okay for this programs as it won't run for long.
var Now time.Time
// Represents a weight of a sc... | Make sure s.Relevance is normalized (0, 1) | Make sure s.Relevance is normalized (0, 1)
| Go | mit | gsamokovarov/jump |
e5e18959f1c2b67cab89e60a9975b30101cc1f18 | pem_test.go | pem_test.go | package ocspd
import (
"reflect"
"testing"
)
func TestParsePEM(t *testing.T) {
for _, tt := range []string{"testdata/cert_only", "testdata/full"} {
cert, issuer, err := ParsePEMCertificateBundle(tt)
if err != nil {
t.Fatal(err)
}
if cert.SerialNumber.Uint64() != 4455460921000457498 {
t.Error("failed"... | package ocspd
import (
"reflect"
"testing"
)
func TestParsePEM(t *testing.T) {
for _, tt := range []string{"testdata/cert_only", "testdata/full"} {
cert, issuer, err := ParsePEMCertificateBundle(tt)
if err != nil {
t.Error(err)
continue
}
if cert.SerialNumber.Uint64() != 4455460921000457498 {
t.Er... | Fix TestParsePEM: use t.Error rather than t.Fatal in table-driven test | Fix TestParsePEM: use t.Error rather than t.Fatal in table-driven test
| Go | bsd-3-clause | tbroyer/ocspd,tbroyer/ocspd |
9cbf4224d19af6e0ff9893bd6cd5c3d30acdced7 | lisp_test.go | lisp_test.go | // Copyright 2014 SteelSeries ApS. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This package implements a basic LISP interpretor for embedding in a go program for scripting.
// This file runs lisp based tests.
package golisp
import (... | // Copyright 2014 SteelSeries ApS. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// This package implements a basic LISP interpretor for embedding in a go program for scripting.
// This file runs lisp based tests.
package golisp
import (... | Use quiet mode for lisp tests when running go test | Use quiet mode for lisp tests when running go test
| Go | bsd-3-clause | SteelSeries/golisp,SteelSeries/golisp,SteelSeries/golisp |
40eed2f3818ff9cde80c6d50b7cfe4ac456c5f13 | net/httpclient/doc.go | net/httpclient/doc.go | // Package httpclient provides an HTTP client with several conveniency
// functions.
//
// This package is cross platform, so it works on both standalone deployments
// as well as on App Engine.
package httpclient
| // Package httpclient provides an HTTP client with several conveniency
// functions.
//
// This package is cross platform, so it works on both standalone deployments
// as well as on App Engine.
//
// Also, requests made with an httpclient instance are properly measured
// when profiling an app.
package httpclient
| Clarify that this package supports profiling | Clarify that this package supports profiling
| Go | mpl-2.0 | rainycape/gondola,rainycape/gondola,rainycape/gondola,rainycape/gondola |
0a1c57f44ee7ba6edddaf855b07a9e3c886d774b | ConcurrencyPatterns/ActiveObject/ActiveObjectWithInterval_test.go | ConcurrencyPatterns/ActiveObject/ActiveObjectWithInterval_test.go | package ActiveObject
import (
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestActiveObject(t *testing.T) {
var activeObject IActiveObject
var wait sync.WaitGroup
wait.Add(1)
activeObject = NewActiveObjectWithInterval(time.Millisecond * 50)
counter := 0
activeObject.SetWorkerFunct... | package ActiveObject
import (
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestActiveObject(t *testing.T) {
var activeObject IActiveObject
var wait sync.WaitGroup
wait.Add(1)
activeObject = NewActiveObjectWithInterval(time.Millisecond * 50)
counter := 0
activeObject.SetWorkerFunct... | Make sure the param passed is correct | Make sure the param passed is correct
| Go | mit | irwansyahwii/Pattern-Oriented-Software-Architecture-With-Go |
c2851c6b6ec2be65e9c09b31d64915049b62311a | otto/main.go | otto/main.go | package main
import (
"fmt"
"flag"
"io/ioutil"
"os"
"github.com/robertkrimen/otto"
)
func main() {
flag.Parse()
var script []byte
var err error
filename := flag.Arg(0)
if filename == "" || filename == "-" {
script, err = ioutil.ReadAll(os.Stdin)
if err != nil {
fmt.Printf("Can't read stdin: %v\n", er... | package main
import (
"fmt"
"flag"
"io/ioutil"
"os"
"github.com/robertkrimen/otto"
"github.com/robertkrimen/otto/underscore"
)
var underscoreFlag *bool = flag.Bool("underscore", true, "Load underscore into the runtime environment")
func main() {
flag.Parse()
var script []byte
var err error
filename := flag... | Add underscore to the commandline | Add underscore to the commandline
| Go | apache-2.0 | lsk-kun/lantern,kelvine/lantern,kangwl/lantern,WaybackMachine/lantern,Denniskevin/lantern,ubuntuvim/lantern,ywzw2013/lantern,tyrchen/lantern,fangshili/lantern,Batterfii/lantern,velocity-toolkit/otto,gregoriusxu/lantern,WaybackMachine/lantern,Jonavin/lantern,newbiecoming/lantern,dmitris/otto,lsk-kun/lantern,dqw18037/lan... |
8add49dbd02db3e1c435f905042669dc65ca22e3 | src/server/pkg/watch/op.go | src/server/pkg/watch/op.go | package watch
import etcd "github.com/coreos/etcd/clientv3"
// OpOption is a simple typedef for etcd.OpOption.
type OpOption struct {
Get etcd.OpOption
Watch etcd.OpOption
}
// WithFilterPut discards PUT events from the watcher.
func WithFilterPut() OpOption {
return OpOption{Watch: etcd.WithFilterPut(), Get: n... | package watch
import etcd "github.com/coreos/etcd/clientv3"
// OpOption is a simple typedef for etcd.OpOption.
type OpOption struct {
Get etcd.OpOption
Watch etcd.OpOption
}
// WithFilterPut discards PUT events from the watcher.
func WithFilterPut() OpOption {
return OpOption{Watch: etcd.WithFilterPut(), Get: n... | Add delete filter to watch package | Add delete filter to watch package
| Go | apache-2.0 | pachyderm/pfs,pachyderm/pfs,pachyderm/pfs |
17438fe622bf9f62b0c3ec5bdb2f5291472b0f3f | tuikit/progress_spinner.go | tuikit/progress_spinner.go | package tuikit
import "time"
type ProgressSpinner struct {
*TextView
spinRunes []rune
current int
}
func NewProgressSpinner() *ProgressSpinner {
ps := &ProgressSpinner{
TextView: NewTextView(),
spinRunes: []rune{'|', '/', '—', '\\', '|', '/', '—', '\\'},
}
go func() {
l := len(ps.spinRunes)
for _ ... | package tuikit
import "time"
type ProgressSpinner struct {
*TextView
spinRunes []rune
current int
}
func NewProgressSpinner() *ProgressSpinner {
ps := &ProgressSpinner{
TextView: NewTextView(),
spinRunes: []rune{'|', '/', '—', '\\', '|', '/', '—', '\\'},
}
go func() {
l := len(ps.spinRunes)
for _ ... | Adjust ProgressSpinner tick time to 110 ms | Adjust ProgressSpinner tick time to 110 ms
| Go | apache-2.0 | sgeb/go-tuikit,sgeb/go-tuikit |
0ac59b4f5824fcb86f7cf69d336b714ac5d85309 | data/document.go | data/document.go | package data
import (
"time"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
type Document struct {
ID bson.ObjectId `bson:"_id"`
ShortId string `bson:"short_id"`
Title string `bson:"title"`
Content string `bson:"content"`
Tags []string `bson:"tags"`
Publis... | package data
import (
"time"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
type Document struct {
ID bson.ObjectId `bson:"_id"`
ShortID string `bson:"short_id"`
Title string `bson:"title"`
Content string `bson:"content"`
Tags []string `bson:"tags"`
Publis... | Implement Put for Document struct | Implement Put for Document struct
| Go | bsd-3-clause | FurqanSoftware/papyrus,FurqanSoftware/papyrus,FurqanSoftware/papyrus |
8ecde54d772bad9bd6de683c6c44785794663756 | unit_test.go | unit_test.go | package fnlog_test
import (
"github.com/northbright/fnlog"
"log"
)
var (
noTagLog *log.Logger
)
func Example() {
iLog := fnlog.New("i")
wLog := fnlog.New("w")
eLog := fnlog.New("e")
// Global *log.Logger
noTagLog = fnlog.New("")
iLog.Printf("print infos")
wLog.Printf("print warnnings")
eLog.Printf("prin... | package fnlog_test
import (
"github.com/northbright/fnlog"
"log"
)
var (
noTagLog *log.Logger
)
func Example() {
iLog := fnlog.New("i")
wLog := fnlog.New("w")
eLog := fnlog.New("e")
noTagLog = fnlog.New("")
iLog.Printf("print infos")
wLog.Printf("print warnnings")
eLog.Printf("print errors")
noTagLog.Pr... | Remove comment to see outputs works in godoc | Remove comment to see outputs works in godoc
| Go | mit | vonwenm/fnlog |
aeeda1e80e814ca09fd39bf405d86a69e00574a9 | waterfall.go | waterfall.go | package async
// import "fmt"
func Waterfall(routines []Routine, callbacks ...Done) {
l := New()
l.Multiple(routines...)
l.RunWaterfall(callbacks...)
}
func (l *List) RunWaterfall(callbacks ...Done) {
fall := fall(l, callbacks...)
next := next(l, callbacks...)
l.Wait.Add(l.Len())
fall(next)
}
func ... | package async
func Waterfall(routines []Routine, callbacks ...Done) {
l := New()
l.Multiple(routines...)
l.RunWaterfall(callbacks...)
}
func (l *List) RunWaterfall(callbacks ...Done) {
fall := fall(l, callbacks...)
next := next(l, callbacks...)
l.Wait.Add(l.Len())
fall(next)
}
func fall(l *List, cal... | Remove commented import that isn't used | Remove commented import that isn't used
| Go | mit | Southern/async |
a099b5569c226e498ab33e17a116be207557497d | tun_other.go | tun_other.go | //go:build !linux && !freebsd
package tuntap
const flagTruncated = 0
func createInterface(ifPattern string, kind DevKind) (*Interface, error) {
panic("tuntap: Not implemented on this platform")
}
| //go:build !linux && !freebsd
package tuntap
import (
"net"
)
const flagTruncated = 0
func createInterface(ifPattern string, kind DevKind) (*Interface, error) {
panic("tuntap: Not implemented on this platform")
}
// IPv6SLAAC enables/disables stateless address auto-configuration (SLAAC) for the interface.
func (... | Add stubs for non-linux, non-freebsd platforms to fix builds on MacOS. | Add stubs for non-linux, non-freebsd platforms to fix builds on MacOS.
| Go | apache-2.0 | mistsys/tuntap,mistsys/tuntap |
76d5d8493f853da5e371e761e5c31515883d2ed9 | zone_test.go | zone_test.go | package dns
import (
"testing"
)
func TestRadixName(t *testing.T) {
tests := map[string]string{".": ".",
"www.miek.nl.": ".nl.miek.www",
"miek.nl.": ".nl.miek",
"mi\\.ek.nl.": ".nl.mi\\.ek",
`mi\\.ek.nl.`: `.nl.ek.mi\\`,
"": "."}
for i, o := range tests {
t.Logf("%s %v\n", i, SplitLab... | package dns
import (
"testing"
)
func TestRadixName(t *testing.T) {
tests := map[string]string{".": ".",
"www.miek.nl.": ".nl.miek.www",
"miek.nl.": ".nl.miek",
"mi\\.ek.nl.": ".nl.mi\\.ek",
`mi\\.ek.nl.`: `.nl.ek.mi\\`,
"": "."}
for i, o := range tests {
t.Logf("%s %v\n", i, SplitLab... | Add zone test from Alex Polvi | Add zone test from Alex Polvi
| Go | bsd-3-clause | bragr/dns,benbearchen/dns,tempbottle/dns,janstk/dns,rolandshoemaker/dns,cloudflare/dns,flebarbe/dns,jdef/dns,jmhodges/dns,josephyzhou/dns,skyportsystems/dns,miekg/dns,Psiphon-Inc/dns,letsencrypt/dns,skynet/dns,hugozhu/dns,AlexCheong/dns,bboreham/dns,asergeyev/dns,modulexcite/dns,michaelharo/dns,curtiszimmerman/dns,ym/g... |
c9ededb515aefc2e14a021cd38b9313845463524 | file-server/utils.go | file-server/utils.go | // Copyright (c) 2016, Janoš Guljaš <janos@resenje.org>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fileServer
import (
"net/http"
"os"
"path"
"path/filepath"
"strings"
)
func redirect(w http.ResponseWriter, r *http.Requ... | // Copyright (c) 2016, Janoš Guljaš <janos@resenje.org>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fileServer
import (
"net/http"
"os"
"path"
"path/filepath"
)
func redirect(w http.ResponseWriter, r *http.Request, locati... | Simplify open function for file server | Simplify open function for file server
| Go | bsd-3-clause | janos/httputils,janos/web |
9e0e24f71ab95114af4e1f3f228e51b6f232a344 | system/cpu.go | system/cpu.go | package system
import (
"fmt"
"io/ioutil"
"strconv"
"strings"
)
// parseCPUInfo returns a newline-delimited string slice of '/proc/cpuinfo'.
func parseCPUInfo() []string {
cached, _ := ioutil.ReadFile("/proc/cpuinfo")
return strings.Split(string(cached), "\n")
}
// parseCPUCount returns the number of CPU cores... | package system
import (
"io/ioutil"
"strconv"
"strings"
)
// parseCPUInfo returns a newline-delimited string slice of '/proc/cpuinfo'.
func parseCPUInfo() []string {
cached, _ := ioutil.ReadFile("/proc/cpuinfo")
return strings.Split(string(cached), "\n")
}
// parseCPUCount returns the number of CPU cores in the... | Remove fmt since it's not used | Remove fmt since it's not used
| Go | unlicense | mmstick/i3gostatusbar |
885d51c4467d17e6893d079723c2534533fb84cd | repository/source/filter_in_memory.go | repository/source/filter_in_memory.go | package source
import (
"github.com/pkg/errors"
"github.com/dpb587/metalink/repository"
"github.com/dpb587/metalink/repository/filter"
)
func FilterInMemory(files []repository.RepositoryMetalink, filter filter.Filter) ([]repository.RepositoryMetalink, error) {
results := []repository.RepositoryMetalink{}
for _,... | package source
import (
"github.com/dpb587/metalink/repository"
"github.com/dpb587/metalink/repository/filter"
"github.com/pkg/errors"
)
func FilterInMemory(files []repository.RepositoryMetalink, filter filter.Filter) ([]repository.RepositoryMetalink, error) {
results := []repository.RepositoryMetalink{}
for _,... | Include meta4 path in filtering errors | Include meta4 path in filtering errors
| Go | mit | dpb587/metalink |
618784ccf0d66bf42d97089cccca88e997988dd6 | src/staticfile/integration/deploy_reverse_proxy_app_test.go | src/staticfile/integration/deploy_reverse_proxy_app_test.go | package integration_test
import (
"path/filepath"
"github.com/cloudfoundry/libbuildpack/cutlass"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("deploy a staticfile app", func() {
var app *cutlass.App
AfterEach(func() {
if app != nil {
app.Destroy()
}
app = nil
})
BeforeE... | package integration_test
import (
"path/filepath"
"github.com/cloudfoundry/libbuildpack/cutlass"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("deploy a staticfile app", func() {
var app *cutlass.App
AfterEach(func() {
if app != nil {
app.Destroy()
}
app = nil
})
BeforeE... | Fix integration tests due to Google Privacy Policy content changes. | Fix integration tests due to Google Privacy Policy content changes.
Signed-off-by: Danny Joyce <656eadb1608d5e3ea5db131e513d97abdf96b075@pivotal.io>
| Go | apache-2.0 | cloudfoundry/staticfile-buildpack,cloudfoundry/staticfile-buildpack,cloudfoundry/staticfile-buildpack,cloudfoundry/staticfile-buildpack |
af196c8870166436eced86b31156cee7eb7b6344 | core/container/ccintf/ccintf.go | core/container/ccintf/ccintf.go | /*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package ccintf
//This package defines the interfaces that support runtime and
//communication between chaincode and peer (chaincode support).
//Currently inproccontroller uses it. dockercontroller does not.
import (
"github.com/hype... | /*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package ccintf
//This package defines the interfaces that support runtime and
//communication between chaincode and peer (chaincode support).
//Currently inproccontroller uses it. dockercontroller does not.
import (
persistence "git... | Fix goimport errors in core/container | [FAB-15484] Fix goimport errors in core/container
Change-Id: I4bd71cdfc8996d3e2ce72f89ff3bde0e400afb3d
Signed-off-by: Brett Logan <24e15547523ce4bb6c2ac877c9de72671df60332@ibm.com>
| Go | apache-2.0 | jimthematrix/fabric,binhn/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric-sidedb,binhn/fabric,manish-sethi/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric,hyperledger/fabric,hyperledger/fabric,jimthematrix/fabric,binhn/fabric,manish-sethi/fabric-sidedb,manish-sethi/fabric-sidedb,manish-sethi/fabric-sidedb,s... |
9868e88870cdd3927f618cfe7236197e12a19289 | cmd/clusterconfig-provider/main.go | cmd/clusterconfig-provider/main.go | package main
import (
"time"
log "github.com/Sirupsen/logrus"
logx "github.com/cerana/cerana/pkg/logrusx"
"github.com/cerana/cerana/provider"
"github.com/cerana/cerana/providers/clusterconf"
flag "github.com/spf13/pflag"
)
func main() {
log.SetFormatter(&logx.MistifyFormatter{})
config := clusterconf.NewCon... | package main
import (
"time"
log "github.com/Sirupsen/logrus"
logx "github.com/cerana/cerana/pkg/logrusx"
"github.com/cerana/cerana/provider"
"github.com/cerana/cerana/providers/clusterconf"
flag "github.com/spf13/pflag"
)
func main() {
log.SetFormatter(&logx.JSONFormatter{})
config := clusterconf.NewConfig... | Update clusterconfig-provider binary to use logrusx.JSONFormatter | Update clusterconfig-provider binary to use logrusx.JSONFormatter
| Go | mit | cerana/cerana,cerana/cerana,cerana/cerana,cerana/cerana |
9940844a01dea7d51fb352ff438d1f5bf01dea2e | build_test.go | build_test.go | package main
import (
"io/ioutil"
"os"
"testing"
assert "github.com/stretchr/testify/require"
)
func TestResizeImage(t *testing.T) {
tmpfile, err := ioutil.TempFile("", "resized_image")
assert.NoError(t, err)
defer os.Remove(tmpfile.Name())
err = resizeImage(nil, "./content/images/about/avatar.jpg", tmpfile... | package main
import (
"io/ioutil"
"os"
"testing"
assert "github.com/stretchr/testify/require"
)
func TestResizeImage(t *testing.T) {
tmpfile, err := ioutil.TempFile("", "resized_image")
assert.NoError(t, err)
defer os.Remove(tmpfile.Name())
err = resizeImage(nil, "./content/images/about/avatar.jpg", tmpfile... | Add test for without MozJPEG | Add test for without MozJPEG
| Go | mit | brandur/sorg,brandur/sorg,brandur/sorg,brandur/sorg,brandur/sorg |
04efe5ced34803c4d6a6663800611039194cfefd | openflow/of10/match.go | openflow/of10/match.go | package of10
import "net"
type Match struct {
Wildcards uint32
InPort PortNumber
EthSrc net.HardwareAddr
EthDst net.HardwareAddr
VlanId VlanId
VlanPriority VlanPriority
pad1 [1]uint8
EtherType EtherType
IpTos Dscp
IpProtocol ProtocolNumber
pad2 [2]uint... | package of10
import "net"
type Match struct {
Wildcards Wildcard
InPort PortNumber
EthSrc net.HardwareAddr
EthDst net.HardwareAddr
VlanId VlanId
VlanPriority VlanPriority
pad1 [1]uint8
EtherType EtherType
IpTos Dscp
IpProtocol ProtocolNumber
pad2 [2]ui... | Declare constant related to wildcard | Declare constant related to wildcard
| Go | mit | oshothebig/goflow |
5ba86a4d77aa9a7517da18ff378c1794355dd46b | orm/interface.go | orm/interface.go | package orm
import (
"gnd.la/orm/query"
)
// Interface is implemented by both Orm
// and Transaction. This allows functions to
// receive an orm.Interface parameter and work
// with both transactions and outside of them.
// See the Orm documentation to find what each
// method does.
type Interface interface {
Table... | package orm
import (
"reflect"
"gnd.la/orm/operation"
"gnd.la/orm/query"
)
// Interface is implemented by both Orm
// and Transaction. This allows functions to
// receive an orm.Interface parameter and work
// with both transactions and outside of them.
// See the Orm documentation to find what each
// method doe... | Add TypeTable(), Operate() and MustOperate() to orm.Interface | Add TypeTable(), Operate() and MustOperate() to orm.Interface
All those methods are implemented by both Orm and Tx
| Go | mpl-2.0 | rainycape/gondola,rainycape/gondola,rainycape/gondola,rainycape/gondola |
bbcee77b028aa3fbd9c54fe129efcbd61bbb6365 | internal/clock/now.go | internal/clock/now.go | // Copyright 2016 Hajime Hoshi
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | // Copyright 2016 Hajime Hoshi
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | Use time.Since for monotonic timer | clock: Use time.Since for monotonic timer
Fixes #875
| Go | apache-2.0 | hajimehoshi/ebiten,hajimehoshi/ebiten |
7bed6a18ea6f00deda4ea0b2797f715c7c555a6c | aetest/doc.go | aetest/doc.go | /*
Package aetest provides an API for running dev_appserver for use in tests.
An example test file:
package foo_test
import (
"testing"
"google.golang.org/appengine/memcache"
"google.golang.org/appengine/aetest"
)
func TestFoo(t *testing.T) {
ctx, done, err := aetest.NewContext(nil)
if err != nil {
... | /*
Package aetest provides an API for running dev_appserver for use in tests.
An example test file:
package foo_test
import (
"testing"
"google.golang.org/appengine/memcache"
"google.golang.org/appengine/aetest"
)
func TestFoo(t *testing.T) {
ctx, done, err := aetest.NewContext()
if err != nil {
t... | Fix example code use of aetest.NewContext. | aetest: Fix example code use of aetest.NewContext.
Change-Id: I34d58da17a17d89affa9c0b1e1b9c727b4bfb098
| Go | apache-2.0 | golang/appengine,fuchsia-mirror/third_party-github.com-golang-appengine,golang/appengine,fuchsia-mirror/third_party-github.com-golang-appengine |
f5a039f44d4f20e1c50f221532af0977f2fc2ed4 | reflect/types.go | reflect/types.go | package reflect
import (
"github.com/anaminus/rbxmk"
)
func All() []func() rbxmk.Type {
return []func() rbxmk.Type{
Array,
Axes,
BinaryString,
Bool,
BrickColor,
CFrame,
Color3,
Color3uint8,
ColorSequence,
ColorSequenceKeypoint,
Content,
Dictionary,
Double,
Faces,
Float,
Instance,
I... | package reflect
import (
"github.com/anaminus/rbxmk"
)
func All() []func() rbxmk.Type {
return []func() rbxmk.Type{
Array,
Axes,
BinaryString,
Bool,
BrickColor,
CFrame,
Color3,
Color3uint8,
ColorSequence,
ColorSequenceKeypoint,
Content,
Dictionary,
Double,
Faces,
Float,
Instance,
I... | Fix Token not being registered. | Fix Token not being registered.
| Go | mit | Anaminus/rbxmk,Anaminus/rbxmk |
c7039772a09f1b10bd64950446e5c56c45508694 | pkg/health/health.go | pkg/health/health.go | package health
import (
"log"
"net/http"
"os"
)
type HealthChecker struct {
SubPID int
}
//TODO: Add additional health checks
//TODO: add health check if Kubernetes API is still reachable
func (hc HealthChecker) HealthCheckHandler() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Requ... | package health
import (
"net/http"
"os"
log "github.com/F5Networks/k8s-bigip-ctlr/pkg/vlogger"
)
type HealthChecker struct {
SubPID int
}
//TODO: Add additional health checks
//TODO: add health check if Kubernetes API is still reachable
func (hc HealthChecker) HealthCheckHandler() http.Handler {
return http.Ha... | Use vlogger instead of golangs log | Use vlogger instead of golangs log
| Go | apache-2.0 | F5Networks/k8s-bigip-ctlr,sjberman/k8s-bigip-ctlr,michaeldayreads/k8s-bigip-ctlr,sjberman/k8s-bigip-ctlr,F5Networks/k8s-bigip-ctlr,sjberman/k8s-bigip-ctlr,michaeldayreads/k8s-bigip-ctlr,sjberman/k8s-bigip-ctlr,F5Networks/k8s-bigip-ctlr,sjberman/k8s-bigip-ctlr,michaeldayreads/k8s-bigip-ctlr,michaeldayreads/k8s-bigip-ctl... |
4b3466f683b9dd82a9754eeeee16e9584023d6f3 | dwd.go | dwd.go | package main
import "bufio"
import "fmt"
import "encoding/csv"
import "io"
import "os"
func check(err error) {
if err != nil {
panic(err)
}
}
func parse_file(filename string) ([]string, []string, []string) {
f, err := os.Open(filename)
check(err)
defer f.Close()
var column_names []string
var units []string... | package main
import "bufio"
import "gopkg.in/alecthomas/kingpin.v2"
import "fmt"
import "encoding/csv"
import "io"
import "os"
var (
filename = kingpin.Arg("filename", "Filename to load").Required().String()
)
func check(err error) {
if err != nil {
panic(err)
}
}
func parse_file(filename string) ([]string, []... | Add command-line argument to choose filename. | Add command-line argument to choose filename.
| Go | apache-2.0 | wickedchicken/dwd-go |
f4af5ba51a891e96f0478f1af78788956d0c36e6 | btrees/lca.go | btrees/lca.go | // Copyright (c) 2015, Peter Mrekaj. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE.txt file.
package btrees
// findLCA walks the binary tree t and returns lowest common
// ancestor for the nodes n0 and n1. The cnt is 0, 1, or 2
// depending on n... | // Copyright (c) 2015, Peter Mrekaj. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE.txt file.
package btrees
// findLCA walks the binary tree t and returns lowest common
// ancestor for the nodes n0 and n1. The cnt is 0, 1, or 2
// depending on n... | Change the left and right subtree when recurring findLCA | Change the left and right subtree when recurring findLCA
| Go | mit | mrekucci/epi,mrekucci/epi |
fdd631477622bdb475a6078007ea2975b2231175 | docs/storage/layerreader.go | docs/storage/layerreader.go | package storage
import (
"net/http"
"time"
"github.com/docker/distribution"
"github.com/docker/distribution/digest"
)
// layerReader implements Layer and provides facilities for reading and
// seeking.
type layerReader struct {
fileReader
digest digest.Digest
}
var _ distribution.Layer = &layerReader{}
func... | package storage
import (
"net/http"
"time"
"github.com/docker/distribution"
"github.com/docker/distribution/digest"
)
// layerReader implements Layer and provides facilities for reading and
// seeking.
type layerReader struct {
fileReader
digest digest.Digest
}
var _ distribution.Layer = &layerReader{}
func... | Insert request method option storage driver URLFor | Insert request method option storage driver URLFor
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
| Go | apache-2.0 | thaJeztah/distribution,thaJeztah/distribution |
94ac13fd9f4cdc91c70211f97ff4c2c6a78bda66 | meetup/meetup_test.go | meetup/meetup_test.go | // Copyright 2014-2015 Chadev. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package meetup
import (
"os"
"testing"
"time"
)
func TestGetMeetupEvents(t *testing.T) {
if os.Getenv("CHADEV_MEETUP") == "" {
t.Skip("no meetup API key se... | // Copyright 2014-2015 Chadev. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package meetup
import (
"os"
"testing"
)
func TestGetMeetupEvents(t *testing.T) {
if os.Getenv("CHADEV_MEETUP") == "" {
t.Skip("no meetup API key set, skipp... | Fix Meetup API unit test | Fix Meetup API unit test
Signed-off-by: Adam Jimerson <0a1ce5db568b585e24ec79212f7ab30cdb820af8@gmail.com>
| Go | bsd-3-clause | chadev/Chadev_ircbot |
1000990885c356cd1cb1c68b5a944b76a2c0034e | model/characteristic/brightness.go | model/characteristic/brightness.go | package characteristic
type Brightness struct {
*Int
}
func NewBrightness(value int) *Brightness {
integer := NewInt(value, 0, 100, 1, PermsAll())
integer.Unit = UnitPercentage
integer.Type = CharTypeBrightness
return &Brightness{integer}
}
| package characteristic
type Brightness struct {
*Int
}
func NewBrightness(value int) *Brightness {
i := NewInt(value, 0, 100, 1, PermsAll())
i.Unit = UnitPercentage
i.Type = CharTypeBrightness
return &Brightness{i}
}
| Rename integer variable to i | Rename integer variable to i
| Go | apache-2.0 | ninjasphere/hc,mxlje/hc,brutella/hc,savaki/hc,sjfloat/hc,bahlo/hc |
2124089e144c463de7f21fa0540f6cbd66da4af1 | state/remote/state_test.go | state/remote/state_test.go | package remote
import (
"sync"
"testing"
"github.com/hashicorp/terraform/state"
)
func TestState_impl(t *testing.T) {
var _ state.StateReader = new(State)
var _ state.StateWriter = new(State)
var _ state.StatePersister = new(State)
var _ state.StateRefresher = new(State)
var _ state.Locker = new(State)
}
fu... | package remote
import (
"sync"
"testing"
"github.com/hashicorp/terraform/states/statemgr"
)
func TestState_impl(t *testing.T) {
var _ statemgr.Reader = new(State)
var _ statemgr.Writer = new(State)
var _ statemgr.Persister = new(State)
var _ statemgr.Refresher = new(State)
var _ statemgr.Locker = new(State)
... | Switch to statemgr interfaces in test | state/remote: Switch to statemgr interfaces in test
These statemgr interfaces are the new names for the older interfaces in
the "state" package. These types alias each other so it doesn't really
matter which we use, but the "state" package is deprecated and we intend
to eventually remove it, so this is a further step ... | Go | mpl-2.0 | ewbankkit/terraform,heimweh/terraform,pdecat/terraform,pdecat/terraform,hashicorp/terraform,apparentlymart/terraform,ewbankkit/terraform,brandontosch/terraform,nlamirault/terraform,gechr/terraform,apparentlymart/terraform,apparentlymart/terraform,pryorda/terraform,heimweh/terraform,rnaveiras/terraform,pryorda/terraform... |
4ca7c4895f873317efdf03c0ced70ffa322180ed | internal/watcher/watcher.go | internal/watcher/watcher.go | // Copyright 2015 Google Inc. All Rights Reserved.
// This file is available under the Apache license.
// Package watcher provides a way of watching for filesystem events and
// notifying observers when they occur.
package watcher
type OpType int
const (
Create OpType = iota
Update
Delete
)
// Event is a general... | // Copyright 2015 Google Inc. All Rights Reserved.
// This file is available under the Apache license.
// Package watcher provides a way of watching for filesystem events and
// notifying observers when they occur.
package watcher
type OpType int
const (
_ OpType = iota
Create
Update
Delete
)
// Event is a gene... | Change the zero OpType to not be valid. | Change the zero OpType to not be valid.
| Go | apache-2.0 | google/mtail,google/mtail,SuperQ/mtail,SuperQ/mtail |
13b588d4780024f3f95e4864a087696dba24ab6f | infrastructure/datastore/file_storage/file_storage.go | infrastructure/datastore/file_storage/file_storage.go | package file_storage
import (
"github.com/photoshelf/photoshelf-storage/domain/model"
"io/ioutil"
"os"
"path"
)
type FileStorage struct {
baseDir string
}
func NewFileStorage(baseDir string) *FileStorage {
return &FileStorage{baseDir}
}
func (storage *FileStorage) Save(photo model.Photo) (*model.Identifier, e... | package file_storage
import (
"github.com/photoshelf/photoshelf-storage/domain/model"
"io/ioutil"
"os"
"path"
)
type FileStorage struct {
baseDir string
}
func NewFileStorage(baseDir string) *FileStorage {
return &FileStorage{baseDir}
}
func (storage *FileStorage) Save(photo model.Photo) (*model.Identifier, e... | Use ioutil for reduce code line | Use ioutil for reduce code line
| Go | mit | photoshelf/photoshelf-storage |
94a1c4cf2d283dd428ba39836ae3b914b9d51fed | proto/sub/messages.go | proto/sub/messages.go | package sub
import (
"github.com/Symantec/Dominator/lib/filesystem"
"github.com/Symantec/Dominator/lib/hash"
"github.com/Symantec/Dominator/lib/triggers"
"github.com/Symantec/Dominator/proto/common"
"github.com/Symantec/Dominator/sub/scanner"
)
type Configuration struct {
ScanSpeedPercent uint
NetworkSpeedP... | package sub
import (
"github.com/Symantec/Dominator/lib/filesystem"
"github.com/Symantec/Dominator/lib/hash"
"github.com/Symantec/Dominator/lib/triggers"
"github.com/Symantec/Dominator/proto/common"
"github.com/Symantec/Dominator/sub/scanner"
)
type Configuration struct {
ScanSpeedPercent uint
NetworkSpeedP... | Add DirectoriesToChange field to sub.UpdateRequest message. | Add DirectoriesToChange field to sub.UpdateRequest message.
| Go | apache-2.0 | keep94/Dominator,keep94/Dominator,keep94/Dominator,Symantec/Dominator,Symantec/Dominator,rgooch/Dominator,rgooch/Dominator,rgooch/Dominator,Symantec/Dominator |
fbd3b71e4957684e2fe2025ce0495f4d69ca18aa | confusables.go | confusables.go | //go:generate go run maketables.go > tables.go
package confusables
import (
"unicode/utf8"
"golang.org/x/text/unicode/norm"
)
// TODO: document casefolding approaches
// (suggest to force casefold strings; explain how to catch paypal - pAypal)
// TODO: DOC you might want to store the Skeleton and check against it... | //go:generate go run maketables.go > tables.go
package confusables
import (
"bytes"
"golang.org/x/text/unicode/norm"
)
// TODO: document casefolding approaches
// (suggest to force casefold strings; explain how to catch paypal - pAypal)
// TODO: DOC you might want to store the Skeleton and check against it later
... | Improve performance of Skeleton func | Improve performance of Skeleton func
| Go | bsd-3-clause | mtibben/confusables |
ccee01185ebc75db8e3ca0770a02b9b3041ef860 | pkg/app/mcapi.go | pkg/app/mcapi.go | package app
import (
"strings"
"github.com/materials-commons/config"
"github.com/materials-commons/gohandy/ezhttp"
)
type mcapi struct{}
var MCApi mcapi
func (a mcapi) MCUrl() string {
return config.GetString("mcurl")
}
func (a mcapi) MCClient() *ezhttp.EzClient {
mcurl := a.MCUrl()
if strings.HasPrefix(mcu... | package app
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"strings"
"github.com/gtarcea/1DevDayTalk2014/app"
"github.com/materials-commons/config"
"github.com/materials-commons/gohandy/ezhttp"
"gnd.la/net/urlutil"
)
type mcapi struct{}
var MCApi mcapi
func (a mcapi) MCUrl() string {
return config.G... | Add utility functions for dealing with the api. | Add utility functions for dealing with the api.
| Go | mit | materials-commons/mcstore,materials-commons/mcstore,materials-commons/mcstore |
8070bfeb4ec352f45c6337ca342b26ed1f349d0d | traffic_monitor/experimental/traffic_monitor/peer/peer_test.go | traffic_monitor/experimental/traffic_monitor/peer/peer_test.go | package peer
import (
"fmt"
"io/ioutil"
"testing"
)
func TestCrStates(t *testing.T) {
t.Log("Running Peer Tests")
text, err := ioutil.ReadFile("crstates.json")
if err != nil {
t.Log(err)
}
crStates, err := CrStatesUnMarshall(text)
if err != nil {
t.Log(err)
}
fmt.Println(len(crStates.Caches), "caches ... | package peer
import (
"fmt"
"io/ioutil"
"testing"
)
func TestCrStates(t *testing.T) {
t.Log("Running Peer Tests")
text, err := ioutil.ReadFile("crstates.json")
if err != nil {
t.Log(err)
}
crStates, err := CrstatesUnMarshall(text)
if err != nil {
t.Log(err)
}
fmt.Println(len(crStates.Caches), "caches ... | Fix TM2 test to match renamed symbol | Fix TM2 test to match renamed symbol
| Go | apache-2.0 | orifinkelman/incubator-trafficcontrol,amiryesh/incubator-trafficcontrol,amiryesh/incubator-trafficcontrol,knutsel/traffic_control-1,mdb/incubator-trafficcontrol,hbeatty/incubator-trafficcontrol,zhilhuan/incubator-trafficcontrol,mdb/incubator-trafficcontrol,mdb/incubator-trafficcontrol,serDrem/incubator-trafficcontrol,h... |
40b2949f5fc9ce21afbef2f10fb16dd5a12d83fa | cc_messages/lrp_instance.go | cc_messages/lrp_instance.go | package cc_messages
type LRPInstanceState string
const (
LRPInstanceStateStarting LRPInstanceState = "STARTING"
LRPInstanceStateRunning LRPInstanceState = "RUNNING"
LRPInstanceStateCrashed LRPInstanceState = "CRASHED"
LRPInstanceStateUnknown LRPInstanceState = "UNKNOWN"
)
type LRPInstance struct {
ProcessGui... | package cc_messages
import "time"
type LRPInstanceState string
const (
LRPInstanceStateStarting LRPInstanceState = "STARTING"
LRPInstanceStateRunning LRPInstanceState = "RUNNING"
LRPInstanceStateCrashed LRPInstanceState = "CRASHED"
LRPInstanceStateUnknown LRPInstanceState = "UNKNOWN"
)
type LRPInstance struc... | Add new fields to match DEA | Add new fields to match DEA
[#96142924]
| Go | apache-2.0 | cloudfoundry-incubator/runtime-schema |
cb25012908b68435e335e57db0c988ea33179032 | main.go | main.go | package main
import (
"bufio"
"fmt"
"os"
"regexp"
)
func main() {
file, err := os.Open("targetlist.txt")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer file.Close()
scanner := bufio.NewScanner(file)
r, _ := regexp.Compile("https?://(www.)?[a-zA-Z0-9.]{2,512}.[a-z]{2,10}")
for scanner.Scan() ... | package main
import (
"bufio"
"fmt"
"os"
"regexp"
"net/http"
"io/ioutil"
"strings"
)
func check(e error) {
if e != nil {
panic(e)
}
}
// Request webcontent from url
func Webrequest(url string) string {
resp, err := http.Get(url)
if err != nil {
fmt.Println(err)
}
defer resp.Body.Close()
body,... | Make HTTP request and save to file | Make HTTP request and save to file
| Go | bsd-3-clause | yorickdewid/gocraw,yorickdewid/gocraw |
d733db274330fc10b378c402cad2d53f51cfcc8d | completer.go | completer.go | package ishell
import "strings"
type iCompleter struct {
cmd *Cmd
}
func (ic iCompleter) Do(line []rune, pos int) (newLine [][]rune, length int) {
words := strings.Fields(string(line))
var cWords []string
prefix := ""
if len(words) > 0 && line[pos-1] != ' ' {
prefix = words[len(words)-1]
cWords = ic.getWord... | package ishell
import "strings"
type iCompleter struct {
cmd *Cmd
}
func (ic iCompleter) Do(line []rune, pos int) (newLine [][]rune, length int) {
words := strings.Fields(string(line))
var cWords []string
prefix := ""
if len(words) > 0 && line[pos-1] != ' ' {
prefix = words[len(words)-1]
cWords = ic.getWord... | Add space on tab with no suggestion | Add space on tab with no suggestion
| Go | mit | abiosoft/ishell |
4b78ef32bcc81ab9949f873779f8775c5ed0e0df | simple-polling.go | simple-polling.go | package hello
import (
"fmt"
"net/http"
)
func init() {
http.HandleFunc("/", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, world!")
}
| package polling
import (
"fmt"
"net/http"
)
func init() {
http.HandleFunc("/", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "Hello, world!")
}
| Change of the package name | Change of the package name
| Go | apache-2.0 | owulveryck/google-app-example |
9208e8ab935914b6daaea10bfdf7f75386109b8d | state/factory_test.go | state/factory_test.go | package state
import (
"fmt"
"testing"
)
var simpleFile = []byte(`
{"path": "/tmp/no-exist", "mode": 644}
`)
var simpleFileMeta = Metadata{
Name: "Simple File",
Type: "file",
State: "rendered",
}
func TestStateFactory(t *testing.T) {
state, err := StateFactory(simpleFileMeta, simpleFile)
if err != nil {
fm... | package state
import (
"fmt"
"testing"
)
var simpleFile = []byte(`
{"path": "/tmp/no-exist", "mode": 644, "source": "git:///git@github.com:vektorlab/otter/README.md"}
`)
var simpleFileMeta = Metadata{
Name: "Simple File",
Type: "file",
State: "rendered",
}
func TestStateFactory(t *testing.T) {
state, err := S... | Add source to simpleFile test | Add source to simpleFile test
| Go | mit | vektorlab/otter,vektorlab/otter,vektorlab/otter |
f06c3c212042ec7f2be2388796a068aad7d1dda3 | gitbucket/repos.go | gitbucket/repos.go | package gitbucket
import (
"fmt"
"net/http"
)
type RepositoriesService struct {
client *Client
}
// Repository represents a API user.
type Repository struct {
Name *string `json:"name"`
FullName *string `json:"full_name"`
Description *string `json:"description"`
Watchers *int `json:"wa... | package gitbucket
import (
"fmt"
"net/http"
)
type RepositoriesService struct {
client *Client
}
// Repository represents a API user.
type Repository struct {
Name *string `json:"name"`
FullName *string `json:"full_name"`
Description *string `json:"description"`
Watchers *int `json:"wa... | Update field name in the JSON. | Update field name in the JSON.
see https://github.com/takezoe/gitbucket/pull/884
| Go | mit | shiena/go-gitbucket |
8da03b29850d4ccf120fae97a202ab7b44474150 | v1/cmd/filter/main.go | v1/cmd/filter/main.go | package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"github.com/mgutz/logxi/v1"
)
func sendExternal(obj map[string]interface{}) {
// normally you would send this to an external service like InfluxDB
// or some logging framework. Let's filter out some data.
fmt.Printf("Time: %s Level: %s Message: %... | package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"github.com/mgutz/logxi/v1"
)
func sendExternal(obj map[string]interface{}) {
// normally you would send this to an external service like InfluxDB
// or some logging framework. Let's filter out some data.
fmt.Printf("Time: %s Level: %s Message: %... | Change filter example to use KeyMap | Change filter example to use KeyMap
| Go | mit | mgutz/logxi |
094fbdfe85e6366606f8f8c851876ec50de2ab2f | object/network_reference.go | object/network_reference.go | /*
Copyright (c) 2014 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | /*
Copyright (c) 2014 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed t... | Embed Reference interface in NetworkReference | Embed Reference interface in NetworkReference
| Go | apache-2.0 | l1jiang/govmomi,cgtexmex/govmomi,bruceadowns/govmomi,dougm/govmomi,kristinn/govmomi,mevansam/vsphere-govmomi,mevansam/vsphere-govmomi,dougm/govmomi,RotatingFans/govmomi,l1jiang/govmomi,l1jiang/govmomi,jrmycanady/govmomi,vmware/govmomi,vmware/govmomi,bruceadowns/govmomi,caglar10ur/govmomi,mevansam/vsphere-govmomi,ilikej... |
a70f61974c8ee15716a768ab436aa8c8ee41bd66 | internal/flags/flags_test.go | internal/flags/flags_test.go | package flags
import (
"os"
"testing"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestEnvConfig_Defaults(t *testing.T) {
cmd := new(cobra.Command)
SetDefaults()
RegisterDockerFlags(cmd)
err := EnvConfig(cmd)
require.NoError(t, err)
assert.Eq... | package flags
import (
"os"
"testing"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestEnvConfig_Defaults(t *testing.T) {
cmd := new(cobra.Command)
SetDefaults()
RegisterDockerFlags(cmd)
err := EnvConfig(cmd)
require.NoError(t, err)
assert.Eq... | Comment out test that is incompatible with CircleCI | Comment out test that is incompatible with CircleCI
| Go | apache-2.0 | v2tec/watchtower,v2tec/watchtower |
e80f713e08300c02f93c3cfda9f7d3d0cb608cbf | models/roaster.go | models/roaster.go | package models
import (
"database/sql"
"github.com/pborman/uuid"
"github.com/stripe/stripe-go"
)
/*Roaster has information retrieved from stripe and the db
about billing for roaster entities*/
type Roaster struct {
//ID is the roaster ID in towncenter
ID uuid.UUID `json:"id"`
AccountID string ... | package models
import (
"database/sql"
"github.com/pborman/uuid"
"github.com/stripe/stripe-go"
)
/*Roaster has information retrieved from stripe and the db
about billing for roaster entities*/
type Roaster struct {
//ID is the roaster ID in towncenter
ID uuid.UUID `json:"id"`
AccountID string ... | Remove new account id generation | Remove new account id generation
| Go | mit | ghmeier/coinage,ghmeier/coinage |
c2f27b18a3d94298083d8a2dce491b883fe227aa | users.go | users.go | /*
* Datadog API for Go
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
*/
package datadog
import (
"errors"
)
// reqInviteUsers contains email addresses to send invitations to.
type reqInviteUsers struct {
Emails []string `json:"emails"`
}
... | /*
* Datadog API for Go
*
* Please see the included LICENSE file for licensing information.
*
* Copyright 2013 by authors and contributors.
*/
package datadog
// reqInviteUsers contains email addresses to send invitations to.
type reqInviteUsers struct {
Emails []string `json:"emails"`
}
// InviteUsers takes ... | Implement the user invitation method | Implement the user invitation method
Now I have the endpoint, now this should work.
| Go | bsd-3-clause | DataDog/go-datadog-api,seiffert/go-datadog-api,ojongerius/go-datadog-api,zorkian/go-datadog-api,zorkian/go-datadog-api |
4356e288fb9e4c79b42ea0f5d9b4b1e484b2057f | utils.go | utils.go | package main // import "eriol.xyz/piken"
import (
"io"
"net/http"
"os"
"github.com/Sirupsen/logrus"
"github.com/mitchellh/go-homedir"
)
func download(url, output string) error {
r, err := http.Get(url)
if err != nil {
return err
}
defer r.Body.Close()
out, err := os.Create(output)
if err != nil {
re... | package main // import "eriol.xyz/piken"
import (
"encoding/csv"
"io"
"net/http"
"os"
"github.com/Sirupsen/logrus"
"github.com/mitchellh/go-homedir"
)
func download(url, output string) error {
r, err := http.Get(url)
if err != nil {
return err
}
defer r.Body.Close()
out, err := os.Create(output)
if e... | Read a CSV file and return a slice of slice | Read a CSV file and return a slice of slice
| Go | bsd-3-clause | eriol/piken |
d242ab9b1479a6aebe8e5cbd6b6ae48fb845f950 | pg2librato.go | pg2librato.go | package main
func main() {
Log("main.start")
queryInterval := QueryInterval()
databaseUrl := DatabaseUrl()
libratoAuth := LibratoAuth()
queryFiles := ReadQueryFiles("./queries/*.sql")
metricBatches := make(chan []interface{}, 10)
queryTicks := make(chan QueryFile, 10)
globalStop := make(chan bool)
monitorSt... | package main
func main() {
Log("main.start")
databaseUrl := DatabaseUrl()
libratoAuth := LibratoAuth()
queryInterval := QueryInterval()
queryTimeout := queryInterval
queryFiles := ReadQueryFiles("./queries/*.sql")
metricBatches := make(chan []interface{}, 10)
queryTicks := make(chan QueryFile, 10)
globalSto... | Make timeout config more explicit | Make timeout config more explicit
| Go | mit | mmcgrana/pg2librato |
772aff99a91161cae47caa031c7c6dedafce9a83 | osutil_windows.go | osutil_windows.go | // Copyright 2013 Chris McGee <sirnewton_01@yahoo.ca>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build windows
package gdblib
import (
"go/build"
"os"
"os/exec"
"path/filepath"
"strings"
)
var (
sendSignalPath string
)
fun... | // Copyright 2013 Chris McGee <sirnewton_01@yahoo.ca>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build windows
package gdblib
import (
"go/build"
"os"
"os/exec"
"path/filepath"
"strings"
)
var (
sendSignalPath string
)
fun... | Convert ListSeparator into a string to use in Split. | Convert ListSeparator into a string to use in Split.
| Go | bsd-2-clause | albfan/gdblib,sirnewton01/gdblib |
2d2ec43ef2e47a2645b15c99a72758d5ebe6721b | paths_test.go | paths_test.go | // Copyright (C) 2017 Damon Revoe. All rights reserved.
// Use of this source code is governed by the MIT
// license, which can be found in the LICENSE file.
package main
import (
"strings"
"testing"
)
func substTestCase(t *testing.T, node *verbatim, expected string) {
var result string
for {
result += node.t... | // Copyright (C) 2017 Damon Revoe. All rights reserved.
// Use of this source code is governed by the MIT
// license, which can be found in the LICENSE file.
package main
import (
"fmt"
"strings"
"testing"
)
func substTestCase(t *testing.T, node *verbatim, expected string) {
var result string
for {
result +=... | Add a Println-based test of expandPathnameTemplate | Add a Println-based test of expandPathnameTemplate
| Go | mit | revl/autoforge |
6cf355fb611ecbaabb7db956ec152624dc841141 | hcl.go | hcl.go | // hcl is a package for decoding HCL into usable Go structures.
//
// hcl input can come in either pure HCL format or JSON format.
// It can be parsed into an AST, and then decoded into a structure,
// or it can be decoded directly from a string into a structure.
//
// If you choose to parse HCL into a raw AST, the ben... | // Package hcl decodes HCL into usable Go structures.
//
// hcl input can come in either pure HCL format or JSON format.
// It can be parsed into an AST, and then decoded into a structure,
// or it can be decoded directly from a string into a structure.
//
// If you choose to parse HCL into a raw AST, the benefit is th... | Use Go convention of docs with "Package" prefix | Use Go convention of docs with "Package" prefix
| Go | mpl-2.0 | strivecast/hcl,strivecast/hcl,hashicorp/hcl,hashicorp/hcl,hashicorp/hcl,hashicorp/hcl,hashicorp/hcl,savaki/hcl,KONTRAKT-DLL/hcl,strivecast/hcl,strivecast/hcl,strivecast/hcl |
cf440052ef862fdc929cac8f757963aea47c3ee4 | luciexe/invoke/terminate_unix.go | luciexe/invoke/terminate_unix.go | // Copyright 2020 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... | // Copyright 2020 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... | Make and signal process group on *nix. | [bbagent] Make and signal process group on *nix.
This should enable bootstrapper-based builds to cancel correctly.
R=chanli, yiwzhang
Change-Id: I786a527a1023c58d79805aaf19fac5d7cd085886
Reviewed-on: https://chromium-review.googlesource.com/c/infra/luci/luci-go/+/3340242
Auto-Submit: Robbie Iannucci <40f3d43a28ebae3... | Go | apache-2.0 | luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go |
37c7fb771a7127467932ec3da0873bc762fd2916 | lib/msg/supervisor.go | lib/msg/supervisor.go | /*-
* Copyright (c) 2016, Jörg Pernfuß <joerg.pernfuss@1und1.de>
* All rights reserved
*
* Use of this source code is governed by a 2-clause BSD license
* that can be found in the LICENSE file.
*/
package msg
import (
)
type Supervisor struct {
Verdict uint16
RemoteAddr string
// Fields for encrypted req... | /*-
* Copyright (c) 2016, Jörg Pernfuß <joerg.pernfuss@1und1.de>
* All rights reserved
*
* Use of this source code is governed by a 2-clause BSD license
* that can be found in the LICENSE file.
*/
package msg
import (
)
type Supervisor struct {
Verdict uint16
VerictAdmin bool
RemoteAddr string
// Fiel... | Add field to indicate admin permission | Add field to indicate admin permission
| Go | bsd-2-clause | 1and1/soma |
b0fac61f1787ca6eb4988c5ca0141d3266398a57 | local.go | local.go | package main
import (
"github.com/phalaaxx/cdb"
)
/* VerifyLocal checks if named mailbox exist in a local cdb database */
func VerifyLocal(name string) bool {
var value *string
err := cdb.Lookup(
LocalCdb,
func(db *cdb.Reader) (err error) {
value, err = db.Get(name)
return err
},
)
if err == nil && v... | package main
import (
"github.com/phalaaxx/godb"
)
/* VerifyLocal checks if named mailbox exist in a local cdb database */
func VerifyLocal(name string) bool {
var value *string
err := godb.CdbLookup(
LocalCdb,
func(db *godb.CdbReader) (err error) {
value, err = db.Get(name)
return err
},
)
if err ==... | Use godb library instead of cdb. | Use godb library instead of cdb.
| Go | bsd-2-clause | phalaaxx/ratemilter |
77aa5c02fef055b7d1b75db85331c2c6cbe17e78 | pachyderm.go | pachyderm.go | package pachyderm
import "go.pedge.io/proto/version"
const (
// MajorVersion is the current major version for pachyderm.
MajorVersion = 0
// MinorVersion is the current minor version for pachyderm.
MinorVersion = 10
// MicroVersion is the current micro version for pachyderm.
MicroVersion = 0
// AdditionalVersi... | package pachyderm
import "go.pedge.io/proto/version"
const (
// MajorVersion is the current major version for pachyderm.
MajorVersion = 0
// MinorVersion is the current minor version for pachyderm.
MinorVersion = 10
// MicroVersion is the current micro version for pachyderm.
MicroVersion = 0
// AdditionalVersi... | Bump additional version to RC1. | Bump additional version to RC1.
| Go | apache-2.0 | pachyderm/pfs,pachyderm/pfs,pachyderm/pfs |
49a8b381177d46149c75210d3990b4e381bded6e | wcserver/main.go | wcserver/main.go | package main
import (
"flag"
"log"
"net/http"
"github.com/billhathaway/webcounter"
)
const (
defaultPort = "8080"
)
func main() {
port := flag.String("p", defaultPort, "listen port")
flag.Parse()
counter, err := webcounter.New()
if err != nil {
log.Fatal(err)
}
http.ListenAndServe(":"+*port, counter)
}... | package main
import (
"flag"
"log"
"net/http"
_ "net/http/pprof"
"github.com/billhathaway/webcounter"
)
const (
defaultPort = "8080"
)
func main() {
port := flag.String("p", defaultPort, "listen port")
pprofPort := flag.String("pprof", "", "listen port for profiling")
flag.Parse()
counter, err := webcount... | Add -pprof flag to enable profiling | Add -pprof flag to enable profiling
| Go | apache-2.0 | billhathaway/webcounter |
4def0dfd5b3cb6a47b46798f5a660c33edd1c519 | of10/port.go | of10/port.go | package of10
import (
"bytes"
"encoding/binary"
)
const MaxPortNameLength = 16
const EthernetAddressLength = 6
type PortNumber uint16
type PortConfig uint16
type PortState uint16
type PortFeature uint16
type PhysicalPort struct {
PortNumber PortNumber
HardwareAddress [EthernetAddressLength]uint8
Nam... | package of10
import (
"bytes"
"encoding/binary"
)
const MaxPortNameLength = 16
const EthernetAddressLength = 6
type PortNumber uint16
type PortConfig uint16
type PortState uint16
type PortFeature uint16
type PhysicalPort struct {
PortNumber PortNumber
HardwareAddress [EthernetAddressLength]uint8
Nam... | Fix wrong slice length in initialization | Fix wrong slice length in initialization
| Go | mit | oshothebig/goflow |
b2e639cf10840f7f423406a100ea9ef52e45b6f6 | cmd/mangadownloader.go | cmd/mangadownloader.go | package main
import (
"fmt"
"github.com/pierrre/mangadownloader"
)
func main() {
var service mangadownloader.Service = &mangadownloader.MangaReaderService{}
mangas, err := service.Mangas()
if err != nil {
panic(err)
}
for _, manga := range mangas {
fmt.Println(manga)
chapters, err := manga.Chapters()
i... | package main
import (
"fmt"
"github.com/pierrre/mangadownloader"
)
func main() {
var service mangadownloader.Service = &mangadownloader.MangaReaderService{}
mangas, err := service.Mangas()
if err != nil {
panic(err)
}
for _, manga := range mangas {
fmt.Println(manga)
chapters, err := manga.Chapters()
i... | Add formatting in test command | Add formatting in test command
| Go | mit | pierrre/mangadownloader |
59258b73f783d447d98711fe6dd6e75bf584d960 | tfbootstrap/src/github.com/bdastur/templates/templates.go | tfbootstrap/src/github.com/bdastur/templates/templates.go | package templates
const (
/* Provider template */
providerTemplate = `
provider "aws" {
region = "{{ .Region }}"
profile = "{{ .Account }}"
}
`
/* Terraform Backend */
backendTemplate = `
terraform {
required_version = ">= v0.11.7"
backend "s3" {
region = "{{ .Region }}"
profile = "{{ .Account }}"... | package templates
const (
/* Provider template */
providerTemplate = `
provider "aws" {
region = "{{ .Region }}"
profile = "{{ .Account }}"
}
`
/* Terraform Backend */
backendTemplate = `
terraform {
required_version = ">= v0.11.7"
backend "s3" {
region = "{{ .Region }}"
profile = "{{ .Account }}"... | Add S3 backend - dynamodb for lock | Add S3 backend - dynamodb for lock
| Go | apache-2.0 | bdastur/utils,bdastur/utils,bdastur/utils,bdastur/utils,bdastur/utils |
d7eb8482fb15bde116b582c29e1a9437fcea4971 | pkg/instance/posix.go | pkg/instance/posix.go | // +build linux darwin
package instance
// DirName returns the name of the subdirectory where instance data are stored.
// On Posix systems, it's the instance domain name.
func (i *Instance) DirName() string {
return i.Domain
}
| // +build !windows
package instance
// DirName returns the name of the subdirectory where instance data are stored.
// On Posix systems, it's the instance domain name.
func (i *Instance) DirName() string {
return i.Domain
}
| Fix building cozy-stack on FreeBSD, again | Fix building cozy-stack on FreeBSD, again
Fix needed with the one from #1046 | Go | agpl-3.0 | nono/cozy-stack,nono/cozy-stack,nono/cozy-stack,nono/cozy-stack,nono/cozy-stack |
a1da9e57f687d5dce047bd64b80aea4e6e861570 | stove.go | stove.go | package main
import (
"flag"
"fmt"
"github.com/HearthSim/stove/bnet"
"github.com/HearthSim/stove/pegasus"
_ "github.com/mattn/go-sqlite3"
"strings"
)
const (
CONN_DEFAULT_HOST = "localhost"
CONN_DEFAULT_PORT = 1119
)
func main() {
addr := fmt.Sprintf("%s:%d", CONN_DEFAULT_HOST, CONN_DEFAULT_PORT)
flag.Stri... | package main
import (
"flag"
"fmt"
"github.com/HearthSim/stove/bnet"
"github.com/HearthSim/stove/pegasus"
_ "github.com/rakyll/gom/http"
"net/http"
"strings"
)
const (
CONN_DEFAULT_HOST = "localhost"
CONN_DEFAULT_PORT = 1119
)
func main() {
addr := fmt.Sprintf("%s:%d", CONN_DEFAULT_HOST, CONN_DEFAULT_PORT)... | Add pprof server and gom support | Add pprof server and gom support
| Go | agpl-3.0 | oftc-ftw/stove,oftc-ftw/stove,synap5e/stove,synap5e/stove,oftc-ftw/stove,synap5e/stove |
30e546432dac60a1497e4ada1c52b57e96b856b1 | lib/filegen/httpd/status.go | lib/filegen/httpd/status.go | package httpd
import (
"bufio"
"fmt"
"github.com/Symantec/Dominator/lib/html"
"net/http"
)
func (s *state) statusHandler(w http.ResponseWriter, req *http.Request) {
writer := bufio.NewWriter(w)
defer writer.Flush()
fmt.Fprintln(writer, "<title>Basic filegen server status page</title>")
fmt.Fprintln(writer, "<... | package httpd
import (
"bufio"
"fmt"
"github.com/Symantec/Dominator/lib/html"
"github.com/Symantec/Dominator/lib/srpc"
"net/http"
)
func (s *state) statusHandler(w http.ResponseWriter, req *http.Request) {
writer := bufio.NewWriter(w)
defer writer.Flush()
fmt.Fprintln(writer, "<title>Basic filegen server stat... | Add warning banner to filegen HTTP server if in insecure mode. | Add warning banner to filegen HTTP server if in insecure mode.
| Go | apache-2.0 | rgooch/Dominator,rgooch/Dominator,keep94/Dominator,Symantec/Dominator,keep94/Dominator,rgooch/Dominator,Symantec/Dominator,Symantec/Dominator,keep94/Dominator |
14e2f48cd7611d9fdbfbbc77118cb732a1a0b557 | vcl/api/dylib_nontempdll.go | vcl/api/dylib_nontempdll.go | //----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
// +build windows linux
// +build !tempdll
// +build !memorydll
// 指令为:target == windows || target == linux && !tempdll && !memorydll
package... | //----------------------------------------
//
// Copyright © ying32. All Rights Reserved.
//
// Licensed under Apache License 2.0
//
//----------------------------------------
// +build !tempdll
// +build !memorydll
// 指令为:!tempdll && !memorydll
package api
func checkAndReleaseDLL() (bool, string) {
return false, ... | Fix the error of `tempdll` constraint under macOS | Fix the error of `tempdll` constraint under macOS
| Go | apache-2.0 | ying32/govcl |
3581d8b25c9237bcd81004b0b7853423f2d8cbea | cf/command/command.go | cf/command/command.go | package command
import (
"github.com/cloudfoundry/cli/cf/command_metadata"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/codegangsta/cli"
)
type Command interface {
Metadata() command_metadata.CommandMetadata
GetRequirements(requirementsFactory requirements.Factory, c *cli.Context) (reqs []requiremen... | package command
import (
"github.com/cloudfoundry/cli/cf/command_metadata"
"github.com/cloudfoundry/cli/cf/requirements"
"github.com/codegangsta/cli"
)
type Command interface {
Metadata() command_metadata.CommandMetadata
GetRequirements(requirementsFactory requirements.Factory, context *cli.Context) (reqs []requ... | Rename some variables on Command interface | Rename some variables on Command interface
Single letter variable names! Not on my watch!
| Go | apache-2.0 | cloudfoundry/cli,cloudfoundry/cli,cloudfoundry/cli |
8d76955b45ff48ae33af6890960110a552c55f9a | source_mapper/waneloS3/mapper.go | source_mapper/waneloS3/mapper.go | package mapper
import (
"fmt"
"github.com/wanelo/image-server/core"
"github.com/wanelo/image-server/encoders/base62"
)
type SourceMapper struct {
ServerConfiguration *core.ServerConfiguration
}
// RemoteImageURL returns a URL string for original image
func (m *SourceMapper) RemoteImageURL(ic *core.ImageConfigur... | package mapper
import (
"fmt"
"github.com/wanelo/image-server/core"
"github.com/wanelo/image-server/encoders/base62"
)
type SourceMapper struct {
ServerConfiguration *core.ServerConfiguration
}
// RemoteImageURL returns a URL string for original image
func (m *SourceMapper) RemoteImageURL(ic *core.ImageConfigur... | Use real image id, instead of placeholder base62 string, oops! | Use real image id, instead of placeholder base62 string, oops! | Go | mit | wanelo/image-server,image-server/image-server,wanelo/image-server,image-server/image-server,image-server/image-server |
245d299b4d56287925324dba0e1607cbf3103ce0 | tokengen.go | tokengen.go | package osin
import (
"encoding/base64"
"strings"
"github.com/satori/go.uuid"
)
// AuthorizeTokenGenDefault is the default authorization token generator
type AuthorizeTokenGenDefault struct {
}
func removePadding(token string) string {
return strings.TrimRight(token, "=")
}
// GenerateAuthorizeToken generates ... | package osin
import (
"encoding/base64"
"strings"
"github.com/pborman/uuid"
)
// AuthorizeTokenGenDefault is the default authorization token generator
type AuthorizeTokenGenDefault struct {
}
func removePadding(token string) string {
return strings.TrimRight(token, "=")
}
// GenerateAuthorizeToken generates a ... | Switch uuid to original implementation | Switch uuid to original implementation
The original code.google.com go-uuid package has now been migrated to github by Paul Borman, a Googler and a Golang core contributor. | Go | bsd-3-clause | liggitt/osin,Iceyer/osin,gpndata/osin,airondumael/osin,DejaMi/osin,observadorpt/osin,lancecarlson/osin,go-osin/osin,jonnyreeves/osin,girirajsharma/osin,oyediyildiz/osin,gogap/oauth2,ahmet/osin,agtorre/osin,hoysoft/osin,Inflatablewoman/osin,RangelReale/osin,helojo/osin |
5224e2f04ebbc5220b0f66b70affe592b69d20cd | s3/auth/signer.go | s3/auth/signer.go | // Copyright 2012 Aaron Jacobs. All Rights Reserved.
// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licen... | // Copyright 2012 Aaron Jacobs. All Rights Reserved.
// Author: aaronjjacobs@gmail.com (Aaron Jacobs)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licen... | Split out a helper function. | Split out a helper function.
| Go | apache-2.0 | jacobsa/aws |
1af71d9558e7ed102f1daf97fa14f13196fe4c72 | overview.go | overview.go | //
// openzwave provides a thin Go wrapper around the openzwave library.
//
// The following shows a simple use of the API which will log every notification received.
//
// var loop = func(api openzwave.API) {
// fmt.Printf("event loop starts\n")
// for {
// s... | //
// openzwave provides a thin Go wrapper around the openzwave library.
//
// The following shows a simple use of the API which will log every notification received.
//
// var loop = func(api openzwave.API) {
// fmt.Printf("event loop starts\n")
// for {
// s... | Remove misleading example - api.Notifications() was removed from the API in favour of a callback. | Remove misleading example - api.Notifications() was removed from the API in favour of a callback.
(We need processing associated with the callback to be complete by the time the callback completes.
Use of a channel would require that we copy the C notification into the Go heap on every notification and
I didn't want t... | Go | mit | ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave,ninjasphere/go-openzwave |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.