CombinedText stringlengths 4 3.42M |
|---|
/*
Copyright 2015 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 2016 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 musicplayer
import (
"bufio"
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/url"
"os"
"os/exec"
"strings"
"sync"
"time"
"github.com/Necroforger/Fantasia/system"
"github.com/Necroforger/Fantasia/util"
"github.com/Necroforger/Fantasia/youtubeapi"
"github.com/Necroforger/dream"
"github.com/Necr... |
/*
Copyright 2017 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 agreed... |
// Copyright 2016-2018 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 promtail
import (
"sync"
"github.com/cortexproject/cortex/pkg/util"
"github.com/go-kit/kit/log"
"github.com/grafana/loki/pkg/promtail/client"
"github.com/grafana/loki/pkg/promtail/config"
"github.com/grafana/loki/pkg/promtail/server"
"github.com/grafana/loki/pkg/promtail/targets"
)
// Option is a fun... |
// Copyright 2016 CodisLabs. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package topom
import (
"time"
"github.com/CodisLabs/codis/pkg/models"
"github.com/CodisLabs/codis/pkg/utils/errors"
"github.com/CodisLabs/codis/pkg/utils/log"
"github.com/CodisLabs/codis/pkg/utils/redis"
)
fu... |
// Package mapstructure exposes functionality to convert one arbitrary
// Go type into another, typically to convert a map[string]interface{}
// into a native Go structure.
//
// The Go structure can be arbitrarily complex, containing slices,
// other structs, etc. and the decoder will properly decode nested
// maps an... |
// 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 (
"encoding/json"
"fmt"
"sort"
"strings"
"sync"
"time"
"github.com/keybase/client/go/logger"
"github.com/keybase/kbfs/kbfsblock"
"githu... |
package libkbfs
import (
"errors"
"fmt"
"strings"
"sync"
"time"
"github.com/keybase/client/go/logger"
keybase1 "github.com/keybase/client/go/protocol"
"golang.org/x/net/context"
)
// reqType indicates whether an operation makes MD modifications or not
type reqType int
const (
read reqType = iota // A read... |
package krakenapi
import (
"crypto/hmac"
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"mime"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
const (
// APIURL is the official Kraken API Endpoint
APIURL = "https://api.kraken.com"
// APIVersion is the o... |
/*
* Ferret
* Copyright (c) 2016 Yieldbot, Inc.
* For the full copyright and license information, please view the LICENSE.txt file.
*/
// For latest assets run `go generate ./assets` from project root folder
//go:generate statik -src=./public
// Package assets provides embedded assets
package assets
import (
"l... |
// +build !dockeronly
package main
import (
"encoding/json"
"encoding/xml"
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"path"
"path/filepath"
"strconv"
"sync"
"syscall"
"time"
"github.com/flynn/flynn/Godeps/_workspace/src/github.com/alexzorin/libvirt-go"
"github.com/flynn/flynn/Godeps/_workspace/src/g... |
package main
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"poliskarta/externalservices"
"poliskarta/filter"
"strconv"
"github.com/go-martini/martini"
)
var areas = AreasStruct{areasArray}
type AreasStruct struct {
Areas []Area `json:"areas"`
}
type Area struct {
Name string `json:"name"`
Value s... |
package lMDQ
import (
"crypto/sha1"
"encoding/base64"
"fmt"
"github.com/wayf-dk/gosaml"
"github.com/wayf-dk/goxml"
"os"
"testing"
)
type (
MdSets struct {
Hub, Internal, ExternalIdP, ExternalSP gosaml.Md
}
)
var (
Md MdSets
)
func printHashedDom(xp *goxml.Xp) {
hash := sha1.Sum([]byte(xp.C14n(nil, ""))... |
package md3
import (
"bytes"
"fmt"
"io"
"log"
)
const (
maxQPath = 64
maxFrameLength = 16
md3HeaderIdent = "IDP3"
md3SurfaceIdent = md3HeaderIdent
md3MaxVersion = 15
md3VertexSize = 8
)
type surfaceHeader struct {
name string
flags int32 // Unused.
num_frames int32
num_shaders int32
... |
// Copyright (c) 2013 Jason McVetta. This is Free Software, released under the
// terms of the AGPL v3. See http://www.gnu.org/licenses/agpl-3.0.html for
// details. Resist intellectual serfdom - the ownership of ideas is akin to
// slavery.
package main
import (
"bytes"
"crypto/rand"
"encoding/base64"
"io/iout... |
// Copyright 2016 tsuru 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 main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"os"
"runtime"
"runtime/pprof"
"sync"
"testing"
"time"
"github.com/tsu... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/exec"
"strings"
"testing"
"github.com/rabbitmq/amqp091-go"
)
const (
testAmqpURI = "amqp://guest:guest@127.0.0.1:5672/"
testQueueName = "test-rabbitmq-dump-queue"
testExchangeName = "test-rabbitmq-dump-exchange"
testRoutingKey = "... |
package main
import (
"testing"
)
func TestPlus(t *testing.T) {
n := 2
m := 3
result := Plus(n, m)
if result != n+m {
t.Errorf("error plus value: %s", result)
}
}
fix error print format
package main
import (
"testing"
)
func TestPlus(t *testing.T) {
n := 2
m := 3
result := Plus(n, m)
if result != n... |
package main
import (
"testing"
)
func TestNothing(t *testing.T) {
}
func BenchmarkGetHead(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; n++ {
GetHead(skin)
}
}
func BenchmarkGetHelm(b *testing.B) {
skin := fetchSkin("clone1018")
b.ResetTimer()
for n := 0; n < b.N; ... |
package main
import (
"fmt"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
"github.com/nicksnyder/go-i18n/i18n"
bloomsky "github.com/patrickalin/bloomsky-api-go"
"github.com/spf13/viper"
)
var serv *httpServer
func TestMain(m *testing.M) {
if err := i18n.ParseTranslationFileBytes("lang/en-us.all... |
package atlas
import (
"encoding/json"
"fmt"
"io/ioutil"
"github.com/pkg/errors"
)
var (
allTypes = map[string]bool{
"dns": true,
"http": true,
"ntp": true,
"ping": true,
"sslcert": true,
"traceroute": true,
"wifi": true,
}
)
// -- private
// checkType verify ... |
package main
import "fmt"
var clave = map[string]string{
"j2": "HgHg PuFe ____ ____ CuNp PbAu ____ AuPb ____ AgUr ____ FePu ",
"j3": "HgSn ____ SnHg UrFe ____ PbAg ____ AuAu ____ AgPb ____ FeUr ",
"j5": "PbCu ____ AuSn ____ AgHg TiFe FeTi ____ ____ SnAu ____ CuPb ",
"j6": "HgAu ____ SnPb ____ ... |
package bluetooth
import (
"strings"
"time"
"github.com/pkg/errors"
"golang.org/x/net/context"
log "github.com/Sirupsen/logrus"
"github.com/currantlabs/ble"
"github.com/currantlabs/ble/linux"
"github.com/currantlabs/ble/linux/hci"
"github.com/resin-io/edge-node-manager/config"
)
var (
done chan struct{}
... |
// +build e2e istio
/*
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 agree... |
/*
Copyright 2020 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 2016 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 client
import (
"bufio"
"fmt"
"os"
"testing"
"time"
"github.com/hashicorp/nomad/nomad/mock"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/hashicorp/nomad/testutil"
"github.com/hashicorp/nomad/client/config"
ctestutil "github.com/hashicorp/nomad/client/testutil"
)
type MockAllocStateUpdate... |
package lora
import (
"bytes"
"encoding/binary"
"log"
"net"
"time"
)
const (
PUSH_DATA = iota
PUSH_ACK = iota
PULL_DATA = iota
PULL_ACK = iota
PULL_RESP = iota
)
var buf = make([]byte, 2048)
type Conn struct {
Raw *net.UDPConn
}
type Message struct {
SourceAddr *net.UDPAddr
Conn *Conn
Header ... |
package main
import (
"fmt"
"os"
"strings"
"text/template"
)
func toCamelCase(name string, initialUpper bool) string {
var parts []string
for _, part := range strings.Split(name, "_") {
parts = append(parts, strings.ToUpper(part[:1])+strings.ToLower(part[1:]))
}
if initialUpper {
return strings.Join(parts... |
package gestic
import (
"log"
"math"
"github.com/joshlf13/gopack"
"github.com/ninjasphere/go-ninja/logger"
"github.com/wolfeidau/epoller"
)
const (
DSPIfoFlag uint16 = 1 << iota
GestureInfoFlag
TouchInfoFlag
AirWheelInfoFlag
CoordinateInfoFlag
)
// Gestic
// http://ww1.microchip.com/downloads/en/DeviceDoc... |
package hanaonazure
// Copyright (c) Microsoft and contributors. 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
//
//... |
package main
import (
"bytes"
"fmt"
"github.com/Netflix-Skunkworks/go-jira"
"github.com/coryb/optigo"
"gopkg.in/coryb/yaml.v2"
"gopkg.in/op/go-logging.v1"
"io/ioutil"
"os"
"os/exec"
"strings"
)
var (
log = logging.MustGetLogger("jira")
format = "%{color}%{time:2006-01-02T15:04:05.000Z07:00} %{level:-5s... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
"sync"
"time"
"github.com/brotherlogic/goserver"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
pbd "github.com/brotherlogic/discovery/proto"
pbgh "github.com/brother... |
package main
import (
"flag"
"io/ioutil"
"log"
"strconv"
"time"
"github.com/brotherlogic/goserver"
"golang.org/x/net/context"
"google.golang.org/grpc"
pbd "github.com/brotherlogic/discovery/proto"
pb "github.com/brotherlogic/gobuildmaster/proto"
pbs "github.com/brotherlogic/gobuildslave/proto"
pbg "githu... |
/*
* 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... |
package main
import (
"bytes"
"crypto/md5"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"testing"
"time"
)
const tmpDir = "main_test_tmp/"
const plainDir = tmpDir + "plain/"
const cipherDir = tmpDir + "cipher/"
func unmount() error {
fu := exec.Command("fusermount", "-z", "-u", plainDir)
fu.Stdou... |
package main
import (
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"github.com/gorilla/mux"
. "github.com/ory-am/workshop-dbg/store"
"github.com/ory-am/workshop-dbg/store/memory"
"github.com/parnurzeal/gorequest"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var m... |
package main
import (
"fmt"
"os"
"testing"
)
// get cwd to return back to after a test is run
var cwd = getCurrentWorkingDirectory()
const projectLocation = "test_resources/gradle/project/"
const subProjectLocation = projectLocation + "com.example.app/"
const projectBuildFileLocation = projectLocation + defaultGr... |
package main
import (
"io/ioutil"
"os"
"os/exec"
"strings"
"testing"
)
// Inspired by https://talks.golang.org/2014/testing.slide#23
func TestUsage(t *testing.T) {
if os.Getenv("BE_CRASHER") == "1" {
main()
return
}
cmd := exec.Command(os.Args[0], "-test.run=TestUsage")
cmd.Env = append(os.Environ(), "B... |
package main
import (
"bytes"
"compress/gzip"
"crypto/md5"
"encoding/hex"
"io"
"io/ioutil"
"log"
"mime/multipart"
"net/http"
"net/http/httptest"
"os"
"testing"
"time"
"github.com/boltdb/bolt"
"github.com/fsnotify/fsnotify"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/packet"
"golang.or... |
// +build integration
package main
import (
"bytes"
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"syscall"
"testing"
"regexp"
"github.com/elliotchance/c2go/util"
)
type programOut struct {
stdout bytes.Buffer
stderr bytes.Buffer
isZero bool
}
// TestIntegrationScripts tests all programs in ... |
package make
import (
"bufio"
"database/sql"
"fmt"
"io/ioutil"
"math/rand"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"text/template"
"time"
log "github.com/Sirupsen/logrus"
"github.com/fubarhouse/golang-drush/command"
"github.com/fubarhouse/golang-drush/composer"
"github.com/fubarhouse/golang... |
// Copyright 2018 the u-root 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 integration
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"runtime"
"strings"
"testing"
"time"
"github.com... |
// Copyright 2016 The etcd 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 t... |
package hugolib
import (
"bytes"
"fmt"
"image/jpeg"
"io"
"math/rand"
"os"
"path/filepath"
"regexp"
"runtime"
"sort"
"strconv"
"strings"
"testing"
"text/template"
"time"
"unicode/utf8"
"github.com/gohugoio/hugo/htesting"
"github.com/gohugoio/hugo/output"
"github.com/gohugoio/hugo/parser/metadecode... |
package sarama
import "testing"
var (
emptyMessage = []byte{
167, 236, 104, 3, // CRC
0x00, // magic version byte
0x00, // attribute flags
0xFF, 0xFF, 0xFF, 0xFF, // key
0xFF, 0xFF, 0xFF, 0xFF} // value
emptyGzipMessage = []byte{
97, 79, 149, 90, //CRC
0x00, ... |
// +build !js
package stun
import (
"bytes"
"encoding/base64"
"encoding/binary"
"encoding/csv"
"errors"
"fmt"
"hash/crc64"
"io"
"io/ioutil"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
)
type attributeEncoder interface {
AddTo(m *Message) error
}
func addAttr(t testing.TB, m *Message, a ... |
package main
import (
"crypto/md5"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
)
var starting_hash string = "b1dc9af6f6d8d7ce5d5a0fff1cee73ae9d44c7bb"
var md5_of_starting_file string = "0566ec561947146909cf40192cda39ec"
func TestDisplayingObject(t *testing.T) {
first_commit, err := get_object(s... |
//GVariant : GVariant — strongly typed value datatype
// https://developer.gnome.org/glib/2.26/glib-GVariant.html
package glib
// #cgo pkg-config: glib-2.0 gobject-2.0
// #include "gvariant.go.h"
// #include "glib.go.h"
import "C"
import "unsafe"
/*
* GVariant
*/
// IVariant is an interface type implemented by V... |
/*
* Copyright (C) 2016 Lawrence Woodman <lwoodman@vlifesystems.com>
*/
package report
import (
"encoding/json"
"errors"
"fmt"
"github.com/lawrencewoodman/dexpr_go"
"github.com/lawrencewoodman/dlit_go"
"github.com/lawrencewoodman/rulehunter"
"github.com/lawrencewoodman/rulehuntersrv/config"
"io/ioutil"
"os... |
package node
import (
"errors"
"log"
"sync"
)
// Takes care of maintaining maps and insures that we know which interfaces are reachable where.
type MapHandler interface {
AddConnection(NodeAddress, MapConnection)
FindConnection(NodeAddress) (NodeAddress, error)
}
type taggedMap struct {
address NodeAddress
ne... |
package tsi1
import (
"bufio"
"bytes"
"encoding/binary"
"errors"
"fmt"
"hash/crc32"
"io"
"os"
"sort"
"sync"
"time"
"github.com/influxdata/influxdb/models"
"github.com/influxdata/influxdb/pkg/bloom"
"github.com/influxdata/influxdb/pkg/estimator"
"github.com/influxdata/influxdb/pkg/estimator/hll"
"githu... |
package chat
import (
"errors"
"fmt"
"strings"
"github.com/hashicorp/golang-lru"
"github.com/keybase/client/go/chat/globals"
"github.com/keybase/client/go/chat/types"
"github.com/keybase/client/go/chat/utils"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/chat1"
"github.com/keyb... |
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package libkb
import (
"errors"
"fmt"
"io"
"regexp"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
jsonw "github.com/keybase/go-jsonw"
"golang.org/x/net/context"
)
type UserBasi... |
// Copyright (c) 2014, Kevin Walsh. 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 app... |
package teams
import (
"errors"
"fmt"
"golang.org/x/net/context"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/keybase1"
)
type Team struct {
libkb.Contextified
Name string
Chain *TeamSigChainState
Box TeamBox
ReaderKeyMasks []keybase1.ReaderKey... |
/*
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 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
// +build appengine
package dl
// TODO(adg): refactor this to use the tools/godoc/static template.
const templateHTML = `
{{define "root"}}
<!DOCTYPE html... |
package main
import "reflect"
import "strings"
import "testing"
type doctest struct {
doc string
tags map[string] string
}
var testdocs = []doctest{
{
`<html>
<head>
<title>Not interesting</title>
<meta property="og:title" content="More interesting" />
</head>
</html>`,
map[string]string{
"... |
package google
import (
"context"
"fmt"
"log"
"net/http"
"regexp"
"time"
"github.com/hashicorp/terraform-plugin-sdk/helper/logging"
"github.com/hashicorp/terraform-plugin-sdk/helper/pathorcontents"
"github.com/hashicorp/terraform-plugin-sdk/httpclient"
"github.com/terraform-providers/terraform-provider-goog... |
// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package leveldb
import (
"runtime"
"sync/atomic"
"unsafe"
"github.com/syndtr/goleveldb/leveldb/errors"
"github.com/syn... |
package auto
import (
"bytes"
"compress/gzip"
"encoding/base64"
"io/ioutil"
)
func Assets() map[string][]byte {
var assets = make(map[string][]byte, 59)
var bs []byte
var gr *gzip.Reader
bs, _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5xXbW/bNhD+7l9xSzGg9Sy/xUlWBytWBBg2oC2KtV+GoR8okbK4UDyBpOy4Q//7jhQly... |
package mat
import (
"math"
"math/rand"
)
// CopyOfMatrix makes a deep copy of matrix (slice of slices of float64)
func CopyOfMatrix(src [][]float64) (dst [][]float64) {
dst = make([][]float64, len(src))
for i, row := range src {
dst[i] = make([]float64, len(row))
copy(dst[i], row)
}
return
}
// CopyOfVect... |
// Copyright 2017 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 gps
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"log"
"math/rand"
"reflect"
"sort"
"strconv"
"strings"
"testing"
"unicode"
"github.com/gola... |
// Copyright 2018 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 cache
import (
"context"
"fmt"
"go/ast"
"go/scanner"
"go/token"
"go/types"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"sync"
"golan... |
package adhier
import (
"fmt"
"reflect"
"testing"
"github.com/gomath/format/mat"
"github.com/gomath/numan/basis/linhat"
"github.com/gomath/numan/grid/newcot"
)
func assertEqual(actual, expected interface{}, t *testing.T) {
if !reflect.DeepEqual(actual, expected) {
t.Fatalf("got '%v' instead of '%v'", actual... |
package s3
import (
"context"
"fmt"
"io"
"os"
"path"
"restic"
"strings"
"time"
"restic/backend"
"restic/errors"
"github.com/minio/minio-go"
"github.com/minio/minio-go/pkg/credentials"
"restic/debug"
)
// Backend stores data on an S3 endpoint.
type Backend struct {
client *minio.Client
sem *backen... |
package interpreter
import (
"fmt"
"github.com/fadion/aria/ast"
"github.com/fadion/aria/reporter"
"math"
"strings"
"io/ioutil"
"github.com/fadion/aria/lexer"
"github.com/fadion/aria/reader"
"github.com/fadion/aria/parser"
"path/filepath"
)
// Interpreter represents the interpreter.
type Interpreter struct {... |
package interpreter
import (
"fmt"
"io"
"os"
"os/exec"
"regexp"
)
type CommandNotFound struct {
Name string
Err error
}
func (this CommandNotFound) Stringer() string {
return fmt.Sprintf("'%s' is not recognized as an internal or external command,\noperable program or batch file", this.Name)
}
func (this Co... |
package graph
import (
"fmt"
"io"
"io/ioutil"
"github.com/Sirupsen/logrus"
"github.com/docker/distribution"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/docker/image"
"github.com/docker/docker/pkg/progressreader"
"github.com/docker/docker/pkg/streamfor... |
package graphics
import (
"image"
"os"
"errors"
"github.com/nfnt/resize"
)
func ImageCopy(src image.Image,x, y ,w, h int) (image.Image,error) {
var subImg image.Image
if rgbImg,ok := src.(*image.YCbCr); ok {
subImg = rgbImg.SubImage(image.Rect(x, y, x+w, y+h)).(*image.YCbCr) //图片裁剪x0 y0 x1 y1
}else if rg... |
package recipes
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/betable/ezk"
"github.com/samuel/go-zookeeper/zk"
)
func join(parts ...string) string {
return strings.Join(parts, "/")
}
func parseSeq(path string) (int, error) {
parts := strings.Split(path, ".")
return strconv.Atoi(parts[len(parts)-1])... |
// The go-rpcgen project is an attempt to create an easy-to-use, open source
// protobuf service binding for the standard Go RPC package. It provides a
// protoc-gen-go (based on the standard "main" from goprotobuf and leveraging
// its libraries) which has a plugin added to also output RPC stub code.
//
// Prerequisi... |
package recovery
import (
"errors"
"fmt"
)
func panicString(p interface{}) string {
panicMsg, ok := p.(string)
if !ok {
panicMsg = fmt.Sprintf("%+v", panicMsg)
}
return panicMsg
}
func panicError(p interface{}) error {
if p == nil {
return nil
}
ps := panicString(p)
if ps == "" {
ps = fmt.Sprintf("... |
package grappos
import (
"testing"
)
func TestSearchCoordinates(t *testing.T) {
_, err := SearchCoordinates("0.0", "0.0")
if err != nil {
t.Fatal(err)
}
}
func TestSearchProductByID(t *testing.T) {
_, err := SearchProductByID(1, "banana")
if err != nil {
t.Fatal(err)
}
}
Upping unit test coverage
packag... |
package main
import (
"encoding/json"
"errors"
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/garyburd/redigo/redis"
"time"
)
const (
RedisManagerDefaultMaxIdle = 1
RedisManagerDefaultMaxActive = 10
RedisManagerDefaultIdleTimeout = 30 * time.Second
RedisManagerDefaultHost = "127.0.0.1" // N... |
package lib
import (
"encoding/json"
"errors"
"log"
"os"
"time"
"github.com/jh-bate/fantail-bot/Godeps/_workspace/src/github.com/garyburd/redigo/redis"
)
var FantailStorageErr = errors.New("Fantail storage is not enabled")
var FantailSaveErr = errors.New("Fantail issue trying to save to storage")
type Storage... |
/*
Copyright 2015 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... |
package scanner
import (
"bufio"
"encoding/gob"
"errors"
"fmt"
"github.com/Symantec/Dominator/lib/filesystem"
"github.com/Symantec/Dominator/lib/fsutil"
"github.com/Symantec/Dominator/lib/hash"
"github.com/Symantec/Dominator/lib/image"
"io"
"log"
"os"
"os/user"
"path"
"syscall"
)
const (
dirPerms = sys... |
// GraphicsMagick processor
package graphicsmagick
import (
"fmt"
"github.com/pierrre/imageserver"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strconv"
)
const (
globalParameterName = "graphicsmagick"
tempDirPrefix = "imageserver_"
)
// Processes an image with GraphicsMagick command line (mogrify comm... |
// Copyright 2019 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.
// +build linux
// +build 386 amd64
package runtime
//go:noescape
func uname(utsname *new_utsname) int
func mlock(addr, len uintptr) int
func osArchInit() {... |
package mesh
import (
"fmt"
"sync"
)
type GossipData interface {
Encode() [][]byte
Merge(GossipData) GossipData
}
type Gossip interface {
// specific message from one peer to another
// intermediate peers relay it using unicast topology.
GossipUnicast(dstPeerName PeerName, msg []byte) error
// send gossip to... |
package mesh
import (
"fmt"
)
type GossipData interface {
Encode() [][]byte
Merge(GossipData) GossipData
}
type Gossip interface {
// specific message from one peer to another
// intermediate peers relay it using unicast topology.
GossipUnicast(dstPeerName PeerName, msg []byte) error
// send gossip to every p... |
package gubled
import (
"fmt"
"github.com/smancke/guble/gubled/config"
log "github.com/Sirupsen/logrus"
"github.com/smancke/guble/gcm"
"github.com/smancke/guble/metrics"
"github.com/smancke/guble/server"
"github.com/smancke/guble/server/auth"
"github.com/smancke/guble/server/cluster"
"github.com/smancke/gu... |
//go:generate go-bindata -prefix ../../migrations/ -pkg migrations -o ../../internal/migrations/migrations_gen.go ../../migrations/
//go:generate go-bindata -prefix ../../static/ -pkg static -o ../../internal/static/static_gen.go ../../static/...
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"fmt"
"... |
package main
import (
"fmt"
"os"
"path"
"strconv"
"github.com/moul/number-to-words"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = path.Base(os.Args[0])
app.Author = "Manfred Touron"
app.Email = "https://github.com/moul/number-to-words"
app.Version = ntw.Version
app.Usage = "numbe... |
package main
import (
"log"
"net/http"
"time"
_ "net/http/pprof"
"github.com/brnstz/bus/internal/conf"
"github.com/brnstz/bus/internal/etc"
"github.com/brnstz/bus/loader"
"github.com/kelseyhightower/envconfig"
)
func main() {
var err error
log.SetFlags(log.Ldate | log.Ltime | log.Lshortfile)
go func() {... |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package networkinterface
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"strings"
"github.com/r3labs/terr... |
// This package implements a provisioner for Packer that executes a
// saltstack highstate within the remote machine
package saltmasterless
import (
"errors"
"fmt"
"github.com/mitchellh/packer/builder/common"
"github.com/mitchellh/packer/packer"
"os"
"path/filepath"
"strings"
)
var Ui packer.Ui
const DefaultT... |
package cmds
import (
"errors"
"fmt"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/pachyderm/pachyderm/src/client"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pachyderm/src/server/pfs/fuse"
"github.com/pachyd... |
package h2quic
import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"net"
"net/http"
"runtime"
"sync"
"sync/atomic"
"time"
"github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/protocol"
"github.com/lucas-clemente/quic-go/qerr"
"github.com/lucas-clemente/quic-go/utils"
"golang.org/x/net/ht... |
package cmds
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit... |
package model
import (
"bytes"
"errors"
"os"
"path/filepath"
"time"
"github.com/calmh/syncthing/buffers"
"github.com/calmh/syncthing/cid"
"github.com/calmh/syncthing/config"
"github.com/calmh/syncthing/osutil"
"github.com/calmh/syncthing/protocol"
"github.com/calmh/syncthing/scanner"
"github.com/calmh/syn... |
package cmds
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/pachyderm/pachyderm/src/client"
pfsclient "github.com/pachyderm/pachyderm/src/client/pfs"
"github.com/pachyderm/pac... |
package cmds
import (
"bufio"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"path/filepath"
"strings"
gosync "sync"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/limit"
pfsclient "github.com/pachyderm/pach... |
package cmds
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path"
"path/filepath"
"strings"
gosync "sync"
"syscall"
"text/tabwriter"
"golang.org/x/sync/errgroup"
"github.com/gogo/protobuf/jsonpb"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/l... |
package model
import (
"log"
"time"
)
// Worker is a compute nodes that does the actual processing
type Worker struct {
startTime int64
job Job // should this be nil if job does not exist?
}
// note we're just copying the job
func (n *Worker) startJob(job Job) {
// this condition should not happen
if n.i... |
package topgun_test
import (
. "github.com/concourse/concourse/topgun/common"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gexec"
)
var _ = Describe("A pipeline-provided resource type", func() {
BeforeEach(func() {
Deploy("deployments/concourse.yml", "-o", "operations/no-gc.yml... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.