CombinedText
stringlengths
4
3.42M
package config import ( "encoding/base64" "fmt" "os" "strings" "github.com/dokku/dokku/plugins/common" ) //CommandShow implementes config:show func CommandShow(args []string, global bool, shell bool, export bool, merged bool) { appName, _ := getCommonArgs(global, args) env := getEnvironment(appName, merged) ...
package login import ( "crypto/md5" "crypto/rsa" "crypto/sha256" "encoding/base64" "encoding/hex" "encoding/json" "errors" "fmt" "net/http" "net/url" "regexp" "strconv" errs "github.com/pkg/errors" "github.com/almighty/almighty-core/account" "github.com/almighty/almighty-core/app" "github.com/almight...
package models import ( "os/exec" "github.com/sai-lab/mouryou/lib/check" ) type LoadBalancerStruct struct { VirtualIP string `json:"virtual_ip"` Algorithm string `json:"algorithm"` ThresholdOut float64 `json:"threshold_out"` ThresholdIn float64 `json:"threshold_in"` Margin float64 `json:"margin...
// Copyright 2017 The go-vm Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package fusion import "github.com/go-vm/vmware" const app = "fusion" // Start start a VM or Team. func Start(vmwarevm string, gui bool) error { cmd := vm...
package gologspace import( "github.com/stretchr/testify/assert" "fmt" "testing" ) const( Angstrom = 1E-10 ) func BenchmarkLogSpaceAdd(b *testing.B) { s := LogSpace{} b.ResetTimer() for i := 0; i < b.N; i++ { a := s.Enter(float64(i)) s.Add(a, a) } } func BenchmarkLogSpaceSub(b *testing.B) { s := LogSpac...
package main import ( "fmt" "io/ioutil" "log" "os" "path" "sort" "time" "runtime/pprof" "github.com/phil-mansfield/table" "github.com/phil-mansfield/gotetra/render/io" "github.com/phil-mansfield/gotetra/render/halo" rGeom "github.com/phil-mansfield/gotetra/render/geom" "github.com/phil-mansfield/gotetr...
package main import ( "archive/tar" "bytes" "crypto/rand" "database/sql" "encoding/json" "fmt" "io" "io/ioutil" "math/big" "net" "os" "os/exec" "path" "path/filepath" "reflect" "regexp" "sort" "strings" "syscall" "time" "gopkg.in/flosch/pongo2.v3" "gopkg.in/lxc/go-lxc.v2" "gopkg.in/yaml.v2" "...
module.Module 不再对 json 等提供直接支持。
// Copyright 2015 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License...
package main import ( "fmt" "os" "testing" ) var exitCode int func Test_main(t *testing.T) { fmt.Println("aqui test_____main") go main() exitCode = <-exitCh } func TestMain(m *testing.M) { fmt.Println("maiiiiiii") m.Run() // can exit because cover profile is already written os.Exit(exitCode) } modified:...
package main import ( "encoding/json" "flag" "fmt" "log" "os" "strings" "time" "h12.me/kafka/broker" ) const ( clientID = "h12.me/kafka/kafpro" ) type Config struct { Broker string Meta MetaConfig Coord CoordConfig Offset OffsetConfig Commit CommitConfig Time TimeConfig Consume ConsumeCon...
Introduced constants for the item types
refactored stmts into two groups and completed for loop parsing
cleanup people/cypher.go
// Copyright 2018 by caixw, All rights reserved. // Use of this source code is governed by a MIT // license that can be found in the LICENSE file. package sqlbuilder import ( "context" "database/sql" ) var ( _ execPreparer = &DeleteStmt{} _ execPreparer = &UpdateStmt{} _ execPreparer = &InsertStmt{} _ execPrep...
/* Taken from the Go Tour (Exercise: Web Crawler) * * In this exercise you'll use Go's concurrency features to parallelize a web crawler. * * Modify the Crawl function to fetch URLs in parallel without fetching the same URL twice. * */ package main import ( "fmt" ) type Fetcher interface { Fetch(url string) ...
package game import ( "image/color" "golang.org/x/image/font" "github.com/Bredgren/game1/game/camera" "github.com/Bredgren/game1/game/keymap" "github.com/Bredgren/game1/game/keymap/button" "github.com/Bredgren/geo" "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/text" ) type keyLabel struct {...
package game import ( "fmt" "image/color" "log" "time" "golang.org/x/image/font/basicfont" "github.com/Bredgren/game1/game/camera" "github.com/Bredgren/game1/game/keymap" "github.com/Bredgren/game1/game/keymap/button" "github.com/Bredgren/game1/game/ui" "github.com/Bredgren/geo" "github.com/hajimehoshi/eb...
package clusters import ( "fmt" "os" "strconv" "strings" "time" oclient "github.com/openshift/origin/pkg/client" ocon "github.com/radanalyticsio/oshinko-core/clusters/containers" odc "github.com/radanalyticsio/oshinko-core/clusters/deploymentconfigs" opt "github.com/radanalyticsio/oshinko-core/clusters/podte...
package main import ( "context" "net/http" _ "net/http/pprof" "os" "runtime" "strings" "time" "cloud.google.com/go/logging" "github.com/cloudfoundry-community/go-cfclient" "github.com/cloudfoundry-community/stackdriver-tools/src/stackdriver-nozzle/cloudfoundry" "github.com/cloudfoundry-community/stackdrive...
// Copyright 2015 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 contains the list set-like primitive functions. ...
/* Copyright 2017 The Kubernetes 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 to in writing, ...
/* Copyright 2019 The Knative 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 to in writing, soft...
package migrations import . "github.com/grafana/grafana/pkg/services/sqlstore/migrator" func addDashboardSnapshotMigrations(mg *Migrator) { snapshotV4 := Table{ Name: "dashboard_snapshot", Columns: []*Column{ {Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true}, {Name: "name", Type: DB_...
package component import ( "github.com/jcelliott/lumber" "github.com/nanobox-io/golang-docker-client" "github.com/nanobox-io/nanobox/models" "github.com/nanobox-io/nanobox/util" "github.com/nanobox-io/nanobox/util/display" ) // Clean purges any components in a dirty or incomplete state func Clean(appModel *mode...
// Copyright (c) Microsoft Open Technologies, Inc. // All Rights Reserved. // Licensed under the Apache License, Version 2.0. // See License.txt in the project root for license information. package driver_restapi import ( "bytes" "crypto/md5" "encoding/base64" "encoding/xml" "fmt" "github.com/MSOpenTech/packer-a...
// Copyright 2013 bee 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 to in ...
package irc import ( "bytes" "strings" "testing" ) func s2b(s string) []byte { return []byte(s) } var messageTests = [...]*struct { rawMsg string parsed *Msg hostmask bool server bool }{ { ":syrk!kalt@millennium.stealth.net QUIT :Gone to have lunch", &Msg{cmd: s2b("QUIT"), trailing: s2b("Gone t...
package main import "fmt" import "os" import "net/http" import "io/ioutil" import "log" import "github.com/moovweb/gokogiri" import "github.com/moovweb/gokogiri/xml" import "github.com/moovweb/gokogiri/xpath" import "github.com/codegangsta/cli" func load(url string, fromFile bool) *xml.XmlDocument{ var data []byte...
package clusterprovisioner import ( "context" "fmt" "net/url" "path" "reflect" "sort" "strings" "time" "github.com/mitchellh/mapstructure" "github.com/rancher/kontainer-engine/drivers/rke" "github.com/rancher/kontainer-engine/service" "github.com/rancher/norman/controller" "github.com/rancher/norman/type...
package machineprovision import ( "fmt" "regexp" "sort" "strings" rkev1 "github.com/rancher/rancher/pkg/apis/rke.cattle.io/v1" "github.com/rancher/rancher/pkg/settings" "github.com/rancher/wrangler/pkg/data" "github.com/rancher/wrangler/pkg/generic" name2 "github.com/rancher/wrangler/pkg/name" corev1 "k8s.i...
/* Copyright 2019 The Tekton 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 to in writing, soft...
package filesys import ( "context" "github.com/seaweedfs/fuse" "github.com/seaweedfs/fuse/fs" "github.com/chrislusf/seaweedfs/weed/glog" "github.com/chrislusf/seaweedfs/weed/pb/filer_pb" "github.com/chrislusf/seaweedfs/weed/util" ) func (dir *Dir) Rename(ctx context.Context, req *fuse.RenameRequest, newDirect...
package objects import ( "log" "github.com/godbus/dbus" "github.com/godbus/dbus/prop" "github.com/muka/device-manager/api" ) // NewDeviceManager initialize a new DeviceManager object func NewDeviceManager() *DeviceManager { d := DeviceManager{} d.Devices = []dbus.ObjectPath{} d.path = DeviceManagerPath d.ifa...
package kv_test import ( "context" "testing" "github.com/influxdata/influxdb/v2" "github.com/influxdata/influxdb/v2/inmem" "github.com/influxdata/influxdb/v2/kv" "github.com/influxdata/influxdb/v2/snowflake" influxdbtesting "github.com/influxdata/influxdb/v2/testing" "go.uber.org/zap/zaptest" ) type testable...
package service import ( "context" "database/sql" "errors" "fmt" "net/http" "time" "github.com/gilcrest/go-api-basic/domain/audit" "github.com/gilcrest/go-api-basic/domain/auth" "github.com/gilcrest/go-api-basic/domain/errs" "github.com/gilcrest/go-api-basic/domain/secure" "github.com/google/uuid" "github...
package main import ( "golang.org/x/net/context" "google.golang.org/grpc" pb "proto" "testing" ) const ( address = "localhost:50003" test_key = "test_key" ) func TestCasDelay(t *testing.T) { cas_delay() } func TestSnowflake(t *testing.T) { // Set up a connection to the server. conn, err := grpc.Dial(addre...
// Copyright 2015 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package addresser import ( "time" "github.com/juju/errors" "github.com/juju/loggo" "github.com/juju/utils" apiWatcher "github.com/juju/juju/api/watcher" "github.com/juju/juju/environs" "github.com/juju/juju/environs/...
package server import ( "encoding/hex" "errors" "fmt" "time" "getmelange.com/zooko/message" "getmelange.com/zooko/rpc" "github.com/melange-app/nmcd/btcjson" ) const ( nameNewConfirmations = 12 nameFirstUpdateConfirmations = 1 confirmationTime = 10 * time.Minute checkConfirmationTime = 5 * t...
package session import ( "github.com/cenkalti/rain/internal/announcer" "github.com/cenkalti/rain/internal/handshaker/incominghandshaker" "github.com/cenkalti/rain/internal/handshaker/outgoinghandshaker" "github.com/cenkalti/rain/internal/tracker" ) func (t *torrent) stop(err error) { s := t.status() if s == Sto...
// Copyright 2013 The ql Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSES/QL-LICENSE file. // Copyright 2015 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in complia...
/* Copyright 2016 Tamás Gulácsi 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 writing, softwar...
/* Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or...
// Copyright (c) 2016-2020 Tigera, 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 ap...
package instana import ( "strings" "time" "github.com/instana/go-sensor/w3ctrace" "github.com/opentracing/opentracing-go/ext" ) type typedSpanData interface { Type() RegisteredSpanType Kind() SpanKind } // Registered types supported by Instana. The span type is determined based on // the operation name passed...
package main import ( "encoding/json" "fmt" ) type person struct { First string Last string } func main() { p1 := person{ First: "a", Last: "z", } p2 := person{ First: "b", Last: "y", } xp := []person{p1, p2} fmt.Println("go data", xp) bs, err := json.Marshal(xp) if err != nil { fmt.Printl...
package amino_test import ( "bytes" "encoding/json" "os" "reflect" "strings" "testing" "time" "github.com/stretchr/testify/assert" "github.com/tendermint/go-amino" ) func TestMain(m *testing.M) { // Register the concrete types first. var cdc = amino.NewCodec() cdc.RegisterConcrete(&Transport{}, "our/tran...
package ovn import ( "fmt" "strings" "time" util "github.com/openvswitch/ovn-kubernetes/go-controller/pkg/util" "github.com/sirupsen/logrus" kapi "k8s.io/api/core/v1" ) func (oc *Controller) syncPods(pods []interface{}) { // get the list of logical switch ports (equivalent to pods) expectedLogicalPorts := ma...
// Copyright (c) 2015, Google 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 appli...
package chat import ( "bytes" "errors" "image" "image/color/palette" "image/draw" "image/gif" "image/jpeg" "io" "golang.org/x/net/context" "github.com/keybase/client/go/protocol/keybase1" "github.com/nfnt/resize" "camlistore.org/pkg/images" ) const ( previewImageWidth = 320 previewImageHeight = 320 ...
package oskite import ( "encoding/json" "errors" "fmt" "io/ioutil" "koding/db/models" "koding/tools/dnode" "koding/tools/kite" "koding/virt" "net/http" "labix.org/v2/mgo" "labix.org/v2/mgo/bson" ) const ( ErrTokenRequired = "TOKEN_REQUIRED" ErrUsernameRequired = "USERNAME_REQUIRED" ErrGroupRequired ...
package systests import ( "fmt" "testing" "golang.org/x/net/context" keybase1 "github.com/keybase/client/go/protocol/keybase1" "github.com/keybase/client/go/teams" "github.com/stretchr/testify/require" ) func findMember(user *smuUser, members []keybase1.TeamMemberDetails) *keybase1.TeamMemberDetails { for _, ...
/* Copyright 2019 The Vitess 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 to in writing, soft...
package meta_test import ( "bytes" "fmt" "html/template" "io/ioutil" "os" "path/filepath" "github.com/goadesign/goa/goagen/codegen" "github.com/goadesign/goa/goagen/meta" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("Run", func() { var compiledFiles []string var compileError e...
// Copyright 2016, RadiantBlue Technologies, Inc. // // 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 ...
package shell import ( "bufio" "fmt" "io" "os" "strings" ) type editor interface { ReadLine() (string, error) Close() } type minEditor struct { in *bufio.Reader out io.Writer } func newMinEditor(in, out *os.File) *minEditor { return &minEditor{bufio.NewReader(in), out} } func (ed *minEditor) ReadLine() ...
package main import ( "archive/tar" "archive/zip" "compress/gzip" "encoding/json" "encoding/xml" "fmt" "io" "io/ioutil" "log" "net/http" "os" "path/filepath" "strings" "utilities.qs/registry_windows" "github.com/codegangsta/cli" "github.com/jmoiron/jsonq" ) type Driver struct { Name string `xml:"Na...
package jwthelper import ( "errors" "fmt" "io/ioutil" "net/http" "sync" "github.com/dgrijalva/jwt-go" "github.com/northbright/pathhelper" ) // Key struct consists of algorithm, signning key and verifying key. type Key struct { Method jwt.SigningMethod // jwt.SigningMethod SignKey interface{} // S...
/* Copyright 2015 Gravitational, Inc. 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 writing, soft...
// Copyright 2016 The go-github AUTHORS. All rights reserved. // // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package github import ( "context" "fmt" ) // ProjectsService provides access to the projects functions in the // GitHub API. // // GitHub API docs...
/*- * Copyright (c) 2016,2017, F5 Networks, Inc. * * 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 l...
package chunked import ( archivetar "archive/tar" "context" "encoding/base64" "encoding/json" "fmt" "io" "io/ioutil" "os" "path/filepath" "reflect" "sort" "strings" "sync/atomic" "syscall" "time" "github.com/containerd/stargz-snapshotter/estargz" storage "github.com/containers/storage" graphdriver "...
// Code generated by go-swagger; DO NOT EDIT. package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "strconv" strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" "github.com/go-openapi/swag" ...
/* Copyright 2017 the Heptio Ark contributors. 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 writ...
package null import ( "database/sql" "encoding/json" "fmt" "reflect" "strconv" ) const ( nullString = "null" ) // Float is a nullable float64. // It does not consider zero values to be null. // It will decode to null, not zero, if null. type Float struct { sql.NullFloat64 } // NewFloat creates a new Float fu...
package helm import ( "bytes" "fmt" "strings" "gopkg.in/yaml.v2" "github.com/flant/helm/pkg/chartutil" "github.com/flant/helm/pkg/engine" "github.com/flant/helm/pkg/proto/hapi/chart" "github.com/flant/helm/pkg/releaseutil" "github.com/flant/werf/pkg/util" ) type ChartTemplates []Template func (templates ...
// Copyright 2019 Istio 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 to i...
// Copyright 2018-2020 Authors of Cilium // // 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 ag...
// Copyright 2018-2020 Authors of Cilium // // 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 ag...
package ginpprof import ( "net/http/pprof" "strings" "github.com/gin-gonic/gin" ) // Note::This source code is from https://github.com/DeanThompson/ginpprof/blob/master/pprof.go // This source is not used anymore. // Wrap adds several routes from package `net/http/pprof` to *gin.Engine object func Wrap(router *g...
/* Copyright 2016 The Kubernetes Authors 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 ag...
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package flate import ( "io" "math" ) const ( // The largest offset code. offsetCodeCount = 30 // The special code used to mark the end of a block. endB...
package service import ( "fmt" "net" "os" "github.com/codegangsta/cli" "github.com/keybase/client/go/libcmdline" "github.com/keybase/client/go/libkb" keybase1 "github.com/keybase/client/protocol/go" "github.com/maxtaco/go-framed-msgpack-rpc/rpc2" ) // Keep this around to simplify things var G = libkb.G type...
package goiostat_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "testing" ) func TestGoiostat(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Goiostat Suite") } breaks build thinks it has 2 main... figure that out later
package drivers import ( "text/template" ) // Base config. This is common for all VMs and has no variables in it. var qemuBase = template.Must(template.New("qemuBase").Parse(` # Machine [machine] graphics = "off" {{if eq .architecture "x86_64" -}} type = "q35" {{end -}} {{if eq .architecture "aarch64" -}} type = "vi...
package gqt_test import ( "encoding/json" "fmt" "io" "io/ioutil" "net" "os" "os/exec" "path" "path/filepath" "strconv" "strings" "time" "code.cloudfoundry.org/garden" "code.cloudfoundry.org/guardian/gqt/cgrouper" "code.cloudfoundry.org/guardian/gqt/runner" . "code.cloudfoundry.org/guardian/matchers" ...
package graceful import ( "os" "os/signal" "sync" "sync/atomic" "time" "github.com/zenazn/goji/graceful/listener" ) var mu sync.Mutex // protects everything that follows var listeners = make([]*listener.T, 0) var prehooks = make([]func(), 0) var posthooks = make([]func(), 0) var closing int32 var doubleKick, t...
package libkbfs import ( "errors" "testing" "github.com/golang/mock/gomock" "github.com/keybase/client/go/libkb" keybase1 "github.com/keybase/client/go/protocol" "golang.org/x/net/context" ) func keyManagerInit(t *testing.T) (mockCtrl *gomock.Controller, config *ConfigMock, ctx context.Context) { ctr := NewS...
// Copyright ©2014 The gonum Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package optimize import "github.com/gonum/floats" // GradientDescent is a Method that performs gradient-based optimization. // Gradient Descent performs s...
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "sort" "sync" "time" "github.com/keybase/client/go/logger" keybase1 "github.com/keybase/client/go/protocol" "golang.org/x/net/context" )...
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "math" "os" "reflect" "sync" "testing" "time" "github.com/keybase/client/go/protocol/keybase1" "github.com/keybase/kbfs/ioutil" "gith...
// Copyright Istio 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 to in wri...
/* 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 writing, software distributed under the License ...
/* * This file is part of the KubeVirt project * * 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 la...
// Copyright 2018 The go-hep Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package rdict import ( "bytes" "fmt" "go/format" "go/importer" "go/types" "log" "reflect" "strings" "go-hep.org/x/hep/groot/rmeta" ) var ( binM...
/* Copyright (c) 2015, Hendrik van Wyk All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following ...
/* Copyright 2014 The Kubernetes Authors 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 ag...
/* Copyright 2014 The Kubernetes 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 to in writing, ...
package guardian import ( "context" "encoding/json" "errors" "fmt" "log" "net" "net/http" "time" "github.com/scjalliance/resourceful/environment" "github.com/scjalliance/resourceful/guardian/transport" "github.com/scjalliance/resourceful/lease" "github.com/scjalliance/resourceful/lease/leaseutil" "github...
// Simple use of the tuntap package that prints packets received by the interface. package main import ( "fmt" "os" "code.google.com/p/tuntap" ) func main() { if len(os.Args) != 3 { fmt.Println("syntax:", os.Args[0], "tun|tap", "<device name>") return } var typ tuntap.DevKind switch os.Args[1] { case "t...
// Copyright 2016 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "errors" "fmt" "path/filepath" "time" "github.com/keybase/client/go/logger" "github.com/keybase/client/go/protocol/keybase1" "github.co...
package authtoken import ( "fmt" "io/ioutil" "log" "testing" . "github.com/smartystreets/goconvey/convey" "bytes" "os" "path/filepath" "time" ) func tempDir() string { dir, err := ioutil.TempDir("", "skydb.auth.test") if err != nil { panic(err) } return dir } func TestNewToken(t *testing.T) { token...
package hypervisor import ( "net" "time" "github.com/Symantec/Dominator/lib/tags" ) const ( StateStarting = 0 StateRunning = 1 StateFailedToStart = 2 StateStopping = 3 StateStopped = 4 StateDestroying = 5 StateMigrating = 6 StateExporting = 7 VolumeFormatRaw = 0 Volum...
package watch import ( "io/ioutil" "os" "reflect" "testing" "time" ) func dum() { return } func TestWatch(t *testing.T) { tests := []struct { paths map[string]func() expWatched []string expWatchers []string }{ { map[string]func(){ "testdata/dummy.txt": dum, "testdata/test.txt": dum...
package life import ( "errors" "fmt" "path/filepath" "runtime" "testing" "time" ) func TestLife(t *testing.T) { v := NewSingleLife() started := waitOnChan(v.started, 5*time.Millisecond) if started == nil { t.Fatalf("SingleLife started when it wasn't supposed to") } terminated := waitOnChan(v.terminated,...
package benchmark_test import ( "io/ioutil" "testing" "time" tomlbs "github.com/BurntSushi/toml" tomlv1 "github.com/pelletier/go-toml-v1" "github.com/pelletier/go-toml/v2" "github.com/stretchr/testify/require" ) type runner struct { name string unmarshal func([]byte, interface{}) error } var runners =...
// Copyright (c) 2015 The gocql Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gocql import ( "bytes" "crypto/md5" "fmt" "math/big" "sort" "strconv" "strings" "github.com/gocql/gocql/internal/murmur" ) // a token ...
package chi import ( "bytes" "context" "fmt" "io" "io/ioutil" "net" "net/http" "net/http/httptest" "os" "sync" "testing" "time" ) func TestMuxBasic(t *testing.T) { var count uint64 countermw := func(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) ...
package notebook // Notebook is an interface which represents // a collection of notes type Notebook interface { // List returns the list of notes holding in the notebook List() Notes // Get returns a note from the notebook according to its identifier Get([]byte) (Note, error) // Set adds or upda...
package main import ( // stdlib packages "encoding/json" "flag" "fmt" "log" "os" "runtime" "strconv" "sync" // custom packages "config" "modules/amqpmodule" es "modules/elasticsearchmodule" ) const rxQueue = "conn_scan_results_queue" const esIndex = "observer" const esType = "connection" var broker *a...