blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
3e55de04ec6931ef469175b21bfb45e8a2dbca8c | 01bbd642a83581a5606f0bbfa4c724a34ce51e6a | vivimouret29/pulumi-azure-native | /sdk/go/azure/compute/v20190301/galleryImageVersion.go | Go | go | 6,000 | permissive |
package v20190301
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type GalleryImageVersion struct {
pulumi.CustomResourceState
Location pulumi.StringOutput `pulumi:"location"`
Name pulumi.StringOutput ... |
a656d70c47b01ed0074d289b7dcd372881c273fc | 23855f5785da6dbbe279228e28341942173a94c0 | enterpriseih/go-redis | /internal/proto/scan.go | Go | go | 3,177 | permissive | package proto
import (
"encoding"
"fmt"
"reflect"
"github.com/VilsonYuan/go-redis/internal/util"
)
func Scan(b []byte, v interface{}) error {
switch v := v.(type) {
case nil:
return fmt.Errorf("redis: Scan(nil)")
case *string:
*v = util.BytesToString(b)
return nil
case *[]byte:
*v = b
return nil
c... |
43df51a19bbd20a0cb25900c98f2fa26d26e39ef | c2595f83610a86a1f976a5e1e7c22e5f61b07229 | sylzd/dumpling | /v4/log/log.go | Go | go | 2,126 | permissive | package log
import (
"github.com/pingcap/errors"
pclog "github.com/pingcap/log"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var (
appLogger = Logger{zap.NewNop()}
appLevel = zap.NewAtomicLevel()
)
type Logger struct {
*zap.Logger
}
// Zap returns the global logger.
func Zap() Logger {
return appLogger
}
... |
07fc82c10ce4d6ac3cd01bcad6b18e0541c249fa | e47eda7784515ba79ae0475c4e43e1a12cedbd83 | deitch/packngo | /plans.go | Go | go | 4,089 | permissive | package packngo
import "path"
const planBasePath = "/plans"
// PlanService interface defines available plan methods
type PlanService interface {
List(*ListOptions) ([]Plan, *Response, error)
ProjectList(string, *ListOptions) ([]Plan, *Response, error)
OrganizationList(string, *ListOptions) ([]Plan, *Response, err... |
efd92de6b51a7caf7bad8dcdffd8a6e4e615969e | 6b9dc760705043c7c5f7561ece635760a77c0e9a | gotomicro/micro | /mygrpc/resolver/dns/dns.go | Go | go | 614 | no_license | package dns
import (
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/resolver/dns"
)
func RegisterResolver() {
resolver.Register(&ResolverBuilder{})
}
type ResolverBuilder struct {
closed bool
}
func (b *ResolverBuilder) ResolveNow(resolver.ResolveNowOption) {
}
func (b *ResolverBuilder) Close() {
b... |
fb370ed2e020a89f7050cfbddb36707347d192e3 | 40fb19ee3ef8db29f71bdb652b302dda51d3d212 | muun/recovery | /vendor/github.com/btcsuite/btcwallet/walletdb/interface.go | Go | go | 12,899 | permissive | // Copyright (c) 2014 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
// This interface was inspired heavily by the excellent boltdb project at
// https://github.com/boltdb/bolt by Ben B. Johnson.
package walletdb
import (
"fmt"
"io"
)
// ... |
6965f1d0ba020cf3292629c50436ad396a619a20 | 74b61dcbdb82905e445d13c5b3bc2215e773d303 | f2130793/go-gin-example | /routers/router.go | Go | go | 1,645 | permissive | package routers
import (
"net/http"
"github.com/gin-gonic/gin"
"ginReact/pkg/export"
"ginReact/pkg/qrcode"
"ginReact/pkg/upload"
"ginReact/routers/api"
"ginReact/routers/api/v1"
_ "github.com/EDDYCJY/go-gin-example/docs"
"github.com/swaggo/gin-swagger"
"github.com/swaggo/gin-swagger/swaggerFiles"
)
// Ini... |
344fe36f8a1fa4a313c02fcf9fd8cc0cdd3ca809 | 487f52143148d18fc728e5bcbb8f1b4101a550d9 | NguyenTheAnhBK/hydra | /vendor/github.com/instana/go-sensor/w3ctrace/context.go | Go | go | 3,056 | permissive | // (c) Copyright IBM Corp. 2021
// (c) Copyright Instana Inc. 2020
package w3ctrace
import (
"errors"
"net/http"
"strings"
)
const (
// MaxStateEntries is the maximum number of items in `tracestate` as defined by
// https://www.w3.org/TR/trace-context/#tracestate-header-field-values
MaxStateEntries = 32
// T... |
8e84cf59fc1d31388ad2d39e360024bda2639cba | d34be07478e5ed52ce8ce9f422545c186bf3b860 | monasuite/lnd | /lntest/itest/lnd_single_hop_invoice_test.go | Go | go | 6,754 | permissive | package itest
import (
"bytes"
"context"
"encoding/hex"
"time"
"github.com/btcsuite/btcd/btcutil"
"github.com/davecgh/go-spew/spew"
"github.com/monasuite/lnd/lnrpc"
"github.com/monasuite/lnd/lnrpc/routerrpc"
"github.com/monasuite/lnd/lntest"
"github.com/monasuite/lnd/lntest/wait"
"github.com/monasuite/lnd/... |
f38fca738f2355276eed5c8770039adc664514b2 | 9abf9ba4460028ef0386ea91832dec5516a199ae | justdueck/sourcegraph | /enterprise/internal/codeintel/uploads/internal/background/job_worker_handler_test.go | Go | go | 15,390 | permissive | package background
import (
"context"
"crypto/sha256"
"encoding/base64"
"io"
"os"
"sort"
"strings"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"github.com/sourcegraph/log/logtest"
"github.com/sourcegraph/scip/bindings/go/scip"
"google.golang.org/protobuf/proto"
"github.com/sourcegraph/sourcegraph/c... |
fa3da37a5a9caf7a468b6f33d8d45b3672c5cd8c | 4dc18487dbd2b80e0005e6b852f1722ed9155ff6 | monoculum/valider | /string.go | Go | go | 2,283 | permissive | package valider
import (
"regexp"
"time"
)
type Str struct {
value string
field string
errors Errors
}
func (v *Validator) Str(value, field string) *Str {
return &Str{value, field, v.Errors}
}
func (str *Str) Required() *Str {
if str.value == "" {
str.errors[str.field] = append(str.errors[str.field], Err... |
a31165245edbc114a28a0c20e69ed586815c5faa | fcdbb9eb2209e6a119eb2c79fd0bd684fdc69db5 | jhump/google-cloud-go | /internal/generated/snippets/pubsub/Subscription/SeekToTime/main.go | Go | go | 1,065 | permissive | // Copyright 2021 Google LLC
//
// 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 ... |
aba494e843e285b400d23f60ffb7205653aa7c2a | bae9304caf52199b50eef0b3031ebae3d3008c6e | dkfbasel/jsonwrapper | /marshalling_test.go | Go | go | 2,060 | permissive | package jsonwrapper
import (
"bytes"
"fmt"
"testing"
)
func TestToJsonBytes(t *testing.T) {
data := []string{"test", "data"}
expectedJson := `{"code":200,"status":"success","data":["test","data"]}`
response := Success(data)
asJson, err := ToJsonBytes(&response)
if err != nil {
t.Error("Expected error to b... |
2bf252d9fa87ed85719ee0295210f88b79a5b27d | 480ecfa6d8a69f865265e0dd614a372cfa2ef967 | amay0048/mtparser | /mtparser_test.go | Go | go | 2,413 | no_license | package main_test
import (
"bufio"
"fmt"
"os"
"testing"
"github.com/amay0048/mtparser/mtparser"
"github.com/amay0048/mtparser/mtserializer"
)
func check(e error) {
if e != nil {
panic(e)
}
}
func readerTest(nm string) mtparser.Parser {
file, err := os.Open(nm)
check(err)
defer file.Close()
r := bufio... |
4d61a226d1eb2eb71acf8760d3c05ed4fb072f92 | a445d11e194cb818f752fd8da400985703a0f68e | wenwu449/vsts-pr | /vsts/item.go | Go | go | 797 | no_license | package vsts
import (
"strings"
)
func getBranchItemURL(branch string, itemPath string) string {
itemURLTemplate := "https://{instance}/DefaultCollection/{project}/_apis/git/repositories/{repository}/items?api-version={version}&versionType={versionType}&version={versionValue}&scopePath={itemPath}&lastProcessedChang... |
4e97074768cff41524d415b488121e4184eaabf9 | 61fac9d1e38a3081688adba888c0555cde73dc36 | shangsony/fabric_sdk_golang | /core/chaincode/exectransaction_test.go | Go | go | 50,894 | permissive | /*
Copyright IBM Corp. 2016 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 to in wri... |
b978c3b8bab556512697da1387653331ca5a4f20 | 56fc41050426db9e29b13db8c6c3f90563645ea0 | filipi86/horusec-platform | /core/internal/usecases/repository/repository_test.go | Go | go | 8,483 | permissive | // Copyright 2021 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA
//
// 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... |
2652fcc861d455675fe7965f238ded8675450f2a | b57b21b593c10d0dbf7b98d0f8940ffd5da33115 | minienv/minienv-api-core | /session.go | Go | go | 270 | no_license | package minienv
type SessionStore interface {
SetSession(id string, session *Session) (error)
GetSession(id string) (*Session, error)
}
type Session struct {
Id string `json:"sessionId"`
EnvId string `json:"envId"`
EnvServiceName string `json:"envServiceName"`
} |
022f68b1452946ca8e232029e1f67638095d7458 | 356b31ce60b55bec87ac8644e633e396ec47f734 | Vorringer/oci-go-sdk | /rover/create_rover_cluster_request_response.go | Go | go | 3,350 | permissive | // Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
96071acc3aa393fa07903fde31ea058bba7d1113 | d93f5424e0a4c683b28f12a1ffacc82abc8ecb54 | benbalter/git-lfs | /httputil/http.go | Go | go | 8,945 | permissive | // Package httputil provides additional helper functions for http services
// NOTE: Subject to change, do not rely on this package from outside git-lfs source
package httputil
import (
"bufio"
"bytes"
"crypto/tls"
"errors"
"fmt"
"io"
"net"
"net/http"
"net/http/httputil"
"os"
"path/filepath"
"strings"
"syn... |
6fe6714e2e9a4fc0952644e578150e3c134b4531 | e916181be48061887d2dde246c914b794bee4439 | botherder/go-removal | /process.go | Go | go | 1,331 | permissive | package removal
import (
"time"
"errors"
"github.com/shirou/gopsutil/process"
)
func FindProcessByName(name string) ([]int32, error) {
var matches []int32
// We loop over all processes.
pids, err := process.Pids()
if err != nil {
return matches, err
}
for _, pid := range(pids) {
// Open process handle.... |
9bd1000c950a5458abce3ddc8e1aaa80d241b8bf | 1d36146afac8df59ecb7eb79fbdf7ffa5e322cb1 | kfchen81/beego | /cache/ssdb/ssdb.go | Go | go | 4,635 | permissive | package ssdb
import (
"encoding/json"
"errors"
"strconv"
"strings"
"time"
"github.com/ssdb/gossdb/ssdb"
"github.com/kfchen81/beego/cache"
)
// Cache SSDB adapter
type Cache struct {
conn *ssdb.Client
conninfo []string
}
//NewSsdbCache create new ssdb adapter.
func NewSsdbCache() cache.Cache {
return ... |
13aafdc9a949df597e40eb865cbbb78a11758f7f | 79f7bcddf4364bfac8f66ec25d97d881f2a17b6c | Start9Labs/filebrowser | /storage/storage.go | Go | go | 486 | permissive | package storage
import (
"github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/v2/share"
"github.com/filebrowser/filebrowser/v2/users"
)
// Storage is a storage powered by a Backend which makes the necessary
// verifications when fetching... |
5aa49f07d034d5ece753ba5b4134e7792d5b7d5b | 468441b6879876947e43a370442633193b871a04 | FactomProject/serveridentity | /handlers/get.go | Go | go | 5,854 | permissive | package handlers
import (
"flag"
"fmt"
"github.com/FactomProject/btcutil/base58"
"github.com/FactomProject/cli"
ed "github.com/FactomProject/ed25519"
"github.com/FactomProject/serveridentity/identity"
"os"
"strconv"
"strings"
)
/********************************
* Cli Control *
************... |
7cb6835070a09f57de98b31e564a890c893374fc | b10538da32400c80d4055bb64fe8ef0ab1098006 | unittolabs/nohi | /cmd/pwd.go | Go | go | 969 | permissive | package cmd
import (
"github.com/spf13/cobra"
"gitlab.com/unitto/nohi/internal/utils"
"gitlab.com/unitto/nohi/pkg/adapter"
"gitlab.com/unitto/nohi/pkg/pwd"
)
var (
length uint
upper bool
digit bool
special bool
)
func init() {
rootCmd.AddCommand(pwdCmd)
pwdCmd.Flags().UintVarP(&length, "length", "l",... |
c5e10c7599e7561917f42101978b93b496e1733a | 898e61c0a3674e31a69a537a4adce41dbf3c33f4 | niandaoma/go_bookStore | /bookStore/model/orderItem.go | Go | go | 495 | no_license | package model
//订单项
type OrderItem struct {
OrderItemId int //订单项的id
Count int //订单项中图书的数量
Amount float64 //订单项下中图书的总金额
Title string //订单项图书的书名
Author string //订单项图书的作者
Price float64 //订单项图书的价格
ImgPath string //订单项图书的图片地址
OrderId string //订单项所属的订单id
IsEnough ... |
4a2bcc415bca1cb3488e715f3e0dccde4573a848 | f86b62665aa68bf5c37fdd4ffd324e209409a54e | retgits/fgen | /cmd/devicecreate.go | Go | go | 2,975 | permissive | // Package cmd defines and implements command-line commands and flags
// used by flogo. Commands and flags are implemented using Cobra.
package cmd
import (
"fmt"
"os"
"path/filepath"
"github.com/retgits/fgen/device"
"github.com/retgits/fgen/fgutil"
"github.com/spf13/cobra"
)
// deviceCreateCmd represents the... |
48c222f7f4d56590027a083219c5574f4a98fe27 | b7e839f0b7fbf222fa06e90fc169616065e49168 | philpearl/goslacksender | /sender.go | Go | go | 2,894 | permissive | // goslacksender is a very simple API to send messages to a Slack channel.
// Messages are queued to a background go routine so the call does not block.
package goslacksender
import (
"bytes"
"encoding/json"
"log"
"net/http"
)
const (
// The size of the queue to the background goroutine
channel_size int = 100
)... |
89e9ec4d919ef4b86ce10c76f334c911f33d8b89 | d015881dae851e9fb66fe14e5d75b77e2124836d | google/gapid | /core/langsvr/textedit.go | Go | go | 1,935 | permissive | // Copyright (C) 2017 Google 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 t... |
60de22b730736b7a93631136c9a36ee2acb8831f | 3faf9b3fa3423101f05078c4ac3072e21a615bd6 | keycloak/keycloak-operator | /pkg/controller/add_keycloakclient.go | Go | go | 280 | permissive | package controller
import (
"github.com/keycloak/keycloak-operator/pkg/controller/keycloakclient"
)
func init() {
// AddToManagerFuncs is a list of functions to create controllers and add them to a manager.
AddToManagerFuncs = append(AddToManagerFuncs, keycloakclient.Add)
}
|
a5d8da3dcb1e0b11cd227d5f83b13f3e6e737d26 | f3f27d314170ab737c9551f33424c0157a7f30b9 | f/koding | /go/src/github.com/mitchellh/packer/builder/parallels/pvm/config.go | Go | go | 3,105 | permissive | package pvm
import (
"fmt"
"os"
parallelscommon "github.com/mitchellh/packer/builder/parallels/common"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/helper/config"
"github.com/mitchellh/packer/packer"
"github.com/mitchellh/packer/template/interpolate"
)
// Config is the configuration struc... |
b42cdce5be0a834a0069885b75ba64c3f83ad38a | f01c09a2b6451c30277f36ae65a9b04a60f9feeb | openhealthcareca/openhealthcare.ca | /DiscussionHandlers.go | Go | go | 1,338 | permissive | package main
import (
"github.com/martini-contrib/render"
"github.com/mholt/binding"
"net/http"
)
type DiscussionHandlers struct{}
func (d DiscussionHandlers) index(r render.Render, req *http.Request) {
ds := new(Discussions)
data := struct {
Request *http.Request
MenuItem string
SubMenuItem stri... |
12fb8bb2fdf96538821b62165b054e52817eaee7 | 8858ce917ad4e5fb7502f34a2a116127fb8c1637 | tet3/docset-sfdc | /SFDashC/main.go | Go | go | 8,583 | permissive | package main
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"strings"
"sync"
)
// CSS Paths
var cssBasePath = "https://developer.salesforce.com/resource/stylesheets"
var cssFiles = []string{"holygrail.min.css", "docs.min.css", "syntax-highlighter.min.css"}
var wg syn... |
871365bddf66afdbd460c4ed2e00323cfa15972d | 316e1966598c56553c798a4f89857770a97c2743 | Charlotte1990/pouch | /daemon/mgr/volume.go | Go | go | 3,765 | permissive | package mgr
import (
"context"
"os"
"path"
"strings"
"github.com/alibaba/pouch/daemon/meta"
"github.com/alibaba/pouch/volume"
"github.com/alibaba/pouch/volume/types"
)
// VolumeMgr defines interface to manage container volume.
type VolumeMgr interface {
// Create is used to create volume.
Create(ctx context... |
7841bfe761e59a03d572b7f2f8f3c2b88e67e845 | 5ea65a5cf5f48da7d8ba8c4d0ac4f5e33b102e24 | zaibon/zos | /pkg/kernel/kernel.go | Go | go | 1,253 | permissive | package kernel
import (
"io/ioutil"
"strings"
"github.com/rs/zerolog/log"
"github.com/google/shlex"
)
// Params represent the parameters passed to the kernel at boot
type Params map[string][]string
// Exists checks if a key is present in the kernel parameters
func (k Params) Exists(key string) bool {
_, ok :=... |
513ed0d1b138442f52ce49224548d5d5ca0e07b4 | 699caec90efb2e9e8d03e82b371616a348c683c7 | lxok/jvm_go | /src/ch05/instructions/references/athrow.go | Go | go | 706 | no_license | package references
import (
"ch05/instructions/base"
"ch05/jvm/rtda"
)
// Throw exception or error
type ATHROW struct{ base.NoOperandsInstruction }
func (self *ATHROW) Execute(frame *rtda.Frame) {
ex := frame.OperandStack().PopRef()
if ex == nil {
frame.Thread().ThrowNPE()
return
}
thread := frame.Thread()... |
8bdac58a3f334740b47581eabcd34429c7ac6142 | 506ca6c4fe738e509d74d20ff76328a11b4bfc20 | ego008/gist | /src/go/snowflake.go | Go | go | 2,374 | permissive | // Package snowflake implements Sonyflake, a distributed unique ID generator inspired by Twitter's Snowflake.
//
// A Snowflake ID is composed of
// 39 bits for time in units of 10 msec
// 8 bits for a sequence number
// 16 bits for a machine id
package snowflake
import (
"errors"
"log"
"sync"
"time"
... |
35a9b9b1c1aab86426be4fc967a2ae60a0e42fc1 | 4db81c9bbe73fa81bf6da056882b21f3a2ee8c0d | monitoror/monitoror | /monitorables/ping/api/models/params_faker.go | Go | go | 431 | permissive | //+build faker
package models
import (
"github.com/monitoror/monitoror/internal/pkg/monitorable/params"
coreModels "github.com/monitoror/monitoror/models"
)
type (
PingParams struct {
params.Default
Hostname string `json:"hostname" query:"hostname" validate:"required"`
Status coreModels.TileStatus `j... |
a6f84bcc75a25086975479b29d23cd8ce8349f0a | 2ec756791ab30e192b2674836fe7b438701a4c81 | muditsaurabh/tidb | /plan/logical_plans.go | Go | go | 7,209 | permissive | // Copyright 2016 PingCAP, 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 i... |
71fb2e002ae38de3673540e6dd07c4173fc16442 | c1f68a27aeba4e8090b8cef218d2f544c5de04ac | nrichman/GolangSamples | /udemy-projects/cards/deck.go | Go | go | 1,338 | no_license | package main
import (
"fmt"
"io/ioutil"
"math/rand"
"os"
"strings"
"time"
)
// Create a new type of 'deck'
// Which is a slice of strings
type deck []string // This kind of 'extends' a slice of string
func newDeck() deck {
cards := deck{}
cardSuits := []string{"Spades", "Hearts", "Diamonds", "Clubs"}
cardV... |
69e2fa32f7a7530973c6e5cd30752071ad604bfb | 1f3c2a3730e0e9a2635099d8a9a4f6485366f3d0 | bububa/opentaobao | /model/tvupadmin/YunosTvpubadminDeviceYksBotsAPIRequest.go | Go | go | 1,104 | permissive | package tvupadmin
import (
"net/url"
"github.com/bububa/opentaobao/model"
)
// YunosTvpubadminDeviceYksBotsAPIRequest 获取设备列表 API请求
// yunos.tvpubadmin.device.yks.bots
//
// 获取设备列表
type YunosTvpubadminDeviceYksBotsAPIRequest struct {
model.Params
}
// NewYunosTvpubadminDeviceYksBotsRequest 初始化YunosTvpubadminDevic... |
fc289e835d6387f276881c1d790555e34f647655 | cf56cdbe899ec12ec4a6623b0665c9e83d32bc39 | nicecapj/toy_io_server | /src/toy_io_testClient/client.go | Go | go | 6,070 | no_license | package main
import (
Network "network"
"log"
"math/rand"
"packet_lobby"
LobbyPacket "packet_lobby"
PROTOCOL "packet_protocol"
RETURNCODE "packet_returncode"
"reflect"
"time"
"util"
"github.com/golang/protobuf/proto"
)
// ClientSession is session + logic packet
type ClientSession struct {
*Network.Sessio... |
9893ffe5b8066455216767d758c99d315ff394a8 | d657ab4c80219c99f15965ce36cf87577707e89b | schollz/beacon | /store/store_test.go | Go | go | 3,107 | no_license | package store
import (
"crypto"
"crypto/ecdsa"
"crypto/x509"
"encoding/base64"
"fmt"
"io"
"math/rand"
"os"
"reflect"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var (
signer *testSigner
reader *testReader
bitGen *testReader
)
func init() {
// Sample... |
ae90bc99695b551e534977635e41b9121d93e9c4 | aa5f933fbd93d5ad4184ff7eee26e5e0a1a10079 | donpark/ion-sfu | /pkg/sfu/twcc.go | Go | go | 8,304 | permissive | package sfu
import (
"encoding/binary"
"math"
"math/rand"
"sort"
"sync"
"github.com/gammazero/deque"
"github.com/pion/rtcp"
)
const (
baseSequenceNumberOffset = 8
packetStatusCountOffset = 10
referenceTimeOffset = 12
tccReportDelta = 1e8
tccReportDeltaAfterMark = 50e6
)
type rtpExtInfo s... |
bde90c84296a088c9533ebda934144dc5d47f39f | c17f98ee322644481e83d81d97f7401b0b951650 | mgoltzsche/ktransform | /pkg/transform/convert_test.go | Go | go | 1,660 | permissive | package transform
import (
"testing"
"github.com/stretchr/testify/require"
)
var (
testInputStringMap = map[string]string{
"str": "value1",
"num": "7",
"obj": "prop: x",
}
testInputObjMap = map[string]interface{}{
"str": "value1",
"num": 7,
"obj": map[string]interface{}{
"prop": "x",
},
"nil"... |
a4a7f303918a3c1d622513b79468fb83194ed68c | 828f59c3504dd655cc008d4f2b0d05dcc5bde445 | machinebox/womenwhogo | /machinebox/cbox.go | Go | go | 4,869 | permissive | package main
import (
"context"
"fmt"
"math/rand"
"sort"
"strings"
"time"
"github.com/machinebox/gopherconeu/dataset"
"github.com/machinebox/sdk-go/boxutil"
"github.com/machinebox/sdk-go/classificationbox"
)
// Using classification box to create and validate a classifier for the news20 problem
//
// Get MB_... |
571373ba51070d9a59c39031c649e1f937443e85 | c425862ecd077817c3e687c3636cfd06e37e7f66 | ZWE/marketing-api-go-sdk | /pkg/model/model_adcreatives_delete_response.go | Go | go | 552 | permissive | /*
* Marketing API
*
* Marketing API
*
* API version: 1.3
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package model
type AdcreativesDeleteResponse struct {
Code int64 `json:"code,omitempty"`
Message string `js... |
1b4aa4ab97ba4a5b9d55c78560c497a91bd1ceae | b099dd3a0bd4c9fd31940c871d870ffceda13081 | mccutchen/fillcache | /example_test.go | Go | go | 2,464 | permissive | package fillcache_test
import (
"context"
"fmt"
"sync"
"time"
"github.com/mccutchen/fillcache"
)
// Example demonstrates basic usage of fillcache by simulating a "thundering
// herd" of 10 concurrent cache gets that result in only a single call to the
// cache filling function.
func Example() {
var (
key ... |
3f29498da45308f2838ca12f557630c9773e4ec5 | 929d6f7a100f0c2730181df5191919c6f2c73c5e | deepOceanOne/rancher | /vendor/github.com/rancher/types/client/management/v3/zz_generated_pipeline_status.go | Go | go | 955 | permissive | package client
const (
PipelineStatusType = "pipelineStatus"
PipelineStatusFieldLastExecutionID = "lastExecutionId"
PipelineStatusFieldLastRunState = "lastRunState"
PipelineStatusFieldLastStarted = "lastStarted"
PipelineStatusFieldNextRun = "nextRun"
PipelineStatusFieldNextStart ... |
b0d0e3efc2cb91f216bfb4f796f2ef135d3beab2 | 33542f27880d13f7c994dafcaa14139b61a27b90 | Gusarov2k/auth-go | /internal/api/utils.go | Go | go | 392 | no_license | package api
import (
"golang.org/x/crypto/bcrypt"
)
func hashAndSalt(pwd string) (hash string, err error) {
h, err := bcrypt.GenerateFromPassword([]byte(pwd), bcrypt.DefaultCost)
return string(h), err
}
func comparePasswords(hashedPwd string, plainPwd string) bool {
byteHash := []byte(hashedPwd)
err := bcrypt.C... |
eee3ce68c5cad7d15cf242d03c967a0d0cb9af09 | e36391c9dec6f252c6e39e555f88ceb6dea732c6 | hrNakamura/go_learn | /ch07/ex04/main_test.go | Go | go | 759 | no_license | package main
import (
"bytes"
"io/ioutil"
"reflect"
"strings"
"testing"
"golang.org/x/net/html"
)
func TestMyNewReader(t *testing.T) {
s := "Hello myNewReader"
buffer := &bytes.Buffer{}
n, err := buffer.ReadFrom(MyNewReader(s))
if err != nil {
t.Fatal(err)
}
if n != int64(len(s)) {
t.Fatalf("expect l... |
fc72c657f9f6556913a4c7f46b6a3caf03ef1540 | 35c316ce007e52a3e15e76fca30343caac54f434 | stklv/v2ray-core | /app/router/command/config.go | Go | go | 3,694 | permissive | package command
import (
"strings"
"github.com/v2fly/v2ray-core/v5/common/net"
"github.com/v2fly/v2ray-core/v5/features/routing"
)
// routingContext is an wrapper of protobuf RoutingContext as implementation of routing.Context and routing.Route.
type routingContext struct {
*RoutingContext
}
func (c routingCont... |
8ea8e97eaae35707c0844494fbb2950317e48f8d | 417713f6ab7c6be7adf35d0852fa774e5af4b04b | EricHripko/dipod | /vendor/github.com/docker/docker/daemon/stats/collector_unix.go | Go | go | 1,863 | permissive | // +build !windows
package stats // import "github.com/docker/docker/daemon/stats"
import (
"fmt"
"os"
"strconv"
"strings"
"github.com/opencontainers/runc/libcontainer/system"
"golang.org/x/sys/unix"
)
// platformNewStatsCollector performs platform specific initialisation of the
// Collector structure.
func p... |
270bb91acea5020f3ee426a41a1d50b0ba121ce8 | fd92e3599001f98038c82f4df2848c402e66389a | catherinechaya/SOMAS2020 | /internal/common/config/config.go | Go | go | 5,936 | no_license | // Package config contains types for the configuration of the game.
// DO NOT depend on other packages outside this folder!
// Add default values etc. in <root>/params.go
package config
import "github.com/SOMAS2020/SOMAS2020/internal/common/shared"
// Config is the type for the game configuration.
type Config struct ... |
4215bcf75a4e14253780d993f0629ffc901a4d1f | 6930324c6eecc85c252f9d8e873279d2c716916e | goranp13/go_learn | /go_proba/go_opet/Hands-on-exercise/ninja65.go | Go | go | 468 | no_license | package main
import (
"fmt"
"math"
)
type square struct {
length float64
}
type circle struct {
radius float64
}
func (s square) area() float64 {
return s.length * s.length
}
func (c circle) area() float64 {
return c.radius * c.radius * math.Pi
}
type shape interface {
area() float64
}
func info(s shape) ... |
54c67796b2e5fb80cbf5a1aa6b3f4e5aca1c98de | d2598772c11248595f7fbb491b7f21be185aef1a | MarcusXia/mainflux | /coap/adapter.go | Go | go | 2,882 | permissive | // Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
// Package coap contains the domain concept definitions needed to support
// Mainflux CoAP adapter service functionality. All constant values are taken
// from RFC, and could be adjusted based on specific use case.
package coap
import (
"context"
"fmt... |
c25b0999c656f1c4253526b462449c4021e47600 | 4d0744579b29847f6d4fb50614a53e6d2830d045 | diegofsousa/MachineLearningWithGo | /capítulo_01/03_reading_in_csv_data03.go | Go | go | 627 | no_license | package main
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
)
func main() {
/* abrindo o arquivo CSV */
f, err := os.Open("iris.csv")
if err != nil {
log.Fatal(err)
}
defer f.Close()
reader := csv.NewReader(f)
// serão lidos apenas 5 campos por linha
reader.FieldsPerRecord = 5
var rawCSVData [][]strin... |
42072a63b87e3411e433d31002a461e1e4569da8 | 907b4a6a8bbcc7d9f85104a88f9ed47f83e99dd4 | Yefangbiao/datastructureAndAlgorithms | /code_algorithms_introduce/chapter2/practice/practice_test.go | Go | go | 2,603 | no_license | package practice
import (
"fmt"
"testing"
)
func TestInsertSort(t *testing.T) {
arr := []int{5, 2, 4, 6, 1, 3}
want := []int{6, 5, 4, 3, 2, 1}
if got := insertSort(arr); !compareIntSlice(got, want) {
fmt.Printf("error! got :%v, want :%v", got, want)
}
}
func TestLinearSearch(t *testing.T) {
arr := []int{5, ... |
f7e0a37c89d5a84482d2716cf629a6c4b1e95102 | e1376b8c8c3b196a52a80f7d9b912db67499045c | wangli1030/saml | /samlsp/request_tracker_jwt.go | Go | go | 2,149 | permissive | package samlsp
import (
"crypto/rsa"
"fmt"
"time"
"github.com/form3tech-oss/jwt-go"
"github.com/wangli1030/saml"
)
var defaultJWTSigningMethod = jwt.SigningMethodRS256
// JWTTrackedRequestCodec encodes TrackedRequests as signed JWTs
type JWTTrackedRequestCodec struct {
SigningMethod jwt.SigningMethod
Audien... |
fdc2d1239a24701d9642754123fb07dda2ff02ba | 87303e10609d927091a106faba8a3f240dd3a0ec | petrolax/wbtechlvl1 | /task6/after/main.go | Go | go | 429 | no_license | package main
import (
"fmt"
"time"
)
func main() {
nums := make(chan int)
done := make(chan bool)
go func() {
i := 0
for {
select {
case nums <- i:
i++
case <-done:
fmt.Println("Goroutine was stop")
close(nums)
return
}
}
}()
go func() {
select {
case <-time.After(time.Se... |
66a0a5169e79bddcf5784ccfd8c6bfec13c39aed | 49fa18f32057908c6783e088d189465a5a6b9ba6 | deyuhua/delve | /pkg/locspec/locations.go | Go | go | 14,027 | permissive | package locspec
import (
"fmt"
"go/constant"
"path"
"path/filepath"
"reflect"
"regexp"
"runtime"
"strconv"
"strings"
"github.com/deyuhua/delve/pkg/proc"
"github.com/deyuhua/delve/service/api"
)
const maxFindLocationCandidates = 5
// LocationSpec is an interface that represents a parsed location spec stri... |
7cd35413a522bc41c0d471e54b1fb01bfa68b88a | c7ca3183ec4a38e2e11ca4a72377639b44c02b37 | lshmouse/onecloud-service-operator | /vendor/yunion.io/x/onecloud/pkg/apis/compute/cloudprovider.go | Go | go | 6,701 | permissive | // Copyright 2019 Yunion
//
// 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 writi... |
ea674d7c89cc0eb5b020465c6245c2f872c10040 | 205ea29cdb82b68a219073606c11b053f30434fc | hh9net/etc | /src/github.com/go-xorm/xorm/statement.go | Go | go | 35,199 | permissive | // Copyright 2015 The Xorm 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 xorm
import (
"database/sql/driver"
"fmt"
"reflect"
"strings"
"time"
"github.com/xorm.io/builder"
"github.com/xorm.io/core"
)
// Statement s... |
37c5b4b177a926a9d8ba4080c63a2b7bbe287411 | 811b2376864c3d218ae37cdfec58d7477cb2a459 | tangchain/tang-go | /protocols/compliance/auth_request.go | Go | go | 2,335 | permissive | package compliance
import (
"encoding/base64"
"encoding/json"
"net/http"
"net/url"
"github.com/asaskevich/govalidator"
"github.com/tang/go/clients/tangtoml"
"github.com/tang/go/keypair"
"github.com/tang/go/support/errors"
)
func (r *AuthRequest) Populate(request *http.Request) *AuthRequest {
r.DataJSON = re... |
22735e6859c8d563650d30b23ad8c80a50ca2ecc | 9f217b82d0835bc90c3120e488331c03055307c2 | openshift/installer | /vendor/github.com/microsoftgraph/msgraph-sdk-go/users/item/presence/setpresence/set_presence_request_builder.go | Go | go | 4,095 | permissive | package setpresence
import (
"context"
i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go"
ia572726a95efa92ddd544552cd950653dc691023836923576b2f4bf716cf204a "github.com/microsoftgraph/msgraph-sdk-go/models/odataerrors"
)
// SetPresenceRequestBuild... |
6fd8b746485fe073eacd1d96e7a1b660452b9db6 | 92c524962c0ea41a1f91716dfa4ec813ff051c9d | anandagarwaal/goworkshopdevops | /examples/reflect/reflect-key-value.go | Go | go | 1,566 | permissive | // Go in action
// @jeffotoni
// 2019-01-29
package main
import (
"fmt"
"reflect"
"strconv"
"strings"
)
func main() {
var (
//m0 = make(map[int]string)
//m1 = make(map[int64]string)
//m2 map[interface{}]string
//m3 map[interface{}]interface{}
m4 map[string]interface{}
//m5 map[bool]string
)
s := "... |
34e1549dd38fba036d0b2277ef6234d3c196543c | 3643467c568b7117bfc4ee2ae8a1270eb084e7a6 | treejames/go2o | /socket-cli.go | Go | go | 209 | permissive | /**
* Copyright 2014 @ Ops.
* name :
* author : newmin
* date : 2013-11-20 19:27
* description :
* history :
*/
package main
import (
"github.com/atnet/gof/net/jsv"
)
func main() {
jsv.InShell()
}
|
c9c7d31c1342c7e83eb3083f0a91db4590d18c67 | 92a6393266b3bb58dbb1b37db574b90045b65778 | aws/aws-sdk-go | /awstesting/integration/performance/s3DownloadManager/metric.go | Go | go | 5,843 | permissive | //go:build go1.13 && integration && perftest
// +build go1.13,integration,perftest
package main
import (
"context"
"crypto/tls"
"fmt"
"net/http/httptrace"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/request"
)
type RequestTrace struct {
Operation string
ID string
context.Context
s... |
d03b0cca7080eda8c3c895d8361b5b36989daf46 | bd49b6d1487f1415330c949c51add0f3ebebdc13 | ossrs/srs-bench | /vendor/github.com/pion/webrtc/v3/sdptype.go | Go | go | 2,571 | permissive | package webrtc
import (
"encoding/json"
"strings"
)
// SDPType describes the type of an SessionDescription.
type SDPType int
const (
// SDPTypeOffer indicates that a description MUST be treated as an SDP
// offer.
SDPTypeOffer SDPType = iota + 1
// SDPTypePranswer indicates that a description MUST be treated ... |
0d2e77c759c37a361e914d6a2d05b0f94d2d4ba6 | dedf2b485e62de9f4aaabc85f3faf1955b8a8d65 | kmruddy/vsphere-automation-sdk-go | /services/vmc/orgs/sddcs/management_vms/DefaultDnsClient.go | Go | go | 6,831 | permissive |
/* Copyright © 2019 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: BSD-2-Clause */
// Code generated. DO NOT EDIT.
/*
* Client stubs for service: Dns
* Functions that implement the generated DnsClient interface
*/
package management_vms
import (
"github.com/vmware/vsphere-automation-sdk-go/lib/... |
8687c9bef3714de56194bc9b446d39fc0cb5a447 | 0021b1491a53f32bf2d5ef2f6396f0acecc36c06 | liu-junyong/goutil | /datetime/time.go | Go | go | 2,520 | no_license | package datetime
import (
"time"
"strings"
"fmt"
)
var ChinaLocation = time.FixedZone("Asia/Shanghai", 8*60*60)
var format = "2006-01-02 15:04:05"
//获取当前时间 格式: 2018-11-11 00:00:00
func GetNow() (string) {
return time.Now().In(ChinaLocation).Format(format)
}
//获取当前年月日时间
func GetNowDay() string {
return time.Now(... |
33de638dfc9eed34e40977e9ce3cd9461133fd42 | 9f7c53777e5a3dc338dbe31b5e0aee474a02e94e | zbysir/game-frame-probe | /game/app/server.go | Go | go | 899 | permissive | package app
import (
"time"
"github.com/AsynkronIT/protoactor-go/actor"
"fmt"
"github.com/AsynkronIT/protoactor-go/remote"
"github.com/bysir-zl/game-frame-probe/common/service"
"github.com/bysir-zl/bygo/util/discovery"
)
const TAG = "game"
var (
id string = "game/1"
addr string = "127.0.0.1"
port int =... |
f46a6fabd5bdfcaaf263752811f6ee0ab2f09280 | 319a6ae22d0704adc353bb4e5c19c27f78dd6f1d | bfg-finsa/telegraf | /plugins/inputs/swap/swap.go | Go | go | 988 | permissive | package swap
import (
"fmt"
"github.com/influxdata/telegraf"
"github.com/bfg-finsa/telegraf/plugins/inputs"
"github.com/bfg-finsa/telegraf/plugins/inputs/system"
)
type SwapStats struct {
ps system.PS
}
func (_ *SwapStats) Description() string {
return "Read metrics about swap memory usage"
}
func (_ *SwapSt... |
07a20fd398171d82b6b3e53e06968f2e59628068 | 899e3bbb90c9e81f200be542bf46eb82eb0a859d | marcozov/anon-peerster | /code/message.go | Go | go | 3,285 | permissive | package main
import (
"bytes"
"crypto/sha256"
"encoding/base32"
"encoding/binary"
"errors"
"fmt"
"github.com/dedis/protobuf"
"strings"
"time"
)
// Proof-of-work nonce length (in bytes)
const NONCE_LENGTH = 16
type RumorMessage struct {
Origin string
Destination string
ID uint32
Content ... |
af2e5fa649fa64dd6bf7df76750c020b9c17acad | 9c2facd2a89544a8fe87cdc55798f0a7497f6cab | Glintt/gAPI | /api/oauth_clients/oauth_clients-oracle.go | Go | go | 1,107 | permissive | package oauth_clients
import (
"database/sql"
"github.com/Glintt/gAPI/api/database"
)
var FIND_CLIENT = `select client_id, client_secret from gapi_oauth_clients where client_id = :client_id and client_secret = :client_secret`
func FindOAuthClientOracle(clientId string, clientSecret string) OAuthClient {
db, err ... |
417692027d52e6d24d1e797f001958fee7d1fff0 | b68ba84df804e81a09f327f1fe111c48f3643ba6 | alochym01/hardware-exporter | /domain/server/handler.go | Go | go | 1,579 | no_license | package server
import (
"github.com/alochym01/hardware-exporter/domain/server/dell"
"github.com/alochym01/hardware-exporter/domain/server/hpe"
"github.com/alochym01/hardware-exporter/storage/redfish"
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/... |
89d0f3476e3e52d75239b1ed343afe534da6fe45 | ea30265bd79da5942fc01a0512f5f04563ea4c2d | arnagaram/nuage-cni | /vendor/github.com/docker/docker/cli/command/service/scale.go | Go | go | 2,281 | permissive | package service
import (
"fmt"
"strconv"
"strings"
"golang.org/x/net/context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/cli"
"github.com/docker/docker/cli/command"
"github.com/spf13/cobra"
)
func newScaleCommand(dockerCli *command.DockerCli) *cobra.Command {
return &cobra.Command{
Us... |
dbc1b3311ab88f4adb2f3ba090c8e97122900122 | a7025faf5648a77276df340f912d9c332f82cb22 | zhangxh1023/studygolang | /src/logic/user.go | Go | go | 20,168 | permissive | // Copyright 2016 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author:polaris polaris@studygolang.com
package logic
import (
"errors"
"fmt"
"math/rand"
"model"
"net/url"
"strings... |
c8f1fd493613e931e9da1494d85a596c83a23bb9 | 1daf917043c6d31aedaaf66a950b3e9160e63e4a | mattrose/zephyros | /libs/zephyros_go/screen.go | Go | go | 762 | permissive | package zephyros_go
import (
"encoding/json"
)
type Screen float64
func (self Screen) FrameIncludingDockAndMenu() Rect {
var buf Rect
bytes := send(float64(self), nil, false, "frame_including_dock_and_menu")
json.Unmarshal(bytes, &buf)
return buf
}
func (self Screen) FrameWithoutDockOrMenu() Rect {
var buf Re... |
9203ca8d507d1a4832215079e7e569f614bcec46 | f3b3428f8c557f1267a9904829f481eb7b639ef1 | Project-Planner/backend | /model/user.go | Go | go | 630 | no_license | package model
import (
"encoding/xml"
)
type User struct {
XMLName xml.Name `xml:"user"`
Name Attribute `xml:"name"`
Items Items `xml:"items"`
}
type Items struct {
XMLName xml.Name `xml:"items"`
Calendars []CalendarReference `xml:"calendar"`
}
type CalendarReference struct {
XMLName x... |
78adc43a0a26c416b25be71d7b0a4c144eda1209 | 8116f601b6d23fd45def195ae230c7758c64f0d8 | xiaopeng163/nerd | /cmd/flex/main.go | Go | go | 23,526 | permissive | //main holds the flex volume executable, compiled separately
package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
crd "github.com/nerdalize/nerd/crd/pkg/client/clientset/versioned"
transfer "github.com/nerdalize/nerd/pkg... |
5507cabe025b10b22d2a010d9e1e4e4d6813ceb7 | e079a10dd2e00a1056b0976bc0b9e5d906b03c0e | fhqidx/onecloud | /pkg/compute/models/instance_snapshots.go | Go | go | 10,747 | permissive | // Copyright 2019 Yunion
//
// 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 writi... |
cfef20cfdb83e558357908dc75d6462c98f3450a | cfc40a94a915bce13ac604ad86a50f20e4e737bc | alldatacenter/alldata | /iot/shifu/pkg/deviceshifu/unitest/httpretry.go | Go | go | 736 | permissive | package unitest
import (
"net/http"
"time"
"github.com/edgenesis/shifu/pkg/logger"
)
// SO FAR ONLY FOR UNIT TESTING USAGE
// DO NOT USE IN NONE UNIT TESTING CODE
// if there are common use case, let's move it to an much common package or even another code repo
// RetryAndGetHTTP Send Http Get pre Second success... |
8deb057c0f637331e04e3f700139fad15fcd0d0e | 23f2b2f638ff82173469c1203a3c6d601528cd52 | kf5grd/client | /go/service/main.go | Go | go | 44,744 | permissive | // Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package service
import (
"bufio"
"errors"
"fmt"
"io"
"net"
"os"
"path/filepath"
"runtime"
"runtime/pprof"
"runtime/trace"
"sync"
"time"
"golang.org/x/net/context"
"github.com/keybas... |
666317018c6918c1351d1ed29ade9e957cff189f | 85258187e103eefbf70b09b4d55db4424b7b53aa | evanchaoli/concourse | /topgun/both/resource_types_test.go | Go | go | 2,499 | permissive | 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... |
ae9b685b1fec711507a552283a7ed4be39983762 | 8ef332a442953fe90ef7a0077fb053147a0e70f8 | yskang/AlgorithmWithGo | /leetcode/leetcodeTest/longestPalindromicSubsequence_test.go | Go | go | 956 | no_license | package leetcodeTest
import (
"fmt"
"AlgorithmWithGo/leetcode"
)
func ExampleLongestPalindromeSubsequence() {
fmt.Println(leetcode.LongestPalindromeSubseq("bbbab"))
fmt.Println(leetcode.LongestPalindromeSubseq("cbbd"))
fmt.Println(leetcode.LongestPalindromeSubseq("abcdef"))
fmt.Println(leetcode.LongestPalindrom... |
3534fd9814e1827cdefd851adf91ba23bb3c5d91 | c5c40dd57cf3093ea29ad3ed4b30bc14e4cdd0b9 | Messer4/QtumBugReproduce | /main.go | Go | go | 1,253 | no_license | package main
import (
"encoding/hex"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/qtumproject/janus/pkg/qtum"
"log"
"math/big"
"strings"
)
const cAbi = `[
{
"inputs": [
{
"internalType": "address",
"name": "asset",
"type": "address"
},... |
7e04271858c352c02a75af665ef6540afb9c5d77 | 5d75cae476f87cf788a49d96f047e553b0f43b2d | AccelByte/accelbyte-go-sdk | /iam-sdk/pkg/iamclient/users/public_get_user_ban_history_v3_responses.go | Go | go | 12,639 | permissive | // Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
// Code generated; DO NOT EDIT.
package users
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"strings"
"github.com/go-openapi/r... |
52df6c4807e3391069e70cdd3f85c07f2429ead3 | 5761248b431ec661cfc2d6f23ed265f2b2c73050 | dfawley/google-api-go-client | /cloudscheduler/v1beta1/cloudscheduler-gen.go | Go | go | 96,950 | permissive | // Copyright 2020 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package cloudscheduler provides access to the Cloud Scheduler API.
//
// For product documentation, see: https://cloud.google.com/scheduler/
//
... |
1c10e06f0a1c78a5ddf23c265ed3811da00d47ab | d3276464b24a1db9014eccd8ad7bb2302c0e9f8c | eust-w/kubernetes | /test/e2e/node/apparmor.go | Go | go | 1,885 | permissive | /*
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, ... |
1719559a683878d8107f89c453121866a3b9f952 | c217c678e5de66499b96693df4385bc68704f37b | john-f-chamberlain/PufferPanel | /errors.go | Go | go | 8,086 | permissive | /*
Copyright 2020 Padduck, LLC
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, softwa... |
d99b3c45d090bb1d450157459d109ba895c7ab84 | e984930afa9ec02f72a0e6858ca0e5c6d06ee8ab | chanwit/belt | /cmd/hostname.go | Go | go | 2,559 | permissive | // Copyright © 2016 NAME HERE <EMAIL ADDRESS>
//
// 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 ... |
7ec50c113e32a15bbe26d17ad074fbdedde80909 | c0713f035bc3842091f053e3ce4b22e581c1a51d | yellyoshua/elections-app | /commons/modules/graphql/graphql.go | Go | go | 4,225 | permissive | package graphql
import (
gql "github.com/graphql-go/graphql"
gqlhandler "github.com/graphql-go/graphql-go-handler"
"github.com/yellyoshua/elections-app/commons/logger"
)
type GraphqlConfig struct {
Playground bool
GraphiQL bool
Pretty bool
}
func New(graphql_config GraphqlConfig, graphql_schema_conf gql.... |
195c5d56991ce0bdc4e21309732d953436ec4590 | 8a476b4f1144339c9a65de254e71e87cdb0f6fcc | xingmuyang/htgolang-20200615 | /course/20191102/codes/todolist/forms/user.go | Go | go | 5,577 | no_license | package forms
import (
"strings"
"time"
"github.com/astaxie/beego/orm"
"github.com/astaxie/beego/validation"
"github.com/imsilence/todolist/models"
)
// 用户创建表单
type UserCreateForm struct {
Name string `form:"name,text,名称"`
Password string `form:"password,password,密码"`
PasswordVerify string `... |
09528386eacce179898d50565cbd8108f7a693c3 | 9cf3b441c7a61d5cbe2a4fee6cf0cd89f4319341 | alfred-zhong/leetcode | /archive02/AddTwoNumbersII/algo.go | Go | go | 934 | no_license | // https://leetcode.com/problems/add-two-numbers-ii/description/
package algo
type ListNode struct {
Val int
Next *ListNode
}
/**
* Definition for singly-linked list.
* type ListNode struct {
* Val int
* Next *ListNode
* }
*/
func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
var l3 *ListNod... |
474e3b30b969b8804efc8a2843fbe51c51378d87 | f5597736f5de87d3a4bbec67c4de8502052da3bf | ppal-zededa/eve | /pkg/pillar/iptables/ssh.go | Go | go | 3,155 | permissive | // Copyright (c) 2018 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
// Also blocks the VNC ports (5900...) if ssh is blocked
// Always blocks 4822
// Also always blocks port 8080
package iptables
import (
"fmt"
log "github.com/sirupsen/logrus"
)
func UpdateSshAccess(enable bool, first bool) {
log.Infof("... |
2de76a1de2b50ce59d5bb723c986e36893deef90 | 0c83c2b638aa0a92506cbd1788c38a964afec5fa | hyperledger/fabric | /vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go | Go | go | 2,681 | permissive | package matchers
import (
"fmt"
"strings"
"github.com/onsi/gomega/format"
"gopkg.in/yaml.v2"
)
type MatchYAMLMatcher struct {
YAMLToMatch interface{}
firstFailurePath []interface{}
}
func (matcher *MatchYAMLMatcher) Match(actual interface{}) (success bool, err error) {
actualString, expectedString, err ... |
84d3bbc03b350f9ed5fdcf630a02d396e617c14e | ce6b4923b33ea60e1c011e80294da67ac4357efe | varluffy/vipsdk | /unionUrlService/genByGoodsId.go | Go | go | 1,518 | no_license | package unionUrlService
type GenByGoodsIdParam struct {
Service
Request GenByGoodsIdRequest
}
func (a GenByGoodsIdParam) MethodName() string {
return "genByGoodsId"
}
func (a GenByGoodsIdParam) Params() interface{} {
p := make(map[string]interface{}, 0)
p["goodsIdList"] = a.Request.GoodsIdList
p["requestId"] =... |
a6cfd0886ab35c535573572adf09dc50f964c29a | 25f8840c9e6c2719dea0e2b6396a924b31f4f3d4 | jcchavezs/opentelemetry-collector-contrib | /receiver/mysqlreceiver/factory.go | Go | go | 2,108 | permissive | // Copyright 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 agreed... |
acf9e9ea32dddc3126a44b92cdaabd08deab5483 | 04d75f36b57c6376cfbd500f745a6f346a211acf | sporsh/gosundog | /render/render.go | Go | go | 2,477 | no_license | package main
import (
"image/png"
"log"
"math/rand"
"os"
"time"
sundog "github.com/sporsh/gosundog"
"github.com/sporsh/gosundog/geometry"
"github.com/sporsh/gosundog/v3"
)
func main() {
rand.Seed(0)
lightMaterial := sundog.NewLambertianMaterial(v3.V{0.5, 0.5, 2}, v3.V{0.8, 0.8, 0.8})
whiteMaterial := sun... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.