CombinedText
stringlengths
4
3.42M
package provider import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3/s3manager" "github.com/MiteshSharma/StorageService/service/data" log "github.com/Sirupsen/logrus" "net/http" "github.com/aws/aws-sdk-go/...
package client import ( "bytes" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "fmt" "io" "os" bosherr "github.com/cloudfoundry/bosh-utils/errors" boshsys "github.com/cloudfoundry/bosh-utils/system" "golang.org/x/crypto/ssh" ) type ExecuteOptions struct { Exec string ExtraArgs []...
// Copyright 2015 The Vanadium Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file was auto-generated via go generate. // DO NOT UPDATE MANUALLY /* Command device facilitates interaction with the Vanadium device manager. U...
// Copyright 2021 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package repository import ( "context" "errors" "fmt" "strings" "code.gitea.io/gitea/models" repo_model "code.gitea.io/gitea/models/repo" user_model ...
// +build !nacl // run // Copyright 2014 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 main import ( "bytes" "fmt" "io/ioutil" "log" "os" "os/exec" "path/filepath" "regexp" "runtime" "strconv" "strings" ...
package neurgo import ( "testing" "github.com/couchbaselabs/go.assert" "sync" "log" ) type Wiretap struct { Node } type Injector struct { Node } func TestConnectBidirectional(t *testing.T) { neuron := &Neuron{} sensor := &Sensor{} weights := []float64{20,20,20,20,20} sensor.ConnectBidirectionalWeighted(...
package open import ( "fmt" "io/ioutil" "os" "path/filepath" "golang.org/x/net/context" "github.com/crackcomm/crawl" "github.com/satori/go.uuid" "github.com/skratchdot/open-golang/open" ) // Open - Opens crawl response in browser. func Open(resp *crawl.Response) error { fname := filepath.Join(os.TempDir(),...
// errchk $G -e $D/$F.go // 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 main func main() { var n byte; // ERROR "not a type" var y = float(0); // ERROR "cannot call" const ( a = 1+iota; // ER...
// Copyright 2015 Dorival de Moraes Pedroso. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package goga import ( "math" "math/rand" "sort" "github.com/cpmech/gosl/chk" "github.com/cpmech/gosl/la" "github.com/cpmech/gosl/rnd" "githu...
package main import ( "encoding/json" "flag" "fmt" "os" "sort" "strings" "time" ioutil "io/ioutil" git "github.com/libgit2/git2go" ) type ColorType string const ( Red ColorType = "\x1b[0;31m" Yellow = "\x1b[0;33m" Green = "\x1b[0;32m" BaseBranch string = "master" CachePath =...
// 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 net import ( "io" "os" "sync" "syscall" "time" ) // Network file descriptor. type netFD struct { // locking/lifetime of sysfd sysmu sync.Mute...
package types import ( "bytes" "compress/gzip" "database/sql/driver" "encoding/json" "errors" "io/ioutil" ) // GzippedText is a []byte which transparently gzips data being submitted to // a database and ungzips data being Scanned from a database. type GzippedText []byte // Value implements the driver.Valuer i...
package types import ( "fmt" "time" ) const KeelDefaultPort = 9300 const KeelPolicyLabel = "keel.observer/policy" type Repository struct { Host string `json:"host,omitempty"` Name string `json:"name,omitempty"` Tag string `json:"tag,omitempty"` } type Event struct { Repository Repository `json:"repository,om...
package matstack import ( "fmt" "github.com/go-gl/mathgl/mgl32" "testing" ) func TestStackNew(t *testing.T) { stack := NewMatStack() if !(*stack)[0].ApproxEqual(mgl32.Ident4()) { t.Errorf("Cannot construct stack correctly") } } func TestStackPushPopPeek(t *testing.T) { stack := NewMatStack() if !stack.Pe...
package main import ( "image" "io" "log" "os" "os/exec" "time" "github.com/lucasb-eyer/go-colorful" "github.com/ninjasphere/go-ninja/api" "github.com/ninjasphere/go-ninja/config" "github.com/ninjasphere/go-ninja/model" "github.com/ninjasphere/sphere-go-led-controller/ui" "github.com/ninjasphere/sphere-go-...
// Copyright 2015 Prometheus Team // 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...
package jira import ( "encoding/json" "fmt" "io/ioutil" "log" "net/http" "net/url" "strings" "time" "github.com/codeship/go-retro" ) const ( dateFormat = "2006-01-02" jiraHost = "jira.lazada.com" jiraPath = "/rest/timesheet-gadget/1.0/raw-timesheet.json" maxRetryAttempts = 3 ) type Entrie struct {...
/* * gomacro - A Go interpreter with Lisp-like macros * * Copyright (C) 2019 Massimiliano Ghilardi * * 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/. ...
// +build linux package nsinit import ( "fmt" "github.com/dotcloud/docker/pkg/libcontainer" "github.com/dotcloud/docker/pkg/libcontainer/capabilities" "github.com/dotcloud/docker/pkg/libcontainer/network" "github.com/dotcloud/docker/pkg/libcontainer/utils" "github.com/dotcloud/docker/pkg/system" "github.com/do...
// +build linux package nsinit import ( "fmt" "github.com/dotcloud/docker/pkg/libcontainer" "github.com/dotcloud/docker/pkg/libcontainer/apparmor" "github.com/dotcloud/docker/pkg/libcontainer/capabilities" "github.com/dotcloud/docker/pkg/libcontainer/network" "github.com/dotcloud/docker/pkg/libcontainer/utils" ...
package ulimit import "testing" func TestParseValid(t *testing.T) { u1 := &Ulimit{"nofile", 1024, 512} if u2, _ := Parse("nofile=512:1024"); u1 == u2 { t.Fatalf("expected %s, but got %s", u1.String(), u2.String()) } } func TestParseInvalidLimitType(t *testing.T) { if _, err := Parse("notarealtype=1024:1024"); ...
package orm import ( "errors" "fmt" "io" "reflect" "strings" "sync" "time" "github.com/go-pg/pg/internal" "github.com/go-pg/pg/types" ) type withQuery struct { name string query *Query } type Query struct { db DB stickyErr error model tableModel ignoreModel bool with []withQuer...
// Package unsafeslice contains functions for zero-copy casting between typed slices and byte slices. package unsafeslice import ( "reflect" "unsafe" ) // Useful constants. const ( Uint64Size = 8 Uint32Size = 4 Uint16Size = 2 Uint8Size = 1 ) func newRawSliceHeader(sh *reflect.SliceHeader, b []byte, stride int...
package main import ( "crypto/tls" "encoding/json" "errors" "fmt" "github.com/bitly/go-nsq" "github.com/bitly/go-simplejson" "github.com/bitly/nsq/util" "github.com/bitly/nsq/util/lookupd" "io/ioutil" "log" "net" "os" "path" "runtime" "strconv" "strings" "sync" "time" ) type NSQD struct { // 64bit ...
package nv import ( "bytes" "encoding/binary" "errors" "fmt" "io" "reflect" "sort" xdr "github.com/davecgh/go-xdr/xdr2" ) func Encode(i interface{}) ([]byte, error) { if i == nil { return nil, errors.New("can not encode a nil pointer") } v := reflect.ValueOf(i) if !v.IsValid() { return nil, fmt.Erro...
package otto import ( "encoding/json" "fmt" "log" "os" "path/filepath" "strings" "sync" "sync/atomic" "github.com/hashicorp/otto/app" "github.com/hashicorp/otto/appfile" "github.com/hashicorp/otto/context" "github.com/hashicorp/otto/directory" "github.com/hashicorp/otto/foundation" "github.com/hashicorp...
// Copyright (c) 2014 Couchbase, 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 writin...
// Copyright 2014 Volker Dobler. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package ht import ( "bytes" "compress/gzip" "errors" "fmt" "io" "io/ioutil" "log" "math" "mime" "mime/multipart" "net/http" "net/textproto" "net/u...
package gorethink import ( "reflect" "github.com/dancannon/gorethink/types" test "gopkg.in/check.v1" ) /* BEGIN FLOAT HELPERS */ // totally ripped off from math/all_test.go // https://github.com/golang/go/blob/master/src/math/all_test.go#L1723-L1749 func tolerance(a, b, e float64) bool { d := a - b if d < 0 {...
//Command to test application without deploy: //goapp serve app.yaml //Command to deploy/update application: //goapp deploy -application golangnode0 -version 0 package main import ( "bytes" "fmt" "html/template" "io/ioutil" "log" "net/http" "net/smtp" "appengine" "appengine/urlfetch" ) var statusContent st...
package snapshotfs import ( "bytes" "context" "encoding/json" "hash/fnv" "io" "os" "path" "path/filepath" "runtime" "sort" "sync" "sync/atomic" "github.com/pkg/errors" "golang.org/x/sync/errgroup" "github.com/kopia/kopia/fs" "github.com/kopia/kopia/fs/ignorefs" "github.com/kopia/kopia/repo" "github...
package nsqd import ( "bytes" "container/heap" "errors" "log" "math" "strings" "sync" "sync/atomic" "time" "github.com/bitly/nsq/util" "github.com/bitly/nsq/util/pqueue" ) // the amount of time a worker will wait when idle const defaultWorkerWait = 100 * time.Millisecond type Consumer interface { UnPaus...
// Package filters 为过滤器定义. package filters import ( "github.com/astaxie/beego" "github.com/astaxie/beego/context" ) func init() { Authorize := func(ctx *context.Context) { _, ok := ctx.Input.Session("uid").(int) if !ok { ctx.Redirect(302, "/login") } } beego.InsertFilter("/member/*",beego.BeforeRoute...
package host import ( "sync/atomic" "testing" "time" "github.com/NebulousLabs/Sia/modules" ) // blockingPortForward is a dependency set that causes the host port forward // call at startup to block for 10 seconds, simulating the amount of blocking // that can occur in production. // // blockingPortForward will a...
// Copyright 2012, 2013 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package testing import ( "fmt" "os" "runtime" "strings" "time" "github.com/juju/loggo" "github.com/juju/testing" jc "github.com/juju/testing/checkers" "github.com/juju/utils" "github.com/juju/utils/arch" "gi...
// Copyright 2020 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package middlewares import "net/url" // flashes enumerates all the flash types const ( SuccessFlash = "SuccessMsg" ErrorFlash = "ErrorMsg" WarnFlash ...
package bahn // import "github.com/octo/icestat/bahn" import ( "encoding/json" "net/http" "time" ) // PositionURL is the URL of JSONP-encoded information about the train's location and speed. const PositionURL = "http://www.ombord.info/api/jsonp/position/" // Position holds the position of the train as well as so...
// Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. package oci import ( "log" ) const Version = "3.56.0" func PrintVersion() { log.Printf("[INFO] terraform-provider-oci %s\n", Version) } Finalize changelog and release for version v3.57.0 // Copyright (c) 2017, 2019, Oracle and/or it...
// Copyright 2014 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package upgrades import ( "fmt" "launchpad.net/juju-core/environs/config" "launchpad.net/juju-core/state" ) func updateRsyslogPort(context Context) error { agentConfig := context.AgentConfig() info, ok := agentConfig.S...
package file import ( "io" "io/ioutil" "os" "path/filepath" "github.com/cosiner/gohper/errors" "github.com/cosiner/gohper/io2" ) const ErrDestIsFile = errors.Err("destnation is a file") // FileOpFunc accept a file descriptor, return an error or nil type FileOpFunc func(*os.File) error // Open file use given ...
// Copyright 2018 The ACH Authors // Use of this source code is governed by an Apache License // license that can be found in the LICENSE file. package ach import ( "testing" ) // mockBatchSHRHeader creates a BatchSHR BatchHeader func mockBatchSHRHeader() *BatchHeader { bh := NewBatchHeader() bh.ServiceClassCode ...
package jo // Parsing events. type Event int const ( None = iota SyntaxError ObjectStart ObjectEnd KeyStart KeyEnd ArrayStart ArrayEnd StringStart StringEnd NumberStart NumberEnd BoolStart BoolEnd NullStart NullEnd ) // Parser states. const ( _StateValue = iota _StateObjectKeyOrEnd // { _Stat...
/* (c) Copyright [2021] Hewlett Packard Enterprise Development LP 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 o...
package datadog import ( "container/ring" "context" "fmt" "net/http" "strings" "sync" "time" "github.com/DataDog/datadog-go/statsd" "github.com/sirupsen/logrus" vhttp "github.com/stripe/veneur/http" "github.com/stripe/veneur/protocol" "github.com/stripe/veneur/samplers" "github.com/stripe/veneur/sinks" ...
/* 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...
package packer import ( "fmt" "sort" multierror "github.com/hashicorp/go-multierror" version "github.com/hashicorp/go-version" "github.com/hashicorp/packer/template" "github.com/hashicorp/packer/template/interpolate" ) // Core is the main executor of Packer. If Packer is being used as a // library, this is the...
/* 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 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. // godoc: Go Documentation Server // Web server tree: // // http://godoc/ main landing page // http://godoc/doc/ serve from $GOROOT/doc - spec, mem, tutorial,...
/* 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, ...
package waveform import ( "fmt" "image/color" "testing" ) // TestOptionsError verifies that the format of OptionsError.Error does // not change. func TestOptionsError(t *testing.T) { var tests = []struct { option string reason string }{ {"foo", "bar"}, {"baz", "qux"}, {"one", "two"}, } for _, test :...
package osc import ( "bufio" "bytes" "io" "net" "reflect" "sync" "testing" "time" ) func TestMessage_Append(t *testing.T) { oscAddress := "/address" message := NewMessage(oscAddress) if message.Address != oscAddress { t.Errorf("OSC address should be \"%s\" and is \"%s\"", oscAddress, message.Address) } ...
/* SPDX-License-Identifier: MIT Copyright (c) 2017 Thanh Ha Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modif...
package main import ( "os" "os/exec" "path/filepath" "reflect" "testing" ) var sourceURITests = []struct { src string dst string }{ //Full URI { "https://github.com/sunaku/vim-unbundle", "https://github.com/sunaku/vim-unbundle", }, //Short GitHub URI { "Shougo/neobundle.vim", "https://github.com/...
package packer import ( "fmt" "log" "sync" ) const ( // This is the key in configurations that is set to the name of the // build. BuildNameConfigKey = "packer_build_name" // This is the key in the configuration that is set to the type // of the builder that is run. This is useful for provisioners and // su...
package main import ( "fmt" "github.com/bradfitz/slice" ct "github.com/daviddengcn/go-colortext" . "github.com/timob/ls/lib" "github.com/timob/sindex" "log" "os" "path" "strconv" "strings" "time" "github.com/dustin/go-humanize" ) type DisplayEntry struct { path string os.FileInfo } type DisplayEntryLis...
package main import ( "os" "github.com/timob/list" "fmt" "log" "strings" "syscall" "unsafe" "path" "github.com/bradfitz/slice" ) type DisplayEntry struct { path string os.FileInfo } type DisplayEntryList struct { Data []DisplayEntry list.Slice } func getTermSize() (int, int, error) { var dimensions [4...
// Copyright (C) 2014 The Syncthing Authors. // // 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 model import ( "os" "path/filepath" "testing" "time" "...
package levelmu import ( "sync" ) type LevelMutex struct { mus []sync.Mutex // Protected by the very last mutex. lastLevel int } func (lm *LevelMutex) Init(levels int) { if lm.mus != nil { panic("level mutex already initialized") } lm.mus = make([]sync.Mutex, levels) } func (lm *LevelMutex) Lock() { lm.Le...
package rocserv import ( "context" "encoding/json" "fmt" "net/http" "strings" "gitlab.pri.ibanyu.com/middleware/seaweed/xcontext" "gitlab.pri.ibanyu.com/middleware/seaweed/xlog" "gitlab.pri.ibanyu.com/middleware/seaweed/xtrace" "github.com/uber/jaeger-client-go" ) const ( TrafficLogID = "TRAF...
// Package mailtoweb returns the webmail URL related to a an email address. // // It can be used in web apps for a better user experience, by providing a direct link to user's webmail from his email address, after a subscription for example. package mailtoweb import "strings" var relations = map[string]string{ "@gma...
package main import ( "fmt" "github.com/nevon/gogel" "strings" ) func main() { // body := gogel.NewElementNode("body", make(map[string]string), []gogel.Node{}) // body.Children = append(body.Children, gogel.NewElementNode("div", map[string]string{"id": "test"}, []gogel.Node{})) // Walk(body, 0) doc := "<html...
package pgxpool import ( "context" "fmt" "math/rand" "runtime" "strconv" "sync" "sync/atomic" "time" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/puddle/v2" ) var defaultMaxConns = int32(4) var defaultMinConns = int32(0) var defaultMaxConnLifetime = time.Hour var defaultMax...
/* Copyright 2022 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 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...
// 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 main import ( "os" "path/filepath" "runtime" "testing" ) func TestFindRoot(t *testing.T) { wd, err := os.Getwd() if err != nil { t.Fatal(err) ...
package main import ( "io/ioutil" "os" "strings" "sync" "testing" ) func TestPrintMatchingLines(t *testing.T) { tests := []struct { pattern string file string matchYes []string // matching lines expected to contain these strings matchNo []string // matching lines are not expected to contain these ...
package main_test import ( . "github.com/reaandrew/code-named-something" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "net/http" "io/ioutil" "os" "os/exec" "path/filepath" ) var _ = Describe("Main", func() { It("Makes a http get request to each url in a file", func() { port := 8000 list := `htt...
package main import ( "os" "reflect" "regexp" "strings" "testing" "gopkg.in/ini.v1" ) func init() { RegexpUrlTwitter, _ = regexp.Compile(REGEXP_URL_TWITTER) RegexpUrlTistory, _ = regexp.Compile(REGEXP_URL_TISTORY) RegexpUrlTistoryWithCDN, _ = regexp.Compile(REGEXP_URL_TISTORY_WITH_CDN) RegexpUrlGfycat, _ =...
package main import ( "flag" "fmt" "os" "path/filepath" "time" "github.com/igneous-systems/logit" "github.com/igneous-systems/pickett" "github.com/igneous-systems/pickett/io" ) func contains(s []string, target string) bool { for _, candidate := range s { if candidate == target { return true } } re...
package lock import ( "fmt" "github.com/jfrog/jfrog-client-go/utils/io/fileutils" "math" "os" "testing" "time" ) /* The lock mechanism prefers earlier lock requests. If two locks requests have same time stamps, it'll take the one with the smaller PID first. Here we test the functionality of a real process wit...
package make import ( "bufio" "database/sql" "fmt" log "github.com/Sirupsen/logrus" "github.com/fubarhouse/golang-drush/command" _ "github.com/go-sql-driver/mysql" // mysql is assumed under this system (for now). "io/ioutil" "os" "os/exec" "path/filepath" "strings" "time" ) // ReplaceTextInFile is a utili...
package main import ( "crypto/tls" "errors" "flag" "io" "log" "net" "time" bsc "github.com/muyuballs/bsc/v2" "github.com/muyuballs/bsc/v2/ben" ) var serverAddr = flag.String("server", "", "bsc server addr") var domain = flag.String("domain", "", "service public domain") var rhost = flag.String("rhost", "", ...
package api import ( "context" "fmt" "github.com/Aptomi/aptomi/pkg/lang" "github.com/Aptomi/aptomi/pkg/runtime" "github.com/dgrijalva/jwt-go" jwtreq "github.com/dgrijalva/jwt-go/request" "github.com/julienschmidt/httprouter" "net/http" "time" ) // AuthSuccessObject contains Info for the AuthSuccess type var ...
/******************************************************************************* * * Copyright 2017 SAP SE * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You should have received a copy of the License along with this * program. If...
// Copyright The OpenTelemetry 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 ag...
// Copyright 2017 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 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. // A package for arbitrary precision arithmethic. // It implements the following numeric types: // // - Natural unsigned integers // - Integer signed integers /...
// Copyright 2015 Dorival de Moraes Pedroso. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package goga import ( "math" "github.com/cpmech/gosl/rnd" ) // de_operator performs the differential-evolution operation func de_operator(u, x, ...
package client import ( "doozer/proto" "doozer/util" "encoding/binary" "fmt" "log" "net" "io" "os" pb "goprotobuf.googlecode.com/hg/proto" "sync" ) const ( Valid = 1 << iota Done ) var lg = util.NewLogger("client") var ( ErrNoAddrs = os.NewError("no known address") ) type ResponseError struct { Code...
// Copyright 2011 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 build import ( "errors" "fmt" "log" "os" "path/filepath" "runtime" ) // Path is a validated list of Trees derived from $GOROOT and $GOPATH at i...
package youtubedl import ( "context" "encoding/json" "os" "testing" "github.com/wader/ydls/leaktest" ) var testNetwork = os.Getenv("TEST_NETWORK") != "" var testYoutubeldl = os.Getenv("TEST_YOUTUBEDL") != "" func TestParseInfo(t *testing.T) { if !testNetwork || !testYoutubeldl { t.Skip("TEST_NETWORK, TEST_Y...
package jose import ( "bytes" "crypto" "crypto/hmac" _ "crypto/sha256" "errors" "fmt" ) type VerifierHMAC struct { KeyID string Hash crypto.Hash Secret []byte } type SignerHMAC struct { VerifierHMAC } func NewVerifierHMAC(jwk JWK) (*VerifierHMAC, error) { if jwk.Alg != "" && jwk.Alg != "HS256" { ret...
package object import ( "testing" . "github.com/Zac-Garby/pluto/object" ) func TestStringer(t *testing.T) { var ( n1 = &Number{Value: 0} n2 = &Number{Value: 1} s1 = &String{Value: "foo"} s2 = &String{Value: "bar"} c1 = &Char{Value: 'x'} c2 = &Char{Value: 'y'} a0 = &Array{Value: []Object{}} a1 =...
package utils //Sieve uses a sieve of Arosthesis to fill a slice of primes up to n func Sieve(amount int) []int { //fill a slice on 1..n n := make([]int, amount-1) for i := range n { n[i] = i + 2 } //Starting number for the tests number := 2 //stop at sqrt(highest prime we will get) for number*number <= len(...
package lnwallet import ( "crypto/sha256" "fmt" "net" "sync" "sync/atomic" "github.com/davecgh/go-spew/spew" "github.com/lightningnetwork/lnd/chainntnfs" "github.com/lightningnetwork/lnd/channeldb" "github.com/roasbeef/btcd/chaincfg" "github.com/roasbeef/btcutil/hdkeychain" "github.com/lightningnetwork/ln...
package opts import ( "fmt" "net" "os" "path" "regexp" "strings" "github.com/docker/docker/pkg/parsers" "github.com/docker/docker/volume" ) var ( alphaRegexp = regexp.MustCompile(`[a-zA-Z]`) domainRegexp = regexp.MustCompile(`^(:?(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]))(:?\.(:?[a-zA-Z0-9]|...
package opts import ( "fmt" "net" "regexp" "strings" "github.com/docker/engine-api/types/filters" ) var ( alphaRegexp = regexp.MustCompile(`[a-zA-Z]`) domainRegexp = regexp.MustCompile(`^(:?(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9]))(:?\.(:?[a-zA-Z0-9]|(:?[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])))*...
package brimstore import ( "bytes" "encoding/binary" "errors" "fmt" "io" "log" "math" "os" "runtime" "sort" "strconv" "strings" "sync/atomic" "time" "github.com/gholt/brimutil" "github.com/spaolacci/murmur3" ) var ErrValueNotFound error = errors.New("value not found") // ValuesStoreOpts allows confi...
package gonx import ( "io/ioutil" "strings" ) type NXFile struct { FileName string Raw []byte Header Header } func New(fileName string) (NX *NXFile) { buffer, err := ioutil.ReadFile(fileName) pError(err) NX = new(NXFile) NX.FileName = fileName NX.R...
package cluster import ( "net" "strings" "sync/atomic" "github.com/gallir/radix.improved/redis" "github.com/gallir/smart-relayer/lib" ) const ( requestBufferSize = 32 ) type connHandler struct { initialized bool seq uint64 last uint64 srv *Server conn net.Conn reqCh c...
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // licence that can be found in the LICENSE file. // This file contains the implementation of the 'gomovepkg' command // whose main function is in golang.org/x/tools/cmd/gomovepkg. package rename // TODO(matl...
// Copyright 2019 The Go Cloud Development Kit 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by appli...
// Copyright (c) 2014, Rob Thornton // All rights reserved. // This source code is governed by a Simplied BSD-License. Please see the // LICENSE included in this distribution for a copy of the full license // or, if one is not included, you may also find a copy at // http://opensource.org/licenses/BSD-2-Clause package...
package libxml2 import ( "regexp" "testing" "github.com/lestrrat/go-libxml2/parser" "github.com/stretchr/testify/assert" ) const stdXMLDecl = `<?xml version="1.0"?>` + "\n" var ( goodWFNSStrings = []string{ stdXMLDecl + `<foobar xmlns:bar="xml://foo" bar:foo="bar"/>` + "\n", stdXMLDecl + `<foobar xmlns="xm...
// 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 ( "fmt" "net" "sync" "time" "github.com/keybase/backoff" "github.com/keybase/client/go/libkb" "github.com/keybase/client/go/protocol/keyb...
// 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 ( "context" "sync" "testing" "time" "github.com/keybase/go-codec/codec" "github.com/stretchr/testify/require" ) func makeRandomBlockInfo(...
package paths import ( "fmt" "os" "path/filepath" "regexp" "strings" "github.com/VonC/godbg" ) // Path represents a path always '/' separated. // Either filename or http://... type Path struct { path string } // NewPath creates a new path. // If it is a folder, it will end with a trailing '/' func NewPath(p ...
// 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 throttler import ( "fmt" "os/exec" "strconv" "strings" "syscall" ) const ( tcRootQDisc = `dev %s handle 10: root` tcDefaultClass = `dev %s parent 10: classid 10:1` tcTargetClass = `dev %s parent 10:1 classid 10:10` tcNetemRule = `dev %s parent 10:10 handle 100:` tcRate = `rate %vkbit`...
// Copyright 2014 Damjan Cvetko. All rights reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. package pcapgo import ( "encoding/binary" "errors" "fmt" "io" "time" "github.com/google/gopacket" "github.com/googl...