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 |
|---|---|---|---|---|---|---|---|---|
4e90d2ed5fb8b653088d899a47c59abfc25c0f3c | a76648c363e1f92a80b0a2a6afa2ba2228a8a583 | qiaotaizi/zava | /native/sun/misc/VM.go | Go | go | 847 | permissive | package misc
import (
"github.com/qiaotaizi/zava/instructions/base"
"github.com/qiaotaizi/zava/native"
"github.com/qiaotaizi/zava/rtda"
"github.com/qiaotaizi/zava/rtda/heap"
)
func init() {
className:="sun/misc/VM"
native.Register(className,"initialize","()V",initialize)
}
func initialize(frame *rtda.Frame){
... |
3384b05655d292ebb2446d384254e228de65ff97 | 700ad0d9a56781952cb383e3db3b975263376006 | devops-consultants/teleport | /lib/auth/auth_login_test.go | Go | go | 23,843 | permissive | // Copyright 2021 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 agree... |
4f13946fdd7dcddf3fae5f7cf2d90c3ada477afa | f48e596af718fbc27ce38b698dd5972d5f1df980 | Kmortyk/contextTimeoutLecture | /example07_time_after_func.go | Go | go | 415 | no_license | package main
import (
"fmt"
"time"
)
/*
time.AfterFunc выполняет некоторую функцию через указанное время.
Функция запускается в отдельной горутине.
*/
func main() {
t := time.Now()
end := make(chan struct{})
time.AfterFunc(3*time.Second, func() {
fmt.Printf("passed %v\n", time.Since(t))
end <- struct{}{}... |
d857adb7e91f3c3542245a35b10d1b641d9b1311 | 9b64f11aa20d5bf7ba4127dd5851e7269a035290 | ralreegorganon/nmeaais | /typecnb.go | Go | go | 2,116 | permissive | package nmeaais
import (
"fmt"
)
type PositionReportClassA struct {
MessageType int64
RepeatIndicator int64
MMSI int64
NavigationStatus string
RateOfTurn float64
SpeedOverGround float64
PositionAccuracy bool
Longitude float64
Latitude float64
CourseOverGroun... |
38a00fe9ddf206d2f2dad9ef3e328fe0f45e2ab2 | 45e2de0a107772d7e75db2be46d88010587c079b | cloudfoundry/loggregator-agent | /pkg/diodes/one_to_one_envelope_v2.go | Go | go | 1,497 | permissive | package diodes
import (
gendiodes "code.cloudfoundry.org/go-diodes"
"code.cloudfoundry.org/go-loggregator/rpc/loggregator_v2"
)
// OneToOneEnvelopeV2 diode is optimized for a single writer and a single
// reader for byte slices.
type OneToOneEnvelopeV2 struct {
d *gendiodes.Waiter
}
// NewOneToOneEnvelopeV2 initi... |
d6b30c6d2f04608b1404ecdadca7c77042e5823a | 9e0a0b344d8f2528a4e3f28a4a47eb056290287c | kakashizc/golang | /struct/02/main.go | Go | go | 528 | no_license | package main
import "fmt"
//构造函数
type person struct {
name string
age int
}
//构造函数 方式一: 复制一份person, 如果person字段很多的话, 比较占用内存
// func newPerson(name string, age int) person {
// return person{
// name,
// age,
// }
// }
//方式二: 直接复制一份person的内存地址,地址就很小了,这样省内存
func newPerson(name string, age int) *person {
retu... |
feb3dacc3ad2b326692d9baf97663e2a3e807b15 | d69c72bf20595e9f420d443050f1c8dd4bc8890f | x-chain/fabric-sdk-go | /pkg/fab/resource/configtxmsp.go | Go | go | 1,982 | permissive | /*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package resource
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric-protos-go/msp"
mspcfg "github.com/x-chain/fabric-sdk-go/internal/github.com/... |
80a4d337add5a83ecf7f884fb4dbb57bff6f4cd3 | edb4f409c92429ece383dbc1966e45c221ab34fe | zhusulai/cf-shell | /vendor/code.cloudfoundry.org/cli/command/v2/curl_command.go | Go | go | 1,692 | permissive | package v2
import (
"os"
"code.cloudfoundry.org/cli/cf/cmd"
"code.cloudfoundry.org/cli/command"
"code.cloudfoundry.org/cli/command/flag"
)
type CurlCommand struct {
RequiredArgs flag.APIPath `positional-args:"yes"`
CustomHeaders []string `short:"H" description:"Custom headers to incl... |
c5ef58dc17ce3d5b1ba30028a45d251a22f33450 | 5291bf96c0f583be3557747bca3add100dd493e2 | kosctelecom/gobgp | /cmd/gobgp/rpki.go | Go | go | 5,329 | permissive | // Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
//
// 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... |
c6e0d2900f9e652519788d9582631bc8e2e71632 | 618fafba0d10e741f3b651889169c447bb7aaefe | ktmlm/cilium | /daemon/cmd/status.go | Go | go | 32,187 | permissive | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium
package cmd
import (
"context"
"fmt"
"net"
"strings"
"time"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/sirupsen/logrus"
versionapi "k8s.io/apimachinery/pkg/version"
"github.com/cilium/cilium/ap... |
7aea4752566bfda4eacd85b8fd6b98144c7fbc2c | 2069057c43d42d80c1fe5a28b9733b38c250c552 | ditek/jsonfsm | /main.go | Go | go | 1,361 | no_license | package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"github.com/ditek/jsonfsm/gofsm"
"github.com/gorilla/mux"
)
// FSM is a local alias to allow type extension
type FSM gofsm.FSM
/**** REST End Points and Functions ****/
func eventHandler(w http.ResponseWriter, r *http.Request, fs... |
381b964b391b3242c73d1cc42a4e3ddc9b02dc49 | db1a6cbcc408828e57dec5ef2ef136e5c6ecb0ec | jacksontj/eventmaster | /github.go | Go | go | 718 | permissive | package eventmaster
import (
"encoding/json"
"net/http"
"github.com/julienschmidt/httprouter"
"github.com/pkg/errors"
"github.com/ContextLogic/eventmaster/jh"
)
func (s *Server) gitHubEvent(w http.ResponseWriter, r *http.Request, _ httprouter.Params) (interface{}, error) {
var info map[string]interface{}
if ... |
45b29c47826ca2194c9fc8f16a20a3454bf874a9 | 80ad8fb9bdc562c4c1a67db6655f335c7160d277 | damoon/weave-kube | /kube-peers/main.go | Go | go | 1,437 | permissive | package main
import (
"fmt"
"log"
"os"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/client/restclient"
"k8s.io/kubernetes/pkg/client/unversioned"
kubectl_util "k8s.io/kubernetes/pkg/kubectl/cmd/util"
)
func getKubePeers() ([]string, error) {
c, err := unversioned.NewInCluster()
if err != nil {
retur... |
8d8cd4837326b32de7074db88f801290c95fd7d1 | 5761669f0db7b93e22a678be8906ad851bcd2f14 | kubevirt/kubevirt | /vendor/github.com/insomniacslk/dhcp/interfaces/interfaces.go | Go | go | 1,213 | permissive | package interfaces
import "net"
// InterfaceMatcher is a function type used to match the interfaces we want. See
// GetInterfacesFunc below for usage.
type InterfaceMatcher func(net.Interface) bool
// interfaceGetter is used for testing purposes
var interfaceGetter = net.Interfaces
// GetInterfacesFunc loops throug... |
5a3085d85822aa47ca6209074008f2a8901fef66 | ea0822d8b2427033ce3c6d7aa7103f5f54a5291d | mramshaw/redis-cache | /resp-get.go | Go | go | 938 | no_license | // resp-get handles the RESP protocol wrapping & unwrapping for Redis GET requests.
package main
import (
"bytes"
"fmt"
)
// unwrapRedisKey extracts a Redis key from a RESP-formatted byte string.
func unwrapRedisKey(key []byte) []byte {
lines := bytes.Split(key, []byte{'\r', '\n'})
return lines[4]
}
// wrapRed... |
5ae6f4a54802b9d2098146a71aacd97be6194c1d | d0a5da91c82bacc5afd5704d2c40f738422ab447 | luisriverag/probe-cli | /internal/cmd/oohelperd/internal/websteps/initialchecks_test.go | Go | go | 672 | permissive | package websteps
import (
"testing"
)
var checker = &DefaultInitChecker{resolver: newResolver()}
func TestMeasureWithInvalidURL(t *testing.T) {
_, err := checker.InitialChecks("http://[::1]aaaa")
if err == nil || err != ErrInvalidURL {
t.Fatal("expected an error here")
}
}
func TestMeasureWithUnsupportedSche... |
3da23b8b3a3bfd8b09e1b7bff8cd1d51b56e234b | bcfc6407b3dc768e79eb2bbb24dd78a1d7f9fe3c | ZikeWang/TDD-go-codes | /Hello-World/hello_test.go | Go | go | 806 | no_license | package main
import "testing"
func TestHello(t *testing.T) {
assertCorrectMessage := func(t *testing.T, got, want string) {
t.Helper()
if got != want {
t.Errorf("got '%s' want '%s'", got, want)
}
}
t.Run("saying hello to people", func(t *testing.T) {
got := Hello("Chris", "")
want := "Hello, Chris"
... |
9a109b8d5d1c9f665b94506c54a1f046ad396ab3 | 44888c0345ef2f7d590b36f2bedb55d46d003c79 | johnulist/opensirene | /api/router/router.go | Go | go | 1,955 | permissive | package router
import (
"fmt"
"github.com/Depado/ginprom"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/sirupsen/logrus"
"github.com/jclebreton/opensirene/api/views"
"github.com/jclebreton/opensirene/conf"
)
// SetupAndRun creates the router and runs it
func S... |
19ad61c8712538c22b9a3e9862c86f21be718316 | 8abd6251e39c68ebd1a330de6d6c876d11c600f2 | KudouRan/learning | /go/gin/1_hello_world/main.go | Go | go | 306 | no_license | package main
import (
"fmt"
"github.com/gin-gonic/gin"
"net/http"
)
func main() {
r := gin.Default()
r.GET("/", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"html": "<h1>hello world</h1>",
})
})
err := r.Run(":9090")
if err != nil {
fmt.Printf("启动出现错误%v\n", err)
}
}
|
f0b950a1332feecc8ac719e97c88393b95c776dd | 54232db4b75f10cb9e086669e9a0b3492fadf184 | joe2hpimn/opa | /topdown/query.go | Go | go | 14,094 | permissive | package topdown
import (
"context"
"crypto/rand"
"io"
"sort"
"time"
"github.com/open-policy-agent/opa/resolver"
"github.com/open-policy-agent/opa/topdown/cache"
"github.com/open-policy-agent/opa/ast"
"github.com/open-policy-agent/opa/metrics"
"github.com/open-policy-agent/opa/storage"
"github.com/open-pol... |
c47d49aa6d8240a2397c809c71bdf79d7fbdbbba | 194333877965fd5168ceb7b588b948cc376c2c99 | kolaente/filebrowser | /http/raw.go | Go | go | 3,963 | permissive | package http
import (
"errors"
"fmt"
"net/http"
"net/url"
"path/filepath"
"strings"
"github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/v2/users"
"github.com/hacdias/fileutils"
"github.com/mholt/archiver"
)
func parseQueryFiles(r *http.Request, f *files.FileInfo, u *users.User... |
5e51c65794a2b8231aaa7d958f2974408a22d1a5 | 220bbc97c1c2ce66567b3234c05226d48d83f08b | tsxylhs/library-server | /main.go | Go | go | 1,381 | no_license | package main
import (
"fmt"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
"github.com/xormplus/xorm"
"golang.org/x/sync/errgroup"
"library/libraryDemo/cs"
"library/libraryDemo/middleware"
"library/libraryDemo/model"
"library/libraryDemo/rest"
"library/libraryDemo/rest/wechat"
"library/librar... |
127b716062e388ebab96152e57851a89cbad3952 | 881b1d640dd9adaff57f3f9a13b51dfcafde9573 | joaopapereira/cluster-api | /api/v1alpha3/machinehealthcheck_webhook_test.go | Go | go | 6,301 | permissive | /*
Copyright 2019 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, ... |
322b08c0c0d8fb9fa6e2614bcf3c7c236f54bd4b | 3ebaeaae26572fe6fda31f73604244d1ba353b8d | swapnilkashid1992/GolangPrograms | /src/NinjaL9/Waitgroup/Waitgroup.go | Go | go | 435 | no_license | package main
import (
"fmt"
"sync"
)
var wg sync.WaitGroup
func main() {
wg.Add(2)
go foo()
go soo()
wg.Wait()
bar()
}
func foo() {
fmt.Println("Inside Foo")
for i := 0; i < 10; i++ {
fmt.Println(i)
}
defer wg.Done()
}
func bar() {
fmt.Println("Inside Bar")
for i := 0; i < 10; i++ {
fmt.Println(i... |
df1404fde83ccfc34a34b136186ec7caff2dd696 | 9eb3f0a3c24b83669817700566b956edd2df869d | donaminos/sourcegraph | /internal/search/streaming/api/progress_test.go | Go | go | 1,568 | permissive | package api
import (
"flag"
"fmt"
"testing"
"github.com/sourcegraph/sourcegraph/internal/testutil"
)
var updateGolden = flag.Bool("update", false, "Updastdata goldens")
func TestSearchProgress(t *testing.T) {
var timedout100 []Namer
for i := 0; i < 100; i++ {
r := repo{fmt.Sprintf("timedout-%d", i)}
timed... |
778c1a7c450167d1724b35557705ce522764495a | 7ab6a3e2886e4240120376f22c33eb8fd1d173bc | sgtest/monorepo-test-3 | /kubernetes-13/pkg/client/clientset_generated/internalclientset/typed/core/internalversion/event_expansion.go | Go | go | 7,667 | 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, ... |
ed33894751a03ebdf6cf88b427cbbb3b98bea017 | 2876a735f2b0f9638deebe2ed1eb68ab794c1fee | milvus-io/milvus | /pkg/util/metautil/binlog.go | Go | go | 1,781 | permissive | package metautil
import (
"path"
"strconv"
"strings"
"github.com/milvus-io/milvus/pkg/common"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
const pathSep = "/"
func BuildInsertLogPath(rootPath string, collectionID, partitionID, segmentID, fieldID, logID typeutil.UniqueID) string {
k := JoinIDPath(collecti... |
02363f729160e6e95b166f47d57a4b23d786b8ac | 259383eaef1b3fc10bba5fcc796ac98365f38df6 | xavier268/pixbuilder | /pattern.go | Go | go | 2,201 | permissive | package pixbuilder
import (
"image"
"image/color"
"math/rand"
)
// Pattern provide a color for each point, and repeats itself horizontally and vertically.
// A Pattern is also an image.Image.
type Pattern struct {
xperiod, yperiod int // Horizontal and vertical periods
image.Image // The image that is r... |
bdedc4550e4c92c82395b266bdf5a64797696817 | 8af01cb7871e3aa35557acc1b50f0d763c98b5d4 | DeLiy-Liu/dad-go | /smartcontract/service/native/utils/serialization.go | Go | go | 2,910 | no_license | /*
* Copyright (C) 2018 The dad-go Authors
* This file is part of The dad-go library.
*
* The dad-go is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your... |
7331df350aff38165d3612f42d89787dd9c425b7 | f06c95814e95856fc60e5435c14bc30323561000 | isabella232/cri-resource-manager | /pkg/cri/resource-manager/control/page-migrate/page-migrate.go | Go | go | 7,518 | permissive | // Copyright 2019-2020 Intel Corporation. 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 b... |
3ba23a5619b9f82ba6ec9b12fb92ce83ef2add8c | bb78a7adff526d85f5a7fd2301da8eae50d62e01 | zrhoffman/trafficcontrol | /traffic_ops/testing/api/v5/deliveryservices_required_capabilities_test.go | Go | go | 14,627 | permissive | package v5
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... |
26d6d26e76e421424d140b7902287c3c8b286fe4 | 8ea0746bbd0f78e5b671678798f5dabd6cde4040 | rchamorro/pulumi-azure-nextgen | /sdk/go/azure/apimanagement/v20191201preview/certificate.go | Go | go | 6,751 | permissive | // *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20191201preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Certificate details.
type Cert... |
1aef280de759a868679d572c50456997582c2dfe | 7d346a9dd8266709cab0f91626861e29c91ad304 | tomerBZ/rest_go | /pkg/routes/user.go | Go | go | 2,333 | no_license | package routes
import (
"encoding/json"
"errors"
"github.com/go-chi/chi"
"github.com/tomerBZ/web/pkg/interfaces"
"github.com/tomerBZ/web/pkg/logs"
"github.com/tomerBZ/web/pkg/utils"
"net/http"
)
type userRouter struct {
userService interfaces.UserService
}
func userRouting(u interfaces.UserService) http.Hand... |
8e02665e157e8ea8d3a1e1bbc679aedcbe334367 | 91a1d90e158abfaf57bb2bfdca2af3c3f1140bb0 | godaner/gorepomaker | /inf/accessauthprofilerepo.go | Go | go | 1,161 | no_license | package inf
import (
SELFENTITY "han-networks.com/csp/config_grpc/entity"
)
type AccessAuthProfileRepo interface {
//查询一条AccessAuthProfile记录
QueryAccessAuthProfileOne(query map[string]interface{}) (*SELFENTITY.AccessAuthProfile,error)
//查询AccessAuthProfile指定字段
QueryAccessAuthProfileDistinct(query map[string]... |
fa13fc3ab5dfdc8a426ad5fec024fa2202c94846 | 181844c0e9a7789faf943c6b91463312b68d8a6f | hugmatj/msv | /server.go | Go | go | 1,909 | permissive | package msv
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"time"
"github.com/ribice/msv/middleware/httplog"
"github.com/ribice/msv/middleware/recovery"
"github.com/gorilla/mux"
)
// Server represents http server
type Server struct {
m *mux.Router
*http.Server
}
// New instantiates new http... |
289e80b2d67b26aceb05286d1bbc59cb4462b8c7 | e661c99a07ec21b32ce1f156cc5ac8896e47c29c | heikipikker/yapdnsbeat | /input/event.go | Go | go | 4,019 | permissive | package input
import (
"fmt"
"os"
"regexp"
"time"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/logp"
)
// FileEvent is sent to the output and must contain all relevant information
type FileEvent struct {
common.EventMetadata
ReadTime time.Time
Source string
InputTyp... |
067fa185e23cd53486bd2d5c074e523b045ab9e8 | e448934f9488393420b9120c0bb769e0d1653952 | bigflood/gostudy | /logworld/logrus-world/main.go | Go | go | 780 | no_license | package main
import (
"os"
log "github.com/sirupsen/logrus"
)
func init() {
log.SetReportCaller(true)
// Log as JSON instead of the default ASCII formatter.
log.SetFormatter(&log.JSONFormatter{})
// Output to stdout instead of the default stderr
// Can be any io.Writer, see below for File example
log.SetOu... |
e8a62c22bb057a6619d4a391de1655b99dea1a8a | f12c9c0121195bee415582e9a181bb41d3f34837 | seaung/ToN | /GoLang/struct/struct.go | Go | go | 415 | no_license | package main
import "fmt"
type user struct {
name string
email string
}
func (u user) notify() {
fmt.Println(u.name, u.email)
}
func (u user) modify(email string) {
u.email = email
}
func main() {
lisa := user{
name: "lisa",
email: "lisa@gmail.com",
}
bill := &user{
name: "bill",
email: "bill@gm... |
3619bf177a64b7829602128fc64878a79a224272 | 9b3ed7045b2762d12235c8af5afbe85d2d4868fd | chrischiedo/oasis-core | /go/consensus/tendermint/apps/beacon/beacon.go | Go | go | 5,348 | permissive | // Package beacon implements the beacon application.
package beacon
import (
"encoding/binary"
"encoding/hex"
"github.com/pkg/errors"
"github.com/tendermint/tendermint/abci/types"
"golang.org/x/crypto/sha3"
"github.com/oasislabs/oasis-core/go/consensus/api/transaction"
"github.com/oasislabs/oasis-core/go/cons... |
1d2dabd0ac3cd3fae0609f8af48c418ced936bcf | 43f51be5fe971325490f79500c47f7bb3655ada5 | openshift/installer | /terraform/providers/azurerm/vendor/github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs/validate/devtest.go | Go | go | 1,843 | permissive | package validate
import (
"fmt"
"regexp"
"github.com/hashicorp/go-azure-sdk/resource-manager/devtestlab/2018-09-15/virtualnetworks"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
)
func DevTestLabName() pluginsdk.S... |
aefb62ac04354c779f0fbad55fc0fd8eee0c85dc | 82300f4a14920e97d4bc56f2e1766c1d1e977252 | sudeepgoyal75/terraform-provider-nuagenetworks | /5.0.2.1/nuagenetworks/resource_nuagenetworks_hostinterface.go | Go | go | 9,870 | no_license | package nuagenetworks
import (
"github.com/hashicorp/terraform/helper/schema"
vspk "github.com/tpretz/vspk-go/vspk/5.0.2.1"
)
func resourceHostInterface() *schema.Resource {
return &schema.Resource{
Create: resourceHostInterfaceCreate,
Read: resourceHostInterfaceRead,
Update: res... |
50df8912d2afa323cb1a4a4133dda4e86c16a2d7 | bc1c56a8be90732a4594baf1b2b93df7f2e3563c | Qianshuaishuai/PaperUtils | /models/orderkeypoint_data.go | Go | go | 379 | no_license | package models
import "time"
type OKeyPoint struct {
ID int `gorm:"column:id"`
Name string `gorm:"column:name"`
Parent int `gorm:"column:parent"`
SubjectID int `gorm:"column:subject_id"`
CreationDate time.Time `gorm:"column:creation_date"`
Modi... |
8fe8d8f89b9352064e8dbf77840832f018751328 | 93d4d2e5b6b7534891c5c6911e9f2b07580f6ad0 | Cocos-BCX/VoteCocosBCX | /srv/handlers/witnesses.go | Go | go | 2,551 | permissive | package handlers
import (
"net/http"
"github.com/Cocos-BCX/VoteCocosBCX/srv/config"
"github.com/Cocos-BCX/VoteCocosBCX/srv/models"
"github.com/gin-gonic/gin"
"fmt"
)
type AmountRaw struct {
Amount float64 `json:"amount"`
AssetID string `json:"asset_id"`
}
type WitnessSupporter struct {
AccountID string... |
74b0000cea370fa3d36a334a3e0c0f5b16c16bad | 7921cef47105728f38895b0b33fffca65cb61f99 | cone/golastic | /golastic_test.go | Go | go | 2,899 | permissive | package golastic
import (
"fmt"
"strconv"
"testing"
)
func TestGolastic_Find(t *testing.T) {
golastic, err := New("http://localhost:9200")
if err != nil {
Error(t, err)
}
resultItem, err := golastic.From("test", "product").Find("1")
if err != nil {
t.Error("An error has ocurred: " + err.Error())
}
Ass... |
24ed87a3475675dfd89eb9aaa2df7530e77a6ba6 | bb2bdbe46fbf8126f75195bdd8542950dbdcb23d | Apegetinfo/antrea | /pkg/antctl/transform/appliedtogroup/transform.go | Go | go | 2,273 | permissive | // Copyright 2020 Antrea 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 ... |
1f81da5d78af5b26c35980b90e79eaeab31c0296 | 0b617293fa37cdd3377f15baa887f70b81d3f4b5 | Vasary/merger | /src/service/sort/sort_test.go | Go | go | 635 | no_license | package sort
import (
"merger/src/entity"
"testing"
)
var dataProvider = []struct {
points int64
trustLevel int64
}{
{-1, 100},
{3, 100},
{5, 100},
{5, 100},
{3, 100},
{15, 100},
{12, 100},
{12, 100},
{15, 100},
{15, 100},
{15, 100},
{15, 300},
{15, 200},
}
func TestSort(t *testing.T) {
var lis... |
236b75f213e0474afee0f2c565c3c8b96e495241 | 4b4e65813bad482bd491414502b90b82dcee94e8 | MacPaw/cert-manager | /pkg/controller/clusterissuers/util_test.go | Go | go | 2,609 | permissive | /*
Copyright 2019 The Jetstack cert-manager contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed... |
2776b13156dc5ff92ff637445072395e700a41a6 | 9e85408c7de93c9b43d26329202b7e9e9261e991 | huqinlou0123/seal-go | /bobby-resources/go-src/mxshop-api/order-web/initialize/config.go | Go | go | 2,206 | no_license | package initialize
import (
"encoding/json"
"fmt"
"github.com/nacos-group/nacos-sdk-go/clients"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/spf13/viper"
"go.uber.org/zap"
"mxshop-api/order-web/global"
)
func GetEnvInfo(env string) bool {
viper.... |
f0f73edfb7cc2efc00a945336a7609a0ecfe013d | 48966cde665d7c355cb94c0c2553231363a75f72 | akshay196/learngo-exercises | /13-loops/exercises/06-infinite-kill/main.go | Go | go | 2,050 | no_license | // Copyright © 2018 Inanc Gumus
// Learn Go Programming Course
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
//
// For more tutorials : https://learngoprogramming.com
// In-person training : https://www.linkedin.com/in/inancgumus/
// Follow me on twitter: https://twitter.com/inancgumus
package main
... |
4cfb845a1f962ae836cb9d5ae4e48ccfca53a4ce | 636dd5088f83ea327bbfc2429149aa847d7183b0 | godcong/leetcode | /code/2500/2500/delete-greatest-value-in-each-row_test.go | Go | go | 467 | permissive | package _2500
import (
"testing"
. "github.com/godcong/leetcode/common"
)
func Test_deleteGreatestValue(t *testing.T) {
type args struct {
grid [][]int
}
tests := []struct {
name string
args args
want int
}{
// TODO: Add test cases.
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {... |
149a942ae49ec99e3ec466162be3a3f06ff740d5 | 5871f85779a045013ac2aa4939fe8f4ad4407621 | dnldd/dcrpool | /network/message.go | Go | go | 15,997 | permissive | // Copyright (c) 2018 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package network
import (
"bytes"
"encoding/hex"
"encoding/json"
"fmt"
"math/big"
"strings"
"github.com/decred/dcrd/wire"
"github.com/decred/dcrpool/dividend"
"github... |
0b2281f35dc18ab998df8a1b1ae8a60ff687ccae | 6d91566766e0142dded37727c6dc7516d48f601d | ibisheng/jose | /jws/jws_test.go | Go | go | 7,119 | permissive | package jws
import (
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"math/rand"
"testing"
"github.com/docos/jose/crypto"
)
type easy []byte
func (e *easy) UnmarshalJSON(b []byte) error {
if len(b) > 1 && b[0] == '"' && b[len(b)-1] == '"' {
b = b[1 : len(b)-1]
}
// json.Marshal encodes easy as it wou... |
a75a56f90c14fadc8c536af713045efc994f6ce3 | 6a21d81285506d46cc1058322ff2621d736537dd | pastorgod/oxygen | /src/base/consistent.go | Go | go | 6,065 | no_license | // Copyright (C) 2012 Numerotron Inc.
// Use of this source code is governed by an MIT-style license
// that can be found in the LICENSE file.
// Package consistent provides a consistent hashing function.
//
// Consistent hashing is often used to distribute requests to a changing set of servers. For example,
// say y... |
85f5e7311af864fa499e6097591bbdd55381ea7b | 5da692c76a9c4d9039f17c1348487248c60051c5 | googleapis/google-cloud-go | /dataproc/internal/version.go | Go | go | 688 | permissive | // Copyright 2022 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 ... |
4cd0bf91b0d5b224e12cb4270ac54ff12397224e | b732fc1219991b42bc963a126f6690627188ecaa | errordeveloper/cilium | /hubble-relay/main.go | Go | go | 420 | permissive | // SPDX-License-Identifier: Apache-2.0
// Copyright 2020 Authors of Cilium
// Ensure build fails on versions of Go that are not supported by Cilium.
// This build tag should be kept in sync with the version specified in go.mod.
//go:build go1.17
// +build go1.17
package main
import (
"os"
"github.com/cilium/ciliu... |
58fe4732e58fa206cad6bfdba68ff3c69b269664 | 85c060ec3aa53d88aaa8a6b433df46c799a853ea | donghaonan/testgredis | /test01/support/init.go | Go | go | 516 | no_license | package support
import (
"context"
"time"
)
var (
ctx = context.Background()
client gredisapi.Client
)
func Initialize() {
ctx, cancelFunc := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFunc()
conMan := conman.NewSingleHost(ctx,
conman.Host("127.0.0.1"),
conman.Port(6379),
c... |
205e0615e8b8e33d09efc429c83244a919b8a6b1 | 4fefd0057ba54d3e2a3e6b0a20a1874dfa2597c5 | pingcap/tidb-binlog | /reparo/syncer/translate.go | Go | go | 6,623 | permissive | // Copyright 2019 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... |
ad80c389c9f09168726a3edeac31edccef853b20 | 77bb3f492c5b26a1b321e56d132c15ebbbdd6565 | johnbirdau/pulumi-azure-native | /sdk/go/azure/recoveryservices/replicationFabric.go | Go | go | 6,015 | permissive | // *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package recoveryservices
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Fabric definition.
// API Vers... |
4663a56d62dbbeeb7a41245ea57775adaebadefd | e14f46ed1cdbde283107edf443dac5d7b75244e3 | soccp/grid | /vendor/github.com/coreos/etcd/auth/range_perm_cache.go | Go | go | 3,664 | permissive | // 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 ... |
fa3187afe60796d14106cedc4d7501e2ed2852c6 | 3322ebea3641b6920e9ce05b16c93792c043332e | soteria-dag/soterd | /rpcclient/rawtransactions.go | Go | go | 24,483 | permissive | // Copyright (c) 2014-2017 The btcsuite developers
// Copyright (c) 2018-2019 The Soteria DAG developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package rpcclient
import (
"bytes"
"encoding/hex"
"encoding/json"
"github.com/soteria-dag/soterd/soterjson"
... |
2f77d5ef96de65d798e8f15bb2e062e7ce5bbe5b | f0838108a94875fc64ca4644e14c8323655f8a52 | shotaimai66/go_api | /cmd/lambda/main.go | Go | go | 944 | no_license | package main
import (
"context"
"log"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/awslabs/aws-lambda-go-api-proxy/httpadapter"
"go_api/gen/restapi"
"go_api/gen/restapi/operations"
"github.com/go-openapi/loads"
)
var httpAdapter *httpadapter.HandlerAdapter
// Handl... |
8586b80760f36d2071ecc86bfb4e0d288bb20150 | 86d0635bb51903e32e20913ac4ac289c87ec72e6 | tickers/circonus-kubernetes-agent | /internal/circonus/metrics.go | Go | go | 7,346 | no_license | // Copyright © 2019 Circonus, Inc. <support@circonus.com>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
package circonus
import (
"errors"
"fmt"
"regexp"
"strings"
"time"
cgm "github.com/circonus-labs/circonus-gometrics/v3"
)
const (
// MetricTypeI... |
8f5b1a53105df8be52eea1b94016b16e00246250 | ff3d04734ba8f5e4513e99a89debff986b422fa9 | ikawaha/bluge | /cmd/bluge/cmd/list.go | Go | go | 1,340 | permissive | // Copyright (c) 2020 The Bluge 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 agr... |
9458e60ff9e60cbaaee283cc632488e45ff46352 | f9c1e562c97922ca5d13626e5b4d1727f537f6d0 | IllusionalResult/PBL1 | /service/cart.go | Go | go | 1,988 | no_license | package service
import (
"github.com/PBL1/model"
)
// PostIngredientsToCart ...渡された材料データをカートテーブルに追加する
func PostIngredientsToCart(userID string, modelIngredients []model.Ingredient) error {
cart := model.Cart{}
numOne := uint(1)
for _, modelIngredient := range modelIngredients {
cart.UserID = userID
cart.Reci... |
a90d2fd102f50f12c67355907edc333299aae845 | 33d9b801448c67e34ee8cd3a8bb6abdaac0f9eca | arita37/aistore | /downloader/throttler.go | Go | go | 3,530 | permissive | // Package downloader implements functionality to download resources into AIS cluster from external source.
/*
* Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
*/
package downloader
import (
"context"
"errors"
"io"
"time"
"github.com/NVIDIA/aistore/cmn"
)
var (
errThrottlerStopped = errors.New(... |
4ffa673572f401d46db85e82d6918e312c1dd32b | 9d90af4537de7a4e97da263dbe87ca2ee74376b3 | brunofrank/go-netdicom | /serviceuser.go | Go | go | 13,078 | permissive | // This file implements the ServiceUser (i.e., a DICOM DIMSE client) class.
package netdicom
import (
"errors"
"fmt"
"net"
"sync"
"github.com/yasushi-saito/go-dicom"
"github.com/yasushi-saito/go-dicom/dicomio"
"github.com/yasushi-saito/go-dicom/dicomuid"
"github.com/yasushi-saito/go-netdicom/dimse"
"github.c... |
52998aebe077fb0b03b7ec309cb9fb0efaade63a | edeb4e897210ffbcc338b556db609e145f41da2f | bsrinivasguptha/sourcegraph | /monitoring/precise_code_intel_worker.go | Go | go | 8,733 | permissive | package main
import "time"
func PreciseCodeIntelWorker() *Container {
return &Container{
Name: "precise-code-intel-worker",
Title: "Precise Code Intel Worker",
Description: "Handles conversion of uploaded precise code intelligence bundles.",
Groups: []Group{
{
Title: "General",
Rows: ... |
aaca51fb4cf9979f2ac7ccc47e79a021d3eef07a | 7e5a3b85a0b87f71d6d9fa01ac2c81b40e07cc0f | AndreyBronin/insolar | /component/subcomponents_test.go | Go | go | 2,912 | permissive | //
// Copyright 2019 Insolar Technologies GmbH
//
// 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... |
1075875b114d7be41abafafd3011ab28dbb77a26 | 513181c3090d24db74772bb75a5c5f41e9c304b2 | TrendingTechnology/easemesh | /emctl/cmd/client/resource/observabilityoutputserver.go | Go | go | 1,708 | permissive | /*
* Copyright (c) 2017, MegaEase
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... |
ae19126ca4764c2d672008a0864a4ecc3043c4be | 674cfc22423c469343c79690d2172cd8a09fd2fa | money-hub/MoneyDodo.service | /review/pkg/service/service.go | Go | go | 3,723 | permissive | package service
import (
"context"
"fmt"
"log"
"github.com/money-hub/MoneyDodo.service/db"
"github.com/money-hub/MoneyDodo.service/model"
)
// ReviewService describes the service.
type ReviewService interface {
// Add your methods here
// e.x: Foo(ctx context.Context,s string)(rs string, err error)
// 商家提交审... |
91636af97ee97fdaa5327d59e974a29f10b5ca30 | 3791ea0c2db4f1ff25605539e449d1ec6d4d7e35 | go-steven/yunpian | /sign.get.with.add.go | Go | go | 604 | no_license | package yunpian
import (
"errors"
)
func GetSignWithAdd(apiReq *GetSignRequest) (*Sign, error) {
if apiReq.Sign == "" {
return nil, errors.New("empty sign.")
}
signs, err := GetSign(apiReq)
if err != nil {
return nil, err
}
if len(signs) > 0 {
return signs[0], nil
} else {
req := &AddSignRequest{}
r... |
cb32735322851d13959a34f02ed80c32fb4d3b37 | c580d88a6c32479bb00b187ee5e6fb6b44169db4 | mygirlinyesterday/golang-authen-skelaton-final | /api/router/routes/routes.go | Go | go | 1,034 | no_license | package routes
import (
"net/http"
"github.com/gorilla/mux"
"github.com/playground/api/middlewares"
)
type Route struct {
Uri string
Method string
Handler func(http.ResponseWriter, *http.Request)
AuthRequired bool
}
func Load() []Route {
routes := usersRoutes
routes = append(routes, pos... |
7e7d9ac2d0e83ac521c6c7758a027adf96829df7 | 2606ed74ee8c3303214a6bad58bcc79514aaa93e | riccardomc/teleq | /server/server.go | Go | go | 410 | permissive | package stackserver
import (
"github.com/julienschmidt/httprouter"
"github.com/riccardomc/teleq/stack"
)
//ServerInterface represents a server
type ServerInterface interface {
Size() httprouter.Handle
Peek() httprouter.Handle
Push() httprouter.Handle
Pop() httprouter.Handle
SetPort(int) ServerInterface
SetRou... |
283334e9bf8316239277b4eb538e8164a41cda6a | cfe80b342561709bbc95a8c26a29e815bb006d74 | SuperXXZJO/chessgame2.0 | /chessgame2.0/model/user.go | Go | go | 699 | no_license | package model
import (
"github.com/dgrijalva/jwt-go"
"github.com/jinzhu/gorm"
)
type User struct {
gorm.Model
Username string `json:"username" form:"username" gorm:"size:10;not null"`
Password string `json:"password" form:"password" gorm:"size:16;not null"`
}
type UserToken struct {
Username string
jwt.Standa... |
3113f2de698c38761a9daebb97f03a7307031129 | 5b2118f80fc647fc72a727d8c548aeab1f85e228 | marpaia/lessor | /pkg/template/base_test.go | Go | go | 426 | no_license | package template_test
func rendered() string {
return `apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: kuard
name: kuard
namespace: acme-labs
spec:
replicas: 1
selector:
matchLabels:
run: kuard
template:
metadata:
labels:
run: kuard
spec:
containers:
... |
c4dfdcd56fbee12d2a4c86faf4089b303f9cf1bd | 586d78f9cc3b2373091bb2d7fadba9b5732d7079 | suzuki-shunsuke/go-client-mongodb-atlas | /mongodbatlas/alert_configurations_test.go | Go | go | 17,548 | permissive | package mongodbatlas
import (
"encoding/json"
"fmt"
"net/http"
"testing"
"github.com/go-test/deep"
"github.com/openlyinc/pointy"
)
func TestAlertConfiguration_Create(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()
groupID := "6d2065c687d9d64ae7acdg41"
mux.HandleFunc(fmt.Sprintf("/gro... |
84ff4da3d5e316a10e7293f6286b7316bddf056e | 5f87be46f65bbcaa98d8ddcd033587ccc0ca888c | evie404/nomnom | /gen/parse_test.go | Go | go | 3,641 | permissive | package gen
import (
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_listEnumTypes(t *testing.T) {
tests := []struct {
name string
filepath string
want []Enum
}{
{
"list enum types",
filepath.Join("fixtures", "types.go"),
... |
b3b341d8708f92df1e7a8c049d8c7ef33c588ec3 | 000f78909432186b794ed7a9eb9266c92dc97946 | airplanedev/dlog | /example_test.go | Go | go | 1,017 | permissive | package dlog_test
import (
"bufio"
"context"
"fmt"
"log"
"net"
"net/http"
"github.com/airplanedev/dlog"
)
func ExampleNewReader() {
client := &http.Client{
Transport: &http.Transport{
DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) {
conn, err := net.Dial("unix", "/var... |
3e4e35d155e704b4d4896b24b8703650525f7c42 | c08df86165fc30e3dc338fccec0e38d81630a0aa | hiaa211/csvtk | /csvtk/cmd/filter2.go | Go | go | 9,658 | permissive | // Copyright © 2016-2019 Wei Shen <shenwei356@gmail.com>
//
// 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, mo... |
1b66485724630832b5605f726ef78cd5e7d0bd7d | b5591c3f9419a9ec64fe8a7bc48e94e5839e6d48 | maicoder/HelloWorld-Go | /src/ch6/slice_test/slice_test.go | Go | go | 1,010 | permissive | package slice_test
import "testing"
func TestSliceInit(t *testing.T) {
var s0 []int
t.Log(s0, len(s0), cap(s0))
s0 = append(s0, 1)
t.Log(s0, len(s0), cap(s0))
s1 := []int{1, 2, 3, 4}
t.Log(s1, len(s1), cap(s1))
s1 = append(s1, 5, 6, 7, 8, 10)
t.Log(s1, len(s1), cap(s1))
s1 = append(s1, 9, 7, 8, 9)
t.Log(... |
3c0ce04a79466458cf81aa56e11b0b19c3acb012 | 4074ce4a68e9737320b10b40f45fdbf34303d269 | delgyd/lotus | /api/test/test.go | Go | go | 5,230 | permissive | package test
import (
"context"
"testing"
"time"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/types"
"github.com/multiformats/go-multiaddr"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-state-types/abi... |
780d3c86a451dee71d801464d21cadb12847d17b | f4d6d2468b57b3e21f5f048769985b3b311abf3f | TheJimmyBlaze/Ember-CertificateAuthority | /database/database.go | Go | go | 1,265 | permissive | package database
import (
"database/sql"
"log"
"github.com/thejimmyblaze/ember/common"
)
type Database struct {
SQL *sql.DB
}
func New(config common.Config) (*Database, error) {
dbFileName := config.GetDBFileName()
log.Printf("Preparing Ember Database: %s...", dbFileName)
db, err := sql.Open("sqlite3", dbF... |
c7473017ca416e14b88b5496763be117fad6606e | 4ca023205e74d926dfb4eec6803d5e3a890db00c | dfsly/genshin-level-up | /cmd/genshin-level-up/apis/view/skills.go | Go | go | 8,834 | no_license | package view
import (
"context"
"fmt"
"strings"
"github.com/morlay/genshin-level-up/pkg/calculator"
"github.com/morlay/genshin-level-up/genshindb"
. "github.com/morlay/genshin-level-up/pkg/jsx"
)
func Skills(c *calculator.Character) Component {
pl := genshindb.PromoteLevel(c.Level)
skillLevels := make([]uin... |
caee21dee029ae3e6a12d5f1a1e58e35fddfc475 | 67d4b9c07f2eb4dab4d0c3283645f0bd78327690 | ovh/cds | /contrib/grpcplugins/action/plugin-arsenal-delete-alternative/main.go | Go | go | 3,688 | permissive | package main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/golang/protobuf/ptypes/empty"
"github.com/ovh/cds/contrib/integrations/arsenal"
"text/template"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/grpcplugin/actionplugin"
"github.com/ovh/cds/sdk/interpolate"
)
/* Inside contrib/grpcpl... |
8a05b931b3a0f8eee332a796e399564ee04d76ac | e1aa2237c0c3c0eee9028537680a9e6518081e12 | kirutthika/spire | /pkg/common/telemetry/config.go | Go | go | 697 | permissive | package telemetry
import (
"github.com/sirupsen/logrus"
)
type MetricsConfig struct {
FileConfig FileConfig
Logger logrus.FieldLogger
ServiceName string
Sinks []Sink
}
type FileConfig struct {
Prometheus *PrometheusConfig `hcl:"Prometheus"`
DogStatsd []DogStatsdConfig `hcl:"DogStatsd"`
Statsd ... |
e6d90aa3274c2a283ccc17a8f21b308e3ce35a40 | 3e2975048fc280cc4bfb310a40bd632c91c8f702 | conchoid/gae | /impl/cloud/context.go | Go | go | 5,386 | permissive | // Copyright 2016 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... |
5b7fc73ee05c9270e79f54df22fae0ceab0e090a | 88fb55fe5f773d7cb2377bb92a897508e7e011b8 | laudarch/iso20022 | /PartyIdentification36.go | Go | go | 638 | permissive | package iso20022
// Identification of an entity involved in an activity.
type PartyIdentification36 struct {
// Identification of the party.
Identification *PartyIdentification12Choice `xml:"Id"`
// Unambiguous identification of the transaction for the party identified.
ProcessingIdentification *Max35Text `xml:"... |
d65e0031e819b3a90227d134ba9f783a9423371c | ed15e906d5ba1e0ce21045419fc583a650be5f7a | devBash99/gonum | /graph/layout/isomap_386_test.go | Go | go | 290 | permissive | // Copyright ©2020 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build 386
package layout_test
// Change the testdata path for calculations done on 386.
func init() {
arch = "_386"
}
|
53f7bd8a6226d37ab966e344e085a89b89668adf | dab2bb88b9b18e98a69f06c0fe46714735129af7 | jonathanfoster/digitox | /server/handlers/device.go | Go | go | 3,831 | no_license | package handlers
import (
"encoding/json"
"io/ioutil"
"net/http"
"github.com/jonathanfoster/digitox/models/device"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/jonathanfoster/digitox/models/blocklist"
"github.com/jonathanfoster/digitox/store"
)
// ListDevices handles the GET /devices... |
28749724029c1fb02c869900fdb0c2f1d70b4f7e | 070bd38994ecf57719777ea49d01b3331dbeed0f | open-policy-agent/opa | /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go | Go | go | 582 | permissive | // 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.
// +build linux,!gccgo,386
package unix
import "syscall"
// Underlying system call writes to newoffset via pointer.
// Implemented in assembly to avoid alloc... |
5743c81f6e56e3b8fdfa10e0ebbf67ec6f4b7326 | 252128e7f544825de3aa7553e85f5040133a502b | erda-project/erda | /internal/apps/dop/dicehub/endpoints/release.go | Go | go | 11,378 | permissive | // Copyright (c) 2021 Terminus, 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 agree... |
580be8e30b044bd1f427ef5e834b7615f735e9e7 | 465210bb5ece81ac6c1c1f1cbc7a04efa5839577 | LSFLK/GIG | /app/repositories/drivers/mongodb_official/user_repository.go | Go | go | 2,142 | permissive | package mongodb_official
import (
"GIG/app/constants/database"
"GIG/app/databases/mongodb_official"
"GIG/app/repositories/interfaces"
"github.com/lsflk/gig-sdk/models"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
type UserRepository struct... |
ed30d632a56f96624cb3b91c97da69b6785c0d0f | 4a72275419612cf141f907354895856c24acaf38 | innermond/enginium | /api/api.go | Go | go | 807 | no_license | package api
import (
"fmt"
"log"
"net/http"
"os"
"github.com/innermond/printoo/person"
"github.com/innermond/printoo/printoo"
"github.com/innermond/printoo/printoo/action"
)
type api struct {
Person http.Handler
Close func()
}
func NewApi() *api {
// build DNS string for database
dbname := os.Getenv("DB... |
98999e320a6bff4009f38193a318d4dd94f84078 | bdee4923c9c8257a18e81d98b9146cf666a04119 | MrDefinite/gedis | /protocol/resp/constants.go | Go | go | 708 | permissive | package resp
import "github.com/pkg/errors"
type DataType int8
const (
defaultBufferCap = 1024
)
const (
TypeSimpleString = iota
TypeBulkString
TypeError
TypeInteger
TypeArray
)
const (
simpleString = '+'
gedisError = '-'
integers = ':'
bulkString = '$'
arrays = '*'
)
const (
Crlf = "\r\... |
58e11e15e858903f4ec4b0f9aeef60e1cf8c80e4 | 8d9f3257bed20d54547fb6d9010e01a41feed382 | aruaru0/golang_myatcoder | /yukicoder/000-999/392/main.go | Go | go | 1,472 | no_license | package main
import (
"bufio"
"fmt"
"os"
"sort"
"strconv"
)
func out(x ...interface{}) {
fmt.Println(x...)
}
var sc = bufio.NewScanner(os.Stdin)
func getInt() int {
sc.Scan()
i, e := strconv.Atoi(sc.Text())
if e != nil {
panic(e)
}
return i
}
func getInts(N int) []int {
ret ... |
9e85933dabb99d4d1b7e599cfafef82a560598cc | 3c7815126702ed5d7893583194608876ae6c0397 | Azure-ukgov-paas/paas-cli | /cf/commands/application/app_test.go | Go | go | 22,639 | permissive | package application_test
import (
"encoding/json"
"time"
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/api/resources"
"github.com/cloudfoundry/cli/cf/api/stacks/stacksfakes"
"github.com/cloudfoundry/cli/cf/commandregistry"
"github.com/cloudfoundry/cli/cf/commands/application"
"github.co... |
7295bcc05306491e7a96c141a1189a443ac43e53 | 3f9651913ae24bfdd855e6b5707e2fb08b63bdf9 | sarvex/cayley | /graph/iterator/and_iterator_test.go | Go | go | 3,037 | permissive | // Copyright 2014 The Cayley 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 ap... |
30541c3197e58864a6ca255bba8b7dfb48b839a6 | 927fdcac2bff2295266daa69c67555fae3bba219 | thunderven/alibabacloud-go-sdk | /actiontrail-20200706/client/client.go | Go | go | 14,138 | permissive | // This file is auto-generated, don't edit it. Thanks.
package client
import (
endpointutil "github.com/alibabacloud-go/endpoint-util/service"
rpc "github.com/alibabacloud-go/tea-rpc/client"
util "github.com/alibabacloud-go/tea-utils/service"
"github.com/alibabacloud-go/tea/tea"
)
type ListDeliveryHistoryJobsRequ... |
a65bc4af877e9ff20f79db1584a33df5571e7d7e | 35a6b339d97f607165842f38aaa14dd121bd20e0 | tanordheim/babyname-tinder | /psql/repository.go | Go | go | 14,834 | permissive | package psql
import (
"context"
"database/sql"
"fmt"
"time"
"github.com/jmoiron/sqlx"
"github.com/pkg/errors"
"github.com/tanordheim/babyname-tinder"
)
// Repository encapsulates all PostgreSQL storage mechanics.
type Repository struct {
db *sqlx.DB
}
var _ babynames.Repository = &Repository{}
func (r *Rep... |
2adb9c96ee52cb6a8630ca12e3466603ca9e19a1 | f403756162cb38a1a7a788c096a94bd8fb2bc316 | Smcculle/exercism | /go/pangram/pangram.go | Go | go | 419 | no_license | package pangram
// IsPangram checks a string s to see if it contains at least one of each char in [a-z]
func IsPangram(s string) bool {
if len(s) < 26 {
return false
}
var flags uint32 // instead of a map, use the lower 26 bits as an alphabet flag for each char
var c byte
for i := 0; i < len(s); i++ {
c = s[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.