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 |
|---|---|---|---|---|---|---|---|---|
cd9b18e025951d406de777f188bbbeda7cd71284 | 740f243d26c16377a8b12f5a63f9ad142d40d00d | rgolangh/ovirt-image-upload | /pkg/upload/image_upload.go | Go | go | 6,738 | permissive | package upload
import (
"bufio"
"crypto/tls"
"fmt"
"io"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
ovirtsdk4 "github.com/ovirt/go-ovirt"
"github.com/rgolangh/ovirt-image-upload/pkg/ovirt"
log "github.com/sirupsen/logrus"
)
const BufferSize = 50 * 1048576 // 50MiB
fun... |
830e493debd9b39581b2f2108c9485f63026235d | 5cf8cfe3683b985464e45a9ea177c4002b9fb537 | nathanawmk/pango | /poli/pbf/pano.go | Go | go | 4,875 | permissive | package pbf
import (
"fmt"
"strings"
"github.com/PaloAltoNetworks/pango/audit"
"github.com/PaloAltoNetworks/pango/namespace"
"github.com/PaloAltoNetworks/pango/util"
)
// Panorama is the client.Policies.PolicyBasedForwarding namespace.
//
// The "dg" param in these functions is the device group.
//
// The "base... |
311df0a49f34cdc0d5d0605b096da8cd20f3673f | 152100c03858bbe2f24513a123102568e0a02eec | oshorefueled/taxexpress | /handlers/auth.go | Go | go | 2,175 | no_license | package handlers
import (
"encoding/json"
"github.com/go-chi/chi"
"github.com/oshorefueled/taxexpress/models"
"golang.org/x/crypto/bcrypt"
"log"
"net/http"
)
type authHandler struct {
handlerHelper
}
func authRoute (r chi.Router) {
h := authHandler{}
r.Post("/login", h.login)
r.Post("/register", h.register... |
6bbeba8458e081c17dc14a28d27ecc9bfbccd1da | cc851ac42f82705cdcfa74601e5a873047c1be46 | g0dspeak/vapor-http-proxy | /proxy/proxy.go | Go | go | 5,398 | permissive | package proxy
import (
"bufio"
"encoding/json"
"errors"
"github.com/gorilla/mux"
"io"
"log"
"net"
"net/http"
"sync"
"sync/atomic"
"time"
"../rpc"
)
type ProxyServer struct {
config *Config
miners MinersMap
blockTemplate atomic.Value
upstream int32
upstreams []*rpc.RP... |
9fe758d2aa265599e5f18f12ee47c090d19d3d4b | 4f092eecb960be72dda57247e0afc8692db1a200 | heyuanlong1/golang_test | /go_my_page/src/common/conn.go | Go | go | 899 | no_license | package common
import (
"fmt"
"database/sql"
_ "github.com/go-sql-driver/mysql"
"github.com/hoisie/redis"
CONF "conf"
"strconv"
)
var (
client *redis.Client
)
func GetMysql()(*sql.DB,error) {
var ss string
ss = fmt.Sprintf("%s:%s@tcp(%s:%d)/test?charset=utf8",
CONF.Mysql_user_name,
CONF.... |
a0a5b17c99790ea40d9027a7778c1ec2739a3c20 | 0598d1f11d808f2a313aed6bed9e4ae71ec64df7 | suryatmodulus/timeseriesdatabase-comparisons | /cmd/bulk_load_splunk/main.go | Go | go | 9,554 | permissive | // bulk_load_influx loads an InfluxDB daemon with data from stdin.
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"log"
"os"
"runtime"
"runtime/pprof"
"strings"
"sync"
"time"
"github.com/taosdata/timeseriesdatabase-comparisons/bulk_data_gen/common"
"github.com/taosdata/timeseriesdatabase-comparisons... |
6ea4278c45b2aae209ee754f008a906b58587a82 | c493501dc1c488ae1592695d8712ddc7815232a5 | strusty/worldbit-wifi | /services/radius/service_test.go | Go | go | 1,673 | no_license | package radius
import (
"testing"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/strusty/worldbit-wifi/radius_database"
)
type CheckStoreMock struct {
CreateFn func(check *radius_database.Check) error
}
func (mock CheckStoreMock) Create(check *radius_database.Check) error {
return mo... |
b9ec598af233e23ccbe28f391cc7d38d8cbec3e1 | c3a3f99154f8998afd8187ee43369ae6551f5e7e | lcezermf/exercism | /go/raindrops/raindrops.go | Go | go | 397 | no_license | package raindrops
import (
"bytes"
"strconv"
)
const testVersion = 2
func Convert(number int) string {
var message bytes.Buffer
messages := map[int]string{
3: "Pling",
5: "Plang",
7: "Plong",
}
for key := range messages {
if number%key == 0 {
message.WriteString(messages[key])
}
}
if message.S... |
be2d004fb8720f01f43297200c166dada6793dfc | 59fa65a86dfd65eaf5ae95f71e3f4888353f9300 | rocket049/tray-controller-qt | /traycontroller-config/gui.go | Go | go | 9,211 | permissive | package main
import (
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/widgets"
"github.com/rocket049/gettext-go/gettext"
)
const (
linuxOs int = iota
windowOs
)
type myCfg struct {
... |
d6832ec65d0da72f0e6bab680e06a777870055d0 | cb015742e00f1ae5422a84164410925ae0e2e14c | jokhedz/velero | /pkg/controller/restore_controller.go | Go | go | 22,544 | permissive | /*
Copyright 2020 the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... |
40242e49b5f9a5aab8ea43633dca09ec629a95a5 | 44d347dd2d363bbefcd168bdf7a42be00fef44a8 | housecanary/tile38 | /tests/tests_test.go | Go | go | 3,750 | permissive | package tests
import (
"fmt"
"math/rand"
"os"
"os/signal"
"syscall"
"testing"
"time"
"github.com/gomodule/redigo/redis"
)
const (
clear = "\x1b[0m"
bright = "\x1b[1m"
dim = "\x1b[2m"
black = "\x1b[30m"
red = "\x1b[31m"
green = "\x1b[32m"
yellow = "\x1b[33m"
blue = "\x1b[34m"
magen... |
78f711bb299b4a2759e1ba8353b1cab115d873c2 | 8a6437a5ba669d0729d77115e6adaab0e4270f9b | freeformz/jeera | /cmd/internal/config/config.go | Go | go | 2,361 | no_license | package config
import (
"crypto/x509"
"encoding/json"
"encoding/pem"
"fmt"
"io"
"os"
"os/user"
"path"
"path/filepath"
"github.com/dghubble/oauth1"
)
func settingsData() (io.ReadCloser, error) {
u, err := user.Current()
if err != nil {
return nil, err
}
return os.Open(filepath.Join(u.HomeDir, ".confi... |
be1071700d9ff639ebfef7f2513db873417eba6f | a98bfe4d51efa13f1cfb25ae0908afaa736ccd8b | yancoo/tidb | /statistics/selectivity.go | Go | go | 8,816 | permissive | // Copyright 2017 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... |
717b02dada4193b330b5b16ed55671c670208df3 | 73ca3324674f074ec500eb1eaeb1b83f8eeb476d | XiaoMi/Gaea | /parser/opcode/opcode.go | Go | go | 2,731 | permissive | // Copyright 2015 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... |
8309c9dc89d63012c013af96c5e250f6ed4541b8 | 1aa442b86e53da55779a88a14110751484593902 | jordanjennings/databricks-terraform | /databricks/resource_databricks_dbfs_file.go | Go | go | 3,309 | permissive | package databricks
import (
"fmt"
"github.com/databrickslabs/databricks-terraform/client/service"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"log"
"path/filepath"
"strings"
)
func resourceDBFSFile() *schema.Resource {
return &schema.Resource{
Create: resourceDBFSFileCreate,
Read: resourceD... |
239faa5a2a3824e7b728294b057b1885bd63244c | f0897ce63de370eeaaea116cb31db6e371f52168 | manyminds/api2go | /context.go | Go | go | 1,793 | permissive | package api2go
import (
"context"
"time"
)
// APIContextAllocatorFunc to allow custom context implementations
type APIContextAllocatorFunc func(*API) APIContexter
// APIContexter embedding context.Context and requesting two helper functions
type APIContexter interface {
context.Context
Set(key string, value inte... |
746a72a87d0cee7ac2a8549cdbcf7a315552de69 | 1e27f970b33b53a067012a461d8911d1fa64f986 | coreos/tectonic-installer | /installer/vendor/github.com/hashicorp/hil/ast/output.go | Go | go | 1,742 | permissive | package ast
import (
"bytes"
"fmt"
)
// Output represents the root node of all interpolation evaluations. If the
// output only has one expression which is either a TypeList or TypeMap, the
// Output can be type-asserted to []interface{} or map[string]interface{}
// respectively. Otherwise the Output evaluates as a... |
dbd6845aa6057a247881c50f423a52717063050e | 808b5e77d4eb2a45aad802b21d74a0e5975a25f7 | ggtakec/k2hdkc_go | /tests/getsubkeys.go | Go | go | 6,262 | permissive | //
// k2hdkc_go
//
// Copyright 2018 Yahoo Japan Corporation.
//
// Go driver for k2hdkc that is a highly available and scalable distributed
// KVS clustering system. For k2hdkc, see
// https://github.com/yahoojapan/k2hdkc for the details.
//
// For the full copyright and license information, please view
// the license... |
d663a8ce5e14c4a4e6c4739f5f6053a42f858d4d | e84d241a25043d4ea046e0eeea8fa6e56e5a88b8 | jangocheng/gopher | /topic.go | Go | go | 12,567 | permissive | /*
主题
*/
package gopher
import (
"fmt"
"html/template"
"net/http"
"sort"
"time"
"github.com/gorilla/mux"
"github.com/jimmykuu/wtforms"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
// 用于测试
var testParam func() = func() {}
type City struct {
Name string `bson:"_id"`
MemberCount int `bson:"count"`... |
87c8ae1bc9e54f2ee77029bd207f88d74fdec6cf | 7b98504c66907d74068ec3777b6ce4ed903a2700 | kidmam/echo | /translator.go | Go | go | 1,162 | permissive | /*
Copyright 2016 Wenhui Shen <www.webx.top>
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 ... |
a55164701975bd78dfb1c8d39f5b7e5e6e44f5dc | 6f75b8357eabc0474edbf2add6ded4e93e2a696a | kitspace/gitea | /modules/queue/queue_channel.go | Go | go | 4,265 | permissive | // Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package queue
import (
"context"
"fmt"
"runtime/pprof"
"sync/atomic"
"time"
"code.gitea.io/gitea/modules/log"
)
// ChannelQueueType is the type for channel queue
const ChannelQueueType Type = "channel"
// ChannelQueueCo... |
0f12c734e8686455aa1a4e66c9fc049dee21e4df | 7fa2f780d760a46ec2fefd9c99e85c73832a609b | bcbchain/genesis-smart-contract | /ibc/ibc_sdk.go | Go | go | 233 | no_license | package IBC
//
////SetSdk This is a method of Dice2Win
//func (i *Ibc) SetSdk(sdk sdk.ISmartContract) {
// i.sdk = sdk
//}
//
////GetSdk This is a method of Dice2Win
//func (i *Ibc) GetSdk() sdk.ISmartContract {
// return i.sdk
//}
|
b2840cd736df45108243e97200b6500afabd54fb | 8b3aa2b80fc14c084779982b11e26a80568e7870 | frankneu/leetcode | /src/alg-search/PostOrderSearch.go | Go | go | 2,021 | no_license | package main
import "container/list"
/**
第一种思路:
对于任一结点P,将其入栈,然后沿其左子树一直往下搜索,直到搜索到没有左孩子的结点,此时该结点出现在栈顶,但是此时不能将其出栈并访问,因此其右孩子还为被访问。
所以接下来按照相同的规则对其右子树进行相同的处理,当访问完其右孩子时,该结点又出现在栈顶,此时可以将其出栈并访问。
这样就保证了正确的访问顺序。
可以看出,在这个过程中,每个结点都两次出现在栈顶,只有在第二次出现在栈顶时,才能访问它。
因此需要多设置一个变量标识该结点是否是第一次出现在栈顶。
第二种思路:
要保证根结点在左孩子和右孩子访问之后才能访问,因此对于任一结点P,先将其... |
ff0c2962393b6f98df95823ab6d1ee00d5e88082 | 72ac6e1a9e83d54c4a41f84ffe87136ccd6e22a3 | pgroves95/Builder | /logger/logger.go | Go | go | 1,589 | no_license | package logger
import (
"Builder/artifact"
"log"
"os"
"strings"
)
var (
WarningLogger *log.Logger
InfoLogger *log.Logger
ErrorLogger *log.Logger
)
func CreateLogs(filePath string) {
logsDir := os.Getenv("BUILDER_LOGS_DIR")
//points back to already created log.txt if using 'builder' cmd
if os.Getenv("... |
79234e2c36663d575b49a81e8ea62e46820272aa | b9079d02c80d1fc1066487ee9f4bca65ee7c25b2 | jlunaq/google-api-go-client | /internal/version/version.go | Go | go | 448 | permissive | // Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:generate ./update_version.sh
// Package version contains version information for Google Cloud Client
// Libraries for Go, as reported in request headers.
package version
// Repo ... |
c6d4d0769b4871761d9cf796b02ebcd0bb79a849 | 0e3a1beb1684285ab3aede12b367f64a22e35126 | pantacor/pantahub-base | /auth/verify_token.go | Go | go | 1,976 | permissive | // Copyright 2016-2020 Pantacor Ltd.
//
// 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... |
8de822e83f46c2446e20883064b2e8914fd9835d | a95e84e422e294408fa0ccad08d85102ddd1504e | limfriend/jaeger | /cmd/query/app/query_parser_test.go | Go | go | 5,936 | permissive | // Copyright (c) 2017 Uber Technologies, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... |
daef7d2475d99c742ca9cf1d24de80d435a4e8c1 | da9659bbf030b5e008888f52c4a80203971d966b | sangwook/megos | /http.go | Go | go | 1,521 | permissive | package megos
import (
"errors"
"io/ioutil"
"net/http"
"net/url"
)
// GetHTTPResponseFromCluster will return a http.Response from one of the Mesos master nodes.
// In a cluster the master nodes can be online or offline.
// With GetHTTPResponseFromCluster you will recieve a response from one of the nodes.
func (c ... |
8889c2a0629277fb8e55ac149e253365508d9e05 | 346d42a6cc76bc907bdee5d10ebc99c517fbc50d | mpapp/sync_gateway | /rest/api_benchmark_test.go | Go | go | 9,930 | permissive | package rest
import (
"encoding/json"
"fmt"
"log"
"strings"
"testing"
"github.com/couchbase/sync_gateway/base"
"github.com/couchbase/sync_gateway/db"
)
var doc_1k_format = `{%s
"index": 0,
"guid": "bc22f4d5-e13f-4b64-9397-2afd5a843c4d",
"isActive": false,
"balance": "$1,168.62",
"picture":... |
c5ef41114e6202d69385552a8baeab56bf74cf64 | d02e662e2b31c072df236dbf13a76e632c56deff | iooikaak/consul-go-grpc-demo | /client/cmd/main.go | Go | go | 1,647 | no_license | /*
*
* Copyright 2015 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
85d6df520ac48d60c301b0452d8615bda180f818 | 2727ea35c90574b7148069c1a9e4fc7726b12500 | machworklab/ari | /client/native/client.go | Go | go | 9,406 | permissive | package native
import (
"context"
"encoding/base64"
"net/http"
"net/url"
"os"
"sync"
"time"
"github.com/CyCoreSystems/ari/v6"
"github.com/CyCoreSystems/ari/v6/rid"
"github.com/CyCoreSystems/ari/v6/stdbus"
"github.com/rotisserie/eris"
"github.com/inconshreveable/log15"
"golang.org/x/net/websocket"
)
// ... |
ee74eb982e2527eed5aa350ddfe1bbcf5587abee | 7d3f2605884759ec49d878a75a6542fb61113445 | maloft/hep | /fastjet/internal/delaunay/triangle_test.go | Go | go | 3,909 | permissive | // Copyright 2017 The go-hep Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package delaunay
import (
"testing"
"gonum.org/v1/gonum/floats"
)
func TestTriangleEquals(t *testing.T) {
tests := []struct {
a, b *Triangle
want ... |
73ea632d5d008363a62510e450ad0b99fcec052a | 445a750a2c2d2dbabceaf6d0e56e113d62d9daf0 | stevenyao01/go_sample | /src/tsfile/write/tsFileWriter/intDataPoint.go | Go | go | 546 | no_license | package tsFileWriter
import (
)
/**
* @Package Name: dataPoint
* @Author: steven yao
* @Email: yhp.linux@gmail.com
* @Create Date: 18-8-27 下午3:19
* @Description:
*/
type IntDataPoint struct {
sensorId string
tsDataType int16
value int32
}
//func (d *DataPoint) Write(v []byte) ([]byte,error) {
// r... |
38239842aacc2d8d7a754b10a8748fc6dbfa9218 | c94af73eaa9efaa0f47e4df98e2dd7ca17439c34 | yudaprama/iso20022 | /model/CashOutForecast4.go | Go | go | 1,269 | permissive | package model
// Cash movements out of a fund as a result of investment funds transactions, eg, redemptions or switch-out.
type CashOutForecast4 struct {
// Date on which cash is available.
CashSettlementDate *ISODate `xml:"CshSttlmDt"`
// Sub-total amount of the cash flow out, expressed as an amount of money.
S... |
0c7456f3d8f7bce4e53b2148d91e14dbd02e74df | 562ba46580748db1818893f895c1f0e702393f82 | annanoukou/xuperunion | /contract/bridge/syscall_service.go | Go | go | 4,867 | permissive | // Copyright (c) 2019, Baidu.com, Inc. All Rights Reserved.
package bridge
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/xuperchain/xuperunion/contractsdk/go/pb"
)
var (
ErrOutOfDiskLimit = errors.New("out of disk limit")
)
// SyscallService is the handler of contract syscalls
type SyscallSer... |
f3d6b3ffa9447db0aa38fcd112df1aa8e8f93231 | 54efa0ad51d7985afe52ae9e3d2de2d48cb0ad23 | numansiddique/ovn-kubernetes | /go-controller/pkg/config/utils_test.go | Go | go | 8,909 | permissive | package config
import (
"net"
"testing"
ovntest "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/testing"
)
func TestParseClusterSubnetEntries(t *testing.T) {
tests := []struct {
name string
cmdLineArg string
clusterNetworks []CIDRNetworkEntry
expectedErr bool
}{
{
name: ... |
06903977ca85e4eaf8e2bdde011f31961923a315 | d01726578fb8e838ab4ac411ad5830b7c7e84362 | matthewloring/core | /x/ref/test/expect/expect_test.go | Go | go | 8,492 | permissive | // Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package expect_test
import (
"bufio"
"bytes"
"fmt"
"reflect"
"strings"
"testing"
"time"
"v.io/x/ref/test/expect"
)
func TestSimple(t *testing.T... |
d482c2a6bec3a5a1eb3629e2f7ad6e8d3699f44e | 502d75b9bbca57acc795de80b38f74298cd72e26 | hoticode/apigateway | /rpc/lib/server/handlers.go | Go | go | 27,645 | permissive | package rpcserver
import (
"bytes"
"context"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"reflect"
"runtime/debug"
"sort"
"strings"
"time"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
cmn "github.com/DSiSc/apigateway/common"
"github.com/DSiSc/apigateway/log"
types "github.c... |
8cddfea7350e2120305b74734d5045d017134e85 | d51e2be2a6af1928f2c63f94f05cb34bacfc7586 | utsu3156/go-driver | /vst/authentication.go | Go | go | 4,565 | permissive | //
// DISCLAIMER
//
// Copyright 2017 ArangoDB GmbH, Cologne, Germany
//
// 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 require... |
55add408046d4fa3e15668ab9d761ec6d1934fa4 | 5f9ce07e857175522a07e23e9b937aa98e21397d | inkyblackness/hacked | /editor/archives/ViewModel.go | Go | go | 217 | permissive | package archives
type viewModel struct {
windowOpen bool
restoreFocus bool
selectedLevel int
emailIndex int
logIndex int
fragmentIndex int
}
func freshViewModel() viewModel {
return viewModel{}
}
|
1c0444013efcb936de6aa28399ae34b6e4cfd16e | 78ed0930e57b959285c05ceef74803b38e8e050a | styliteag/lego | /cmd/zz_gen_cmd_dnshelp.go | Go | go | 52,426 | permissive | package cmd
// CODE GENERATED AUTOMATICALLY
// THIS FILE MUST NOT BE EDITED BY HAND
import (
"fmt"
"os"
"sort"
"strings"
"text/tabwriter"
"github.com/go-acme/lego/log"
)
func allDNSCodes() string {
providers := []string{
"manual",
"acme-dns",
"alidns",
"auroradns",
"azure",
"bindman",
"bluecat"... |
003c78362298b79946990f507193cb29a3266aa8 | 376deb86eb10865b1c15417ea113c19eb4c32b1e | liangbohk/NaiveChain | /cmd/CLI_testmethod.go | Go | go | 255 | permissive | package cmd
import (
"NaiveChain/core"
)
func (cli *CLI) TestMethod(nodeID string) {
blc := core.BlockchainObject(nodeID)
defer blc.DB.Close()
utxoSet := &core.UTXOSet{blc}
utxoSet.Reset()
//utxoMap := blc.FindUTXOMap()
//fmt.Println(utxoMap)
}
|
e8ee7e3d71b7697dad3193e99f871da5eda6d90d | bc88dce38c013001fac6a3bde61f6803e1830e32 | FantLab/FantLab-Go | /sources/apiserver/internal/endpoints/show_genres.go | Go | go | 874 | no_license | package endpoints
import (
"fantlab/core/converters"
"fantlab/pb"
"net/http"
"google.golang.org/protobuf/proto"
)
func (api *API) ShowGenres(r *http.Request) (int, proto.Message) {
// получаем список всех жанров
genreTree := api.services.GetGenreTree(r.Context())
if genreTree == nil {
return http.StatusIn... |
4771d7fc0a03fa0b74c1ce7695a64ef7a396bb5d | c2b572c12d52f6cd068b0a0ecca6bb793b715e8b | frzb/coinboot-plugins | /src/telegraf/upstream/plugins/inputs/filecount/filecount.go | Go | go | 7,462 | permissive | package filecount
import (
"os"
"path/filepath"
"time"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/internal/globpath"
"github.com/influxdata/telegraf/plugins/inputs"
"github.com/karrick/godirwalk"
"github.com/pkg/errors"
)
const sampleConfig = `... |
6e51690fdbe7259ba7f3a3d5aabe7f1a40d30c79 | fb918e8556c97413b02a6e222090f4eb5b8b1bb3 | niklasfasching/go-org | /org/writer.go | Go | go | 2,824 | permissive | package org
import "fmt"
// Writer is the interface that is used to export a parsed document into a new format. See Document.Write().
type Writer interface {
Before(*Document) // Before is called before any nodes are passed to the writer.
After(*Document) // After is called after all nodes have been passed to the ... |
ce796166a965b6c134bf59e882c95bc88781d9ee | 05646c9b435ea147984d8a4aa399b19c51be0098 | dazhxu/ftrlCC | /chaincode/datahandle.go | Go | go | 2,077 | no_license | package chaincode
import (
"encoding/json"
"errors"
"ftrlCC/models"
"ftrlCC/train"
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric-protos-go/msp"
"github.com/hyperledger/fabric/core/chaincode/shim"
)
// 添加记录
func recordCount(stub shim.ChaincodeStubInterface, num int) error {
creatorByte, err... |
65fee7e6aefe322f73dc893c2890f91030a7e7f4 | 361a677df8ab7c5ec3ad9f92d0850e25f5fd6b67 | sotah-inc/steamwheedle-cartel-run-workload | /app/vendor/github.com/sotah-inc/steamwheedle-cartel/pkg/state/run/state_run_cleanupauctions_run.go | Go | go | 1,282 | no_license | package run
import (
"github.com/sotah-inc/steamwheedle-cartel/pkg/blizzard"
"github.com/sotah-inc/steamwheedle-cartel/pkg/sotah"
)
func (sta CleanupAuctionsState) Handle(regionRealmTuple sotah.RegionRealmTuple) sotah.Message {
realm := sotah.NewSkeletonRealm(
blizzard.RegionName(regionRealmTuple.RegionName),
... |
0a5029dfe57dab0f11d844aba6ada5cc23364bd5 | 0a6e82f32252dd2b94db93fd44fc6254446ae1fd | veerun14/hcsshim | /internal/uvm/create_test.go | Go | go | 1,003 | permissive | package uvm
import (
"context"
"fmt"
"testing"
)
// Unit tests for negative testing of input to uvm.Create()
func TestCreateBadBootFilesPath(t *testing.T) {
opts := NewDefaultOptionsLCOW(t.Name(), "")
opts.BootFilesPath = `c:\does\not\exist\I\hope`
_, err := CreateLCOW(context.Background(), opts)
if err == n... |
b83a18c798c87df994cef02b95c391cf4251366d | b6923a026bc75fba14fdef830ed8615912a72204 | minishift/minishift | /pkg/minikube/cluster/cluster_darwin.go | Go | go | 1,971 | permissive | /*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... |
d8b95ce66a78c79f3c0aab9a46c564998d1bc1f1 | 1d4465325a6bd1bc862075a975a3b540716b422b | trondhindenes/components-contrib | /state/postgresql/postgresql_integration_test.go | Go | go | 14,816 | permissive | // ------------------------------------------------------------
// Copyright (c) Microsoft Corporation and Dapr Contributors.
// Licensed under the MIT License.
// ------------------------------------------------------------
package postgresql
import (
"database/sql"
"encoding/json"
"fmt"
"os"
"testing"
"github... |
27de930d36b899bd7cb47854b82a29bfb6becae8 | 2fbaa20b5cf430657c285769e39142e4fdabe732 | kfchub-infra/emailcli | /main.go | Go | go | 3,380 | permissive | package main
import (
"fmt"
"os"
"crypto/tls"
"crypto/x509"
"github.com/jordan-wright/email"
"gopkg.in/alecthomas/kingpin.v2"
"io/ioutil"
"net"
"net/smtp"
)
var (
username = kingpin.Flag("username", "Username to authenticate to the SMTP server with").Envar("EMAIL_USERNAME").String()
password = kingpin.Fla... |
52471bf9542c5bc22136d3480095346ee5000423 | 7218bc947ef2f57fc2368b207f5f6e4242441d04 | donh/identity | /build/deploy.go | Go | go | 1,801 | permissive | package build
import (
"context"
"crypto/ecdsa"
"log"
"math/big"
KeyManager "github.com/donh/identity/contracts"
"github.com/donh/identity/pkg/util"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethclient"
)
// Deploy deploys Ke... |
3b3987a489642d67f75ae4138a2d8eaac5ac5842 | fbcaef57fff04c974ae186d8748ccee242e4b948 | jcmturner/ddns | /update/update.go | Go | go | 4,969 | permissive | package main
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"strings"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/route53"
"github.com/jcmturner/ddns/awsclient"
"gi... |
2fc5042bea3bba7dbb83a5299c6a00535f4fc5b4 | e836eb182bb8d1c3f576134ae312cefafc9541a9 | derianpt/go-code | /GoTour/exercise-loops-and-functions.go | Go | go | 501 | no_license | package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
t, z := 0., 1.
for {
//z will keep changing to be more accurate, and t will keep taking the old value of z
z, t = z - (z*z-x)/(2*z), z
//if difference between t and z becomes minutely small, correct square root has been... |
b9bc3d4fc62bba22f98321a7d1d17222994a9a66 | 7d44f73ae6724b5540db4a775afda4df06623fa5 | wowoniu/go-mysql-server | /sql/plan/show_tables.go | Go | go | 2,161 | permissive | package plan
import (
"sort"
"github.com/src-d/go-mysql-server/sql"
)
// ShowTables is a node that shows the database tables.
type ShowTables struct {
db sql.Database
Full bool
}
var showTablesSchema = sql.Schema{
{Name: "Table", Type: sql.Text},
}
var showTablesFullSchema = sql.Schema{
{Name: "Table", Typ... |
beb4667488c415c9ac3ab715a3a39db371bab3d4 | 44845ed0f782541482aaa9088b0eaa2534f710de | ice-stuff/clique | /cmd/clique-agent/transfer.go | Go | go | 860 | no_license | package main
import (
"github.com/Sirupsen/logrus"
"github.com/ice-stuff/clique/config"
"github.com/ice-stuff/clique/dispatcher"
"github.com/ice-stuff/clique/transfer"
"github.com/ice-stuff/clique/transfer/simple"
)
type transferrer struct {
interruptible dispatcher.Interruptible
transferReceiver transfer.T... |
dc14d7d49b422377058843b9cce011ef7e065693 | ec55b9ebe469c17282b71eb165bad8a6c55ed803 | agrn/gitea | /routers/api/v1/org/org.go | Go | go | 1,935 | permissive | // Copyright 2015 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package org
import (
api "code.gitea.io/sdk/gitea"
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/routers/api/v... |
b7a81ca65f57a844f1313d06cd51b3418314b0f6 | 837e0a928ab69c5e78049122d1f2b8b821f34ee2 | samkreter/GoDataScience | /csv/csv.go | Go | go | 4,228 | permissive | package csv
import (
"encoding/csv"
"fmt"
"io"
"log"
"os"
"strconv"
"github.com/kniren/gota/dataframe"
)
type CSVRecord struct {
SepalLength float64
SepalWidth float64
PetalLength float64
PetalWidth float64
Species string
ParseError error
}
var csvData []CSVRecord
func filterDataFrame() {
df, ... |
6059bfdb05f80ff8efb7498cc792fdcfb3556cc2 | 57f244f46e81932d3a443518563cc29ce1d7b44d | herb-go/connections | /command/command.go | Go | go | 1,507 | permissive | package command
import (
"bytes"
)
// Command connection inbound command interface
type Command interface {
// Encode encode command to byte slice.
//Return encoded byte slice and any error raised.
Encode() ([]byte, error)
//Decode decode command by given byte slice.
Decode([]byte) error
// Type return command... |
ec6a40d06d2cddf42269ed1f6f6ffa9016bf4b34 | 2f5b07aac267a7643defb2fe31e0daac14cf0868 | xiemylogos/ontology_simulator | /p2pserver/peer/conn.go | Go | go | 1,599 | no_license | package peer
import (
"fmt"
"github.com/ontio/ontology/common/log"
)
// Conn represents a connection between two nodes in the network
type Conn struct {
One string `json:"one"`
Other string `json:"other"`
network *Network
Up bool `json:"up"`
one *Node
other *Node
}
func NewConn(network *Network, ... |
a809565effad50ac52207fa29fa97eabdd675054 | c85f976c0d20cad99722976c4393e9d0d261df41 | nagarajmanjunath/burrow | /consensus/tendermint/events.go | Go | go | 3,131 | permissive | package tendermint
import (
"context"
"github.com/hyperledger/burrow/event"
"github.com/hyperledger/burrow/event/query"
"github.com/hyperledger/burrow/logging/structure"
"github.com/tendermint/tendermint/libs/pubsub"
tm_types "github.com/tendermint/tendermint/types"
)
// Publishes all tendermint events availab... |
93748c93df79b46507f0d6c1dc96b1f01e621c33 | 4f735961231bb98fb5e63911290718cc87916944 | PiyushDatta/sample_code_all_lang | /sample.go | Go | go | 780 | no_license | package main
import "fmt"
// Employee : sample struct
type Employee struct {
/*
multi-line comment
*/
FirstName string
LastName string
TotalLeaves int
}
// LeavesRemaining : Employee method
func (e Employee) LeavesRemaining() {
fmt.Printf("%s %s has %d leaves remaining\n", e.FirstName, e.LastName, e.T... |
2fd914ac70d712839ae7c8fc8273eb186b710941 | 945d1bdcb5a3968d828762519506ecf961914b73 | dannyvankooten/respond | /respond_test.go | Go | go | 5,221 | permissive | /*
MIT License
Copyright (c) 2018 Danny van Kooten
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, modify, merge, publis... |
b38e97c8031ce6f20b8ba7ff5b51c79260acc631 | 9715041283302423c9a194b36d2778db3dc8da27 | jason0x43/alfred-nest | /main.go | Go | go | 1,638 | permissive | package main
import (
"log"
"path"
"time"
"github.com/jason0x43/go-alfred"
)
type Config struct {
NestId string
AccessToken string
AccessExpiry time.Time
Scale TempScale
}
type Cache struct {
Time time.Time
AllData AllData
}
const (
ClientId = "359f0dd0-8935-4390-9f10-863a5b7ec606"
... |
d32705e1f7a7a18facfbed43f36fc96d549447f5 | 1f555b519cb576cce885c81591c8e54e23c1a339 | juvenz/ydk-go | /ydk/models/cisco_ios_xr/vservice_cfg/vservice_cfg.go | Go | go | 50,730 | permissive | // This module contains a collection of YANG definitions
// for Cisco IOS-XR vservice package configuration.
//
// This module contains definitions
// for the following management objects:
// vservice: configure vservice node
//
// Copyright (c) 2013-2018 by Cisco Systems, Inc.
// All rights reserved.
package vserv... |
fbb3273221226c55929d06b7174ccb23fc2db9bc | c858ec345f48f202dacbb5817e14b6e40b15c8ea | latifrons/chorus-module | /lib/eth/core/types/transaction_test.go | Go | go | 7,595 | permissive | // Copyright 2014 The chorus Authors
// This file is part of the chorus library.
//
// The chorus library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at you... |
adbcbf037d8c58773a74a9fb67369d062e49a304 | 6d2f7e6db319b8795f1d0971db533a8fc9469833 | Octoberr/dingstockgo | /hello_grpc/server/server.go | Go | go | 713 | permissive | package main
import (
"context"
"fmt"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
service "hello_grpc/service"
"net"
)
type server struct{}
func (s *server) SayHello(ctx context.Context, in *service.HelloRequest) (*service.HelloReply, error) {
return &service.HelloReply{Message: "hello " + in... |
14a314c75b45e0e562fb04c382941d951f039454 | 69ce5f893dcf1cb10f643728734e0dfe6a9bbafc | akaspin/soil | /vendor/github.com/hashicorp/consul/command/catalog/list/nodes/catalog_list_nodes_test.go | Go | go | 3,702 | permissive | package nodes
import (
"strings"
"testing"
"github.com/hashicorp/consul/agent"
"github.com/mitchellh/cli"
)
func TestCatalogListNodesCommand_noTabs(t *testing.T) {
t.Parallel()
if strings.ContainsRune(New(nil).Help(), '\t') {
t.Fatal("help has tabs")
}
}
func TestCatalogListNodesCommand_Validation(t *testi... |
7f44d1c2c5ab9f4c88cd11fbdc96300e904d3cb3 | beb892cce114550123839e9c9e5292d58ab4ebab | tonidy/okteto | /pkg/cmd/build/build.go | Go | go | 11,866 | permissive | // Copyright 2022 The Okteto 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 ... |
b18175aae3ba0cf1aa26ec39cf9422446fc52899 | c3e0824e63151d23f4d6b045ed2be0dc1fe39cb0 | Baoqiang-Zhang/kubeedge | /keadm/app/cmd/common/config.go | Go | go | 6,252 | permissive | /*
Copyright 2019 The Kubeedge 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, so... |
a87696deb76ee1b3194f7c66f47f9f2ec341e3c6 | 15b2f758efddb38655ab51d31ac33c13ddca79c5 | cloudflare/go | /test/fixedbugs/issue54348.go | Go | go | 324 | permissive | // run
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
func main() {
F[T[int]]()
}
func F[X interface{ M() }]() {
var x X
x.M()
}
type T[X any] struct{ E }
type E struct{}
func (h E) M()... |
210d0fcd0869642333abd71b4cdbd44fc4ec3019 | 3e538701a92cac6287bd32c59e7b11988c45d674 | jendrikjoe/jaeger-operator | /test/e2e/utils.go | Go | go | 10,176 | permissive | package e2e
import (
goctx "context"
"fmt"
"net/http"
"os"
"os/exec"
"runtime"
"strconv"
"strings"
"testing"
"time"
osv1 "github.com/openshift/api/route/v1"
osv1sec "github.com/openshift/api/security/v1"
framework "github.com/operator-framework/operator-sdk/pkg/test"
"github.com/operator-framework/opera... |
dacca26bb3bdd8a50efeff22f158a584a84e7c95 | f270c4e568a144fa560e60fe04128c2da9a552c3 | mlauter/vitess | /go/vt/vtgate/gateway/discoverygateway.go | Go | go | 13,191 | permissive | /*
Copyright 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 to in writing, software
dis... |
c1a8038cd2f60ff3212b0657f63d5b055dbc6420 | 4b6739fbec1ab1606c1dcc43ca477b50de174a0f | robinson/gos7 | /datetime.go | Go | go | 1,439 | permissive | package gos7
// Copyright 2018 Trung Hieu Le. All rights reserved.
// This software may be modified and distributed under the terms
// of the BSD license. See the LICENSE file for details.
import (
"encoding/binary"
"fmt"
"time"
)
//implement GetPLCDateTime
func (mb *client) PGClockWrite() (datetime time.Time, err... |
e0124c37dd8bafd9bc6b0ee80585ddf1155f2d1a | c03b5d6e5f664d4ee74cf6afa180a3d8275f7361 | headend/iptv-warmup-service | /main.go | Go | go | 5,740 | no_license | package main
import (
"context"
"encoding/json"
"fmt"
messagequeue "github.com/headend/share-module/MQ"
"github.com/headend/share-module/configuration"
"github.com/headend/share-module/model/warmup"
"log"
agentpb "github.com/headend/iptv-agent-service/proto"
"time"
myRpc"github.com/headend/share-module/mygrp... |
8600720d763e23949694cea8e124b719252f2c84 | 39295d9d5a09a8abc12372435a8a36c427a76424 | evd0kim/lntxbot | /satellite.go | Go | go | 8,493 | permissive | package main
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"gopkg.in/jmcvetta/napping.v3"
)
type SatelliteOrderRequest struct {
AuthToken string `json:"auth_token"`
UUID string `json:"uuid"`
LightningInvoice struct {
PayReq string `json:"pa... |
91107b9f6bd682e7a7391251657b0c0bc3c0f781 | 2ce72f762fd4dfedf2f0d6e973d813f2e0af7ee2 | HyperspaceApp/Hyperspace | /modules/negotiate_test.go | Go | go | 3,311 | permissive | package modules
import (
"bytes"
"testing"
"github.com/HyperspaceApp/Hyperspace/crypto"
"github.com/HyperspaceApp/Hyperspace/types"
)
// TestAnnouncementHandling checks that CreateAnnouncement and
// DecodeAnnouncement work together correctly.
func TestAnnouncementHandling(t *testing.T) {
t.Parallel()
// Crea... |
e60ca1aa1446a6079faaea235a0a1895997c211c | 35672ef8021bcefe51a9c4e0a6a8782ec98c1baf | xblover/notes | /脚踏实地/golang/pkg/mod/gitee.com/rivenbob/tcpip@v0.1.1/netstack/tcpip/network/ipv6/icmp.go | Go | go | 8,514 | permissive | // Copyright 2018 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... |
fa9ce1c2edae40df01e873f919c1726e079cb3f1 | fc67b8697ac9cff15b2b79400b3e5e604f4a1001 | qiygan/bitxhub | /internal/executor/contracts/rule_manager.go | Go | go | 2,135 | permissive | package contracts
import (
"fmt"
appchainMgr "github.com/meshplus/bitxhub-core/appchain-mgr"
"github.com/meshplus/bitxhub-core/validator"
"github.com/meshplus/bitxhub-model/pb"
"github.com/meshplus/bitxhub/internal/constant"
"github.com/meshplus/bitxhub/pkg/vm/boltvm"
)
const (
rulePrefix = "rule-"
)
// Rule... |
43117903694d0409eacc8d1f14c4854ca81b044c | 2422293f4bb821863ae13594cbd76bfe407b1b2b | gitter-badger/on | /cmd/required.go | Go | go | 503 | permissive | package cmd
import (
"fmt"
"github.com/spf13/cobra"
"strings"
)
// NoArgs validates args and returns an error if there are any args
func NoArgs(cmd *cobra.Command, args []string) error {
if len(args) == 0 {
return nil
}
if cmd.HasSubCommands() {
return fmt.Errorf("\n" + strings.TrimRight(cmd.UsageString(),... |
4838e2ae643c5abca6d00e22847ba70bc1b0ac79 | c288a1e103549e1816c3f522b30c3e09e7c37011 | godcong/ipfs-update | /config/config.go | Go | go | 583 | permissive | package config
// CurrentAppName is the name of this application
const CurrentAppName = "ipfs-update"
// CurrentVersionNumber is the current application's version literal
const CurrentVersionNumber = "1.6.1-dev"
// CurrentCommit is the current git commit, if it is available.
// It might not be currently available, b... |
bd06af374bbea6c6b7c87fe9df578d8bfbce3249 | 7d8a885427eb7ff7e557b43faffb492dcf009fce | coinsecure/plugins | /master/go/fiat_dep_data.go | Go | go | 1,421 | permissive | /*
* Coinsecure Api Documentation
*
* To generate an API key, please visit <a href='https://coinsecure.in/api' target='_new' class='homeapi'>https://coinsecure.in/api</a>.<br>Guidelines for use can be accessed at <a href='https://api.coinsecure.in/v1/guidelines'>https://api.coinsecure.in/v1/guidelines</a>.<br>Progr... |
fef04de9207beaaa39cd3937cff4521619d3df02 | 3e312d943f952f14ca803efe34fd59e743929ae9 | cbsinteractive/bitmovin-api-sdk-go | /model/i_frame_playlist.go | Go | go | 782 | permissive | package model
import (
"time"
)
type IFramePlaylist struct {
// Name of the resource. Can be freely chosen by the user.
Name string `json:"name,omitempty"`
// Description of the resource. Can be freely chosen by the user.
Description string `json:"description,omitempty"`
// Creation timestamp formatted in UTC: Y... |
c2981b754e7b7eb8eab46b19e4463834b421780e | ca453f86cecfa0efd407015c82ae572d89976a82 | lveyde/hyperconverged-cluster-operator | /vendor/github.com/kubevirt/cluster-network-addons-operator/pkg/apis/addtoscheme_networkaddonsoperator_v1alpha1.go | Go | go | 330 | permissive | package apis
import (
cnaov1alpha1 "github.com/kubevirt/cluster-network-addons-operator/pkg/apis/networkaddonsoperator/v1alpha1"
)
func init() {
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
AddToSchemes = append(AddToSchemes, cnaov1alpha1.SchemeBuilder.AddTo... |
4afb4f11510c56686cf58a2d782bfab1e5772191 | 28fbbd8e5f19111ae53c4200b3d105dbd454ea05 | panmari/gort | /intersectables/mesh_triangle.go | Go | go | 1,957 | no_license | package intersectables
import (
"fmt"
"github.com/panmari/gort/util"
"github.com/ungerik/go3d/vec2"
"github.com/ungerik/go3d/vec3"
)
// MeshTriangle represents a single triangle from a mesh.
type MeshTriangle struct {
vertices [3]*vec3.T
normals [3]*vec3.T
texCoords [2]*vec2.T
e1, e2 vec3.T
material ... |
bb00dcd1ac4c5eb0a5a1b928b611c8b18f750238 | cc510a9b3dd6c917971962dd06beed4547c3972f | zhujq/free5gc-stage-3 | /lib/pfcp/pfcpType/MonitoringTime.go | Go | go | 281 | permissive | //go:binary-only-package
package pfcpType
import (
"encoding/binary"
"fmt"
"time"
)
type MonitoringTime struct {
MonitoringTime time.Time
}
func (m *MonitoringTime) MarshalBinary() (data []byte, err error) {}
func (m *MonitoringTime) UnmarshalBinary(data []byte) error {}
|
4f9f713ae711f18d8e68d5e5c5ddb940a0229a87 | cd5d64df1967fec877b2fb9888b5efeef9c1d124 | vineela1999/multi-cloud | /vendor/github.com/micro/go-micro/v2/server/rpc_router.go | Go | go | 15,411 | permissive | package server
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// Meh, we need to get rid of this shit
import (
"context"
"errors"
"fmt"
"io"
"reflect"
"runtime/debug"
"strings"
"sync"
"unicode"
... |
ffbd74dfed7971f991365e5c43b424348a9c95b0 | 8ed3622f9c0c1f92b3581e5ce1fbb019173efa73 | Neoniklain/gosha | /examples/newapp/dbmodels/page_info.go | Go | go | 417 | no_license | package dbmodels
import (
"time"
)
type PageInfo struct {
ID int `gorm:"primary_key"`
SeoMeta *int
//PageInfo remove this line for disable generator functionality
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time `sql:"index" json:"-"`
validator
}
func (pageInf... |
9f7074d5082a360d31b51895bbf656c38a8df51e | 7905aae9a42b43fc4e6cfe4686153483b1a2a817 | chrisfowles/flux | /http/websocket/client.go | Go | go | 1,507 | permissive | package websocket
import (
"fmt"
"net"
"net/http"
"net/url"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/fluxcd/flux/http/client"
)
type DialErr struct {
URL *url.URL
HTTPResponse *http.Response
}
func (de DialErr) Error() string {
if de.URL != nil && de.HTTPResponse != nil... |
de82e276d5b891a3727441d5b3b69b1b8449cbe4 | b2017d56517a1a7cf1786ae3de6098b78c6c0ae6 | mainflux/coap-cli | /vendor/github.com/pion/dtls/v2/cipher_suite.go | Go | go | 6,230 | permissive | package dtls
import (
"encoding/binary"
"fmt"
"hash"
)
// CipherSuiteID is an ID for our supported CipherSuites
type CipherSuiteID uint16
// Supported Cipher Suites
const (
// AES-128-CCM
TLS_ECDHE_ECDSA_WITH_AES_128_CCM CipherSuiteID = 0xc0ac
TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 CipherSuiteID = 0xc0ae
// AE... |
18ab3290beec0f37d11c19410154e31b37629207 | 5a7a61b01ffd112fe837023ccd0fe603be2831db | minishift/minishift | /vendor/github.com/docker/docker/client/service_update.go | Go | go | 2,668 | permissive | package client // import "github.com/docker/docker/client"
import (
"context"
"encoding/json"
"net/url"
"strconv"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/swarm"
)
// ServiceUpdate updates a Service.
func (cli *Client) ServiceUpdate(ctx context.Context, serviceID string, version... |
cd3508c3cbaa0f4160c93a19d03d8747fca3d616 | ec328730c00153245f54da790899f1b9030ca4b5 | damiannolan/tendermint | /consensus/replay_test.go | Go | go | 39,721 | permissive | package consensus
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"runtime"
"sort"
"testing"
"time"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
dbm "github.com/tendermint/tm-db"
"github.com/tendermint/... |
adc0bba5d58d2ebfb8732c2e6927b0860942c124 | 9c636151b13e940d215ebb42bcde231b0691c1c1 | ipv1337/kansible | /vendor/k8s.io/kubernetes/pkg/kubectl/resource/helper_test.go | Go | go | 13,244 | permissive | /*
Copyright 2014 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... |
1fdfc0080ff07759a0e866989bb562e94d8eb690 | b4e51826f3b062c20d0fc114441aa1bc3f48f42d | lholmquist/odo | /tests/integration/cmd_link_unlink_test.go | Go | go | 9,025 | permissive | package integration
import (
"fmt"
"path/filepath"
"strings"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/openshift/odo/tests/helper"
)
var _ = Describe("odo link and unlink command tests", func() {
var commonVar helper.CommonVar
var _ = BeforeEach(func() {
commonVar = helper.Common... |
f537e3bd46f7e72b5f0df9ac19ae972a07c8e50f | f928927ba2113bc2c0f6f7a109e2f6fa18d1a59c | xjq-SUSE/autok3s | /pkg/common/common.go | Go | go | 1,632 | permissive | package common
import (
"path/filepath"
"time"
"github.com/cnrancher/autok3s/pkg/utils"
"k8s.io/apimachinery/pkg/util/wait"
)
const (
StateFile = ".state"
KubeCfgFile = ".kube/config"
KubeCfgTempName = "autok3s-temp-*"
K3sManifestsDir = "/var/lib/rancher/k3s/server/manifests"
MasterIn... |
191de1d2c24d4ab7527e076aa2019238e0663488 | 9a700ed0586a88dbb57583f580faa001ef206c07 | sqlitebrowser/db4s_cluster_downloader | /main.go | Go | go | 41,505 | no_license | package main
import (
"bytes"
"crypto/tls"
"fmt"
"html/template"
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/BurntSushi/toml"
"github.com/jackc/pgx"
"github.com/jackc/pgx/pgtype"
"github.com/mitchellh/go-homedir"
)
const (
DB4S_3_10_1_WI... |
60876b715520d0a3c7e833cc46a85ed85ef48b09 | 409627168e825ca6abea31a4f2c8bfeecc4b32cf | sanglx-teko/opa-server | /models/dao/doc.go | Go | go | 284 | no_license | package dao
import "github.com/sanglx-teko/opa-server/middleware/configurationmanager/model"
// ConfigurationManager ...
var ConfigurationManager model.IConfigurationManager
// InitCFManager ...
func InitCFManager(conf model.IConfigurationManager) {
ConfigurationManager = conf
} |
ff9f85b3768b6ef49d8e43a8b3e0723c2a68c15a | 4c212cab68e1570acfffa6d16873f3f10438ffdf | fdoperezi/influxdb | /tsdb/engine/wal/wal.go | Go | go | 49,779 | permissive | /*
Package WAL implements a write ahead log optimized for write throughput
that can be put in front of the database index.
The WAL is broken into different partitions. The default number of
partitions is 5. Each partition consists of a number of segment files.
By default these files will get up to 2MB in size before a... |
ca9552d7d89c2ae2ea0f48d6d2e8ee66fa1d20d2 | ae21e5b4b8e11a6d7f63907d6dbfb34befb8d7fc | nipeharefa/silver-parakeet | /api_gateway/controller/movie_controller.go | Go | go | 894 | no_license | package controller
import (
"context"
"net/http"
"strconv"
"github.com/labstack/echo/v4"
proto "github.com/nipeharefa/silver-parakeet/model"
)
// controller will connecto to grpc client
type (
MovieController interface {
Search(c echo.Context) error
}
movieController struct {
movieClient proto.MovieSer... |
619dddb1a8fae583ad159fc3e5e4097486db0e75 | 05857af02e66b66163d1e67c57bbd22b522d2028 | Rain168/godfs | /src/validate/config_check.go | Go | go | 12,387 | permissive | package validate
import (
"app"
"bytes"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"util/common"
"util/file"
"util/logger"
)
var (
az = []rune{'A', 'B', 'C', 'D', 'E', 'F'}
i09 = []rune{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
GroupInstancePattern = "^[0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.