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 |
|---|---|---|---|---|---|---|---|---|
5539aefd31aada9fa577de7754cc8a1d380e4dd5 | 00d302ae8943b6502a66608fb46b69af342a5625 | ajunlonglive/gse-wasm | /src/hmm/hmm_seg.go | Go | go | 2,405 | permissive | // Package hmm is the Golang HMM cut module
package hmm
import (
"regexp"
)
var (
regHan = regexp.MustCompile(`\p{Han}+`)
regSkip = regexp.MustCompile(`(\d+\.\d+|[a-zA-Z0-9]+)`)
)
// func LoadFile(filePath string) map[rune]float64 {
//
// }
// LoadModel load HMM model
func LoadModel(prob ...map[rune]float64) {
... |
f8c972b908e27e9f1778ee06a66d38a07a1c0260 | 77194f07abb06655301c273966dd0c049053d546 | butonic/reva | /cmd/reva/share-create.go | Go | go | 5,333 | permissive | // Copyright 2018-2021 CERN
//
// 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 wr... |
e49ac828f49332f0b240936cdf9668f0c2173d27 | 1333c7a1550949c1d07716ed86b9512cd0bdf8f1 | stjordanis/onos-api | /go/onos/e2t/e2/e2.go | Go | go | 1,048 | permissive | // Copyright 2020-present Open Networking Foundation.
//
// 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 applica... |
a97e1b546920ce4a334ac4eda203945f2a099135 | 8fdbf4420e6e49fc685c9816fa447b2113c1f93a | abhi0398/BankApi | /services/bank-services.go | Go | go | 2,996 | no_license | package services
import (
"fmt"
"log"
"os"
"github.com/go-pg/pg"
"github.com/my/main/entity"
)
type Service interface {
InsertTable(tab interface{}) error
SelectID(tab interface{}, idt int) (interface{}, error)
SelectAll(tab interface{}) (interface{}, error)
DeleteRow(tab interface{}, id int) (int, error)
... |
23405cb062cf3f11ba6af44911a3e1122ced3a70 | 62a2933caa5df84ffb252d2b316468788c2fb441 | Petergatsby/GleepostAPI | /lib/stats.go | Go | go | 20,949 | no_license | package lib
import (
"database/sql"
"errors"
"fmt"
"log"
"time"
"github.com/Petergatsby/GleepostAPI/lib/gp"
)
//View represents a series of statistics about something over time.
type View struct {
Start time.Time `json:"start"`
Finish time.Time `json:"finish"`
BucketLength time.... |
0a1c26b2bcee6827b05571246bf4d87466f60c58 | b3caac009e3740710b543acd6b07b85f3e6eaca9 | dragonhht/simple-JVM | /src/main/instructuins/references/invokeinterface.go | Go | go | 1,224 | no_license | package references
import (
"main/instructuins/base"
"main/rtda"
"main/rtda/heap"
)
type INVOKE_INTERFACE struct {
index uint
}
func (self *INVOKE_INTERFACE) FetchOperands(reader *base.BytecodeReader) {
self.index = uint(reader.ReadUint16())
reader.ReadUint8()
reader.ReadUint8()
}
func (self *INVOKE_INTERFAC... |
f12b61469b6382aa611d4d40d5e3d8b644ad1ceb | f595699a0ea55df5071c85984339e2c3076881c5 | IAC-InfrastructureAsCode/aliyun-cli | /openapi/errors_test.go | Go | go | 2,650 | permissive | // Copyright (c) 2009-present, Alibaba Cloud 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 require... |
a7c1075eab379161b6d1f3d57bce011f0595c194 | 3d411bce222a318ef7d52d18379e5be4e6a5c5a3 | YunShiTiger/cloudpods | /pkg/mcclient/modules/notify/mod_notify.go | Go | go | 2,630 | permissive | // Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
5e1e4cd901f594d38823bd26a920a3de3ed3e398 | 85f07345d45fd97a9dbb12804197a80f98a1b3ca | openshift/ci-tools | /cmd/cluster-init/update_bootstrap_secrets.go | Go | go | 13,871 | permissive | package main
import (
"fmt"
"path/filepath"
"github.com/sirupsen/logrus"
"k8s.io/apimachinery/pkg/util/sets"
"github.com/openshift/ci-tools/pkg/api"
"github.com/openshift/ci-tools/pkg/api/secretbootstrap"
)
const (
credentials = "credentials"
dotDockerConfigJson = ".dockerconfigjson"
testCredentia... |
385030dbd04cc10d3f722fba12809ecb5f70447f | 38f28f6b8ed0261ddae0ee785b4ff265ca827fe4 | Fluepke/ethtool | /eeprom/sff8636/extendedIdentifier.go | Go | go | 1,232 | no_license | package sff8636
import (
"gitlab.com/wobcom/ethtool/eeprom"
)
// ExtendedIdentifier provides additional information about the free side device.device contains a CDR function and identifies the power cons
type ExtendedIdentifier struct {
PowerClass eeprom.PowerClass
PowerClass8Implemented bool
CLEICode... |
4f5cb822f571d261deb78dc08711de07eb83dbf9 | 739043154a2a2720f6abb1412139ddeb3f847005 | OrangeTux/gobot-roll-out | /ps3-controller/main.go | Go | go | 494 | permissive | package main
import (
"fmt" // OMIT
// OMIT
"gobot.io/x/gobot"
"gobot.io/x/gobot/platforms/joystick"
)
func main() {
adaptor := joystick.NewAdaptor()
controller := joystick.NewDriver(adaptor, "dualshock3")
work := func() { // HL
controller.On(joystick.RightY, func(data interface{}) { // HL
fmt.Printf("Y:... |
b15de2f6894286d8b25dbe851acef2be8823f145 | a168156602be0552b23e810447b98e55553129c7 | Aduru1/k9s | /internal/dao/port_forwarder.go | Go | go | 5,217 | permissive | package dao
import (
"fmt"
"net/http"
"net/url"
"time"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/port"
"github.com/rs/zerolog/log"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1"
"k8s.io/apimachi... |
650e8b4be352ec3cd247cb70bc9b4d129af5b16f | 55bcead08bed5ebe2addf1d489c89c8b8728dd48 | Dienzwelles/exchange_extractor | /src/adapters/WorkPool.go | Go | go | 7,520 | no_license | package adapters
import (
_"bufio"
"fmt"
_"os"
"runtime"
"time"
"github.com/goinggo/workpool"
"../queuemanager"
//"../datastorage"
"../models"
"../arbitrage"
_"bufio"
_"os"
"../datastorage"
"strconv"
//"../measure"
)
var shutdown bool
var startArbitrage chan string
var waitArbitrage chan string
type A... |
bbc866ac10013908e4cf71567787fb45b2da67ea | 7dfca0e7049130aca6af1e7511a1b34f4ebd0148 | r2d4/kube-client | /client-go/listers/core/v1/persistentvolume.go | Go | go | 2,437 | permissive | /*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
e00bbf03e27d80d2917ead729df9f68b5c74b791 | f9c1d22d7f27f07fe5c1b129e8f171de9d04858f | fossabot/m3db | /src/dbnode/storage/bootstrap/bootstrapper/base.go | Go | go | 6,139 | permissive | // Copyright (c) 2016 Uber Technologies, Inc.
//
// 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... |
61f074ece498fa8533446c1365026f7a2d4c1c64 | f213600f5f3ed0f8d1c61f4e65ccddb797313578 | eryozkn/learning-go | /archive/volkan.io/examples/functions/001_functions.go | Go | go | 351 | permissive | package main
import "fmt"
func add(x, y int) int {
return x + y
}
func swap(x, y string) (string, string) {
return y, x
}
func split(sum int) (x, y int) {
x = sum * 4 / 9
y = sum - x
// naked return is required.
return
}
func main() {
a, b := swap("hello", "world")
fmt.Println(a, b)
fmt.Println(add(44, ... |
170ba3c066915e5d527d501d3f4a8cc6343c884f | 4488cbdd36dba390f857fa0885e6e7567cfb38c8 | chungminglu/python | /tmp/go/cam.go | Go | go | 227 | no_license | package main
import (
"gocv.io/x/gocv"
)
func main() {
webcam, _ := gocv.VideoCaptureDevice(0)
window := gocv.NewWindow("Hello")
img := gocv.NewMat()
for {
webcam.Read(img)
window.IMShow(img)
gocv.WaitKey(1)
}
} |
a45f8dc277f56401bbb47aedf62de25364ce6a08 | 78cd27b3d1ffe161100463f58d8ea213d18483f8 | huitikho/goNooNet | /goNooRest/restTranVerifier.go | Go | go | 4,280 | no_license | package restServer
import (
"encoding/hex"
"encoding/json"
"goNooNet/helpers"
"math"
secp "secp256k1-go"
"strconv"
"time"
"github.com/valyala/fasthttp"
)
func verifyTransaction(ctx *fasthttp.RequestCtx) (statusCode int,
transactionForDB []byte,
transactionTime int64) {
//
args := ctx.QueryArgs()
for er... |
49fc4b180c703ae698631a2fe6e02382219d50e9 | 80d1c6fdee3cd6933428cd216f5f669e96889ddf | justrohan/cloudprober | /probes/http/http.go | Go | go | 9,979 | permissive | // Copyright 2017-2019 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 ... |
30101e82167acea70306894c534e8b4e1b5d6a79 | db9372d37d263a77eb1421164d08f7b02f9453c9 | Sunilnk17/DNS | /app/config/locales/local_config/i18n.go | Go | go | 1,016 | no_license | package local_config
import (
"encoding/json"
"github.com/nicksnyder/go-i18n/v2/i18n"
"golang.org/x/text/language"
"log"
)
var permittedLanguages = [...]string{"en"}
var localizers = make(map[string]*i18n.Localizer)
func localeFile(language string) string {
switch language {
case "en":
return "en.json"
def... |
18eecc77c12c00cf266712332fc96df75a769306 | 7d1c213843da4c3274a56c6904a15c2c092db5de | ryutah/kubernetes-transcribe | /pkg/apiserver/apiserver.go | Go | go | 5,614 | no_license | package apiserver
import (
"encoding/json"
"io/ioutil"
"net/http"
"strings"
"time"
"github.com/golang/glog"
"github.com/ryutah/kubernetes-transcribe/pkg/healthz"
"github.com/ryutah/kubernetes-transcribe/pkg/runtime"
"github.com/ryutah/kubernetes-transcribe/pkg/version"
)
// mux is an object that can registe... |
6b95286f5b73195d19aa936d0c843e989d363c81 | 76e6348863316966a944d70d867f961f7bcd8c3f | dosecin/leetcode | /565.数组嵌套.go | Go | go | 373 | no_license | /*
* @lc app=leetcode.cn id=565 lang=golang
*
* [565] 数组嵌套
*/
// @lc code=start
func arrayNesting(nums []int) int {
ans := 0
for i := range nums {
if nums[i] < 0 {
continue
}
cnt, idx := 0, i
for {
idx, nums[idx] = nums[idx], -1
if idx < 0 {
break
}
cnt++
if cnt > ans {
ans = cn... |
0e735618ce1d82d17bc196bf223cfbd1d91c69e4 | 08c27719cc6014c5d4ecd09ad187279a3f2ccb38 | jwaldrip/tug | /tugfile/pipe_test.go | Go | go | 1,460 | permissive | package tugfile
import (
"bytes"
"io"
"sync"
"testing"
. "github.com/nitrous-io/tug/Godeps/_workspace/src/github.com/onsi/ginkgo"
. "github.com/nitrous-io/tug/Godeps/_workspace/src/github.com/onsi/gomega"
)
func Test(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "pipe")
}
type stream struct {
readB... |
3cff7581cf646b791b2ddbba35097bea24525ec6 | 82683b6b385e07ca0cf5266deeee1a2daf0e6d20 | sshyran/automate | /components/automate-deployment/pkg/backup/artifact_streams_test.go | Go | go | 13,302 | permissive | package backup
import (
"bytes"
"io"
"io/ioutil"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
type readCloserTester struct {
reader io.ReadCloser
called int
}
func (r *readCloserTester) Read(p []byte) (n int, err error) {
return r.reader.Read(p)
}
func (r *readClo... |
8cafee0905169ae4406bcea58a8928098927a9e8 | 4aec5273d737b74bf42b124966b5b67f8800c975 | Googlenose1/discovery | /pkg/api/domain/auth_domain/auth_error.go | Go | go | 479 | permissive | // Copyright Contributors to the Open Cluster Management project
package auth_domain
type AuthError struct {
Code int `json:"code"`
ErrorMessage string `json:"error"`
Description string `json:"error_description"`
Error error `json:"-"`
Response []byte `json:"-"`
// reason string
/... |
abf1665acff880e9bd6bbc45a1ee47ce00c02df3 | c39a90907c1f3aedbe23e5f67487df4f7f1c4f54 | mindscratch/mqtrack | /server.go | Go | go | 8,989 | no_license | package mqtrack
import (
"bufio"
"bytes"
"crypto/rand"
"fmt"
"log"
"net"
"strings"
"sync"
"time"
)
const (
// UDP packet limit, see
// https://en.wikipedia.org/wiki/User_Datagram_Protocol#Packet_structure
UDP_MAX_PACKET_SIZE int = 64 * 1024
defaultFieldName = "value"
defaultProtocol = "udp"
defaultS... |
9790e1a57f3538e863d36045dc9b0fab47c35aa2 | c4e9b6691fbed1afc786c91c4c2a0f23b3fe743c | mateusbueno/fc2-arquitetura-hexagonal | /adapters/web/server/server.go | Go | go | 844 | no_license | package server
import (
"github.com/mateusbueno/go-hexagonal/adapters/web/handler"
"github.com/mateusbueno/go-hexagonal/application"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
"log"
"net/http"
"os"
"time"
)
type Webserver struct {
Service application.ProductServiceInterface
}
func MakeNewWebs... |
3d6903472dd91d5e77796ffcbfe6948d072b71f8 | ac0e5c977f80b6a2f4761e29c90c551b1d75c695 | stpabhi/volcano | /pkg/scheduler/framework/session.go | Go | go | 12,385 | permissive | /*
Copyright 2018 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, ... |
92e48f7067a938c7b2bfe64453fa17f65e5dda28 | 4ce2aec11146b415cc3d6ffe51b526ede6cfb293 | DataDog/pupernetes | /vendor/k8s.io/api/core/v1/types_swagger_doc_generated.go | Go | go | 167,129 | permissive | /*
Copyright 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, softw... |
f162770722acf928555d4ec2867ada2b99d630f3 | 41e9bf4efe98190ca073f9e2e97542f3c9d9f778 | Scott-Cai/web-server | /cli/cmd/removeparticipator.go | Go | go | 2,275 | permissive | // 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
// distributed ... |
9fddfa65b39cf5df3ca3d28b8533c52d91b1f4aa | 544645f1bb81c9ad5c36a26c9322d28d825c4ed6 | dvska/vitess | /go/vt/vtgate/scatter_conn_test.go | Go | go | 8,367 | permissive | // Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package vtgate
import (
"fmt"
"reflect"
"testing"
"time"
mproto "github.com/youtube/vitess/go/mysql/proto"
tproto "github.com/youtube/vitess/go/vt/tabletse... |
af447a6809cbc4a2875ca5e09b620cbdd3d06536 | 8d47f594706700d09c5ed9491bf6d9efbed8417a | jreece1567/go_swagger_client | /client_secure/w_i_s_h_l_i_s_t_s/delete_favorites_person_id_parameters.go | Go | go | 1,907 | permissive | package w_i_s_h_l_i_s_t_s
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/s... |
de011c6d408ace22710f502d4ab92413bfee7ed7 | 55d2202ec007c19b1e41be319da3841f7e52a512 | Programmerino/DebateFrame_IA | /client/document/postprocess.go | Go | go | 2,059 | no_license | package document
import (
"math"
"regexp"
"strconv"
"strings"
"fmt"
"github.com/PuerkitoBio/goquery"
"golang.org/x/net/html"
"gitlab.com/256/DebateFrame/client/log"
)
func postProcess(htmlStr string) string {
doc, err := goquery.NewDocumentFromReader(strings.NewReader(htmlStr))
if err != nil {
panic("f... |
f67bf2221caeb05e1093755b9d81aefdc8a042ed | 6fa41b05613dea7e6dfb95f2188250e3f175989d | ronenhamias/pipeline | /internal/providers/objectstore.go | Go | go | 3,487 | permissive | // Copyright © 2018 Banzai Cloud
//
// 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 ... |
678621a981b169e2334890a98261f50bfd8ff544 | fe74860d062a97e00bab426ac69caabaf07b8fba | reddec/fluent-amqp | /example/cmd/fluent-sample/main.go | Go | go | 1,210 | permissive | package main
import (
"context"
"fmt"
"github.com/reddec/fluent-amqp"
"github.com/streadway/amqp"
"log"
"os"
"time"
)
func main() {
ctx := fluent.SignalContext(nil)
broker := fluent.Broker("amqp://guest:guest@127.0.0.1").Logger(log.New(os.Stderr, "[broker] ", log.LstdFlags)).Context(ctx).Start()
publisher ... |
d3119f903609b50405fe3228688f73a22e439980 | 5f16b7a9f3b9cdde24068462e9892897b2fb8b20 | whitewater-guide/gorge | /server/logger.go | Go | go | 750 | permissive | package main
import (
"io"
"github.com/sirupsen/logrus"
"github.com/whitewater-guide/gorge/config"
)
func newLogger(cfg *config.Config) *logrus.Logger {
result := logrus.New()
if cfg.Log.Format == "json" {
result.SetFormatter(&logrus.JSONFormatter{})
} else {
result.SetFormatter(&logrus.TextFormatter{Force... |
4d45a8e145efdc9a8f6982fddf9363dc4dba540b | 8bebb839e32d0059065ec025fe271a0892b9aa8e | remast/java-to-go | /jaxenter/09_channel_select_timeout/hellogopher.go | Go | go | 306 | no_license | package main
import (
"fmt"
"time"
)
func Hello(names chan string) {
select {
case name := <-names:
fmt.Println("Hello " + name + "!")
case <-time.After(time.Second):
fmt.Println("No one here ...!")
}
}
func main() {
names := make(chan string)
go Hello(names)
time.Sleep(3 * time.Second)
}
|
7e160ad92893f6c56d4387cabb0add14a362fc3c | c1b4b7718f52730d3a7f7583e14c59479853d929 | Harrison-Miller/go-mysql-server | /sql/plan/show_indexes_test.go | Go | go | 3,837 | permissive | package plan_test
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/liquidata-inc/go-mysql-server/memory"
"github.com/liquidata-inc/go-mysql-server/sql"
"github.com/liquidata-inc/go-mysql-server/sql/expression"
"github.com/liquidata-inc/go-mysql-server/s... |
a822d4427698c766b93ff3f24b4588daeaa29b1f | 9d0266399c8008c86ba926a09db4a0569b7596f8 | GrandStar/csuf | /sp15/03_gowiki/03_02_net-http_package_simple_web_server.go | Go | go | 1,034 | no_license | package main
import (
"fmt"
"net/http"
)
/*
NOTE:
at terminal "ctrl + c" exits web server
*/
// The function handler is of the type http.HandlerFunc
// It takes an http.ResponseWriter and http.Request as its arguments
func handler(w http.ResponseWriter, r *http.Request) {
// An http.ResponseWriter value assembles... |
f265f23e472d13b81f8fec55bdfcca21983c0656 | c4f8d5242dc213613062b6d8e68a2981d64cf4d6 | nathansenn/powergate | /cmd/pow/cmd/net_addr.go | Go | go | 685 | permissive | package cmd
import (
"context"
"encoding/json"
"github.com/caarlos0/spin"
"github.com/spf13/cobra"
)
func init() {
netCmd.AddCommand(netListenAddrCmd)
}
var netListenAddrCmd = &cobra.Command{
Use: "addr",
Short: "Get the listen address of the node",
Long: `Get the listen address of the node`,
Run: func(... |
fa686a85b90369702ccd257f6cce794693d72117 | de14f4ee1df18d911f770b75ead0e90e96c58e0a | brymck/mono-proto | /pkg/config.go | Go | go | 356 | permissive | package pkg
type Config struct {
Prototool string `yaml:"prototool,omitempty"`
Repos []RepoConfig `yaml:"repos,omitempty"`
Language string `yaml:"language,omitempty"`
}
type RepoConfig struct {
GitHub Repo `yaml:"github,omitempty"`
}
type Repo struct {
Owner string `yaml:"owner,omitempty"`
Nam... |
e60d6668c1c2d9976b39a0f0a3e3476c9cacd6ba | b81e12c2a6795f459880c0c12684543be66308cf | czw0911/sns-reset-api | /src/XYAccoutServer/models/user_remind_set.go | Go | go | 1,439 | no_license | //@Description 用户提醒设置
//@Contact czw@outlook.com
package models
import (
"github.com/astaxie/beego/orm"
"stathat.com/c/consistent"
"fmt"
)
var (
userRemindSetTableNameHash = consistent.New()
)
type UserRemindSet struct {
tableName string //hash到的表名
dbConn orm.Ormer //hash到的数据库
UID uint32 //用户i... |
4451a7de255cfec0bd2b328b822eb522aa94f674 | b3249661ca59d1cbdf710a2d49b1abf71e94411c | paulsjohnson91/challenge-accepted | /controllers/favourites.go | Go | go | 4,823 | no_license | package controllers
import (
"encoding/json"
"fmt"
"net/http"
"github.com/pressly/chi"
mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
db "github.com/paulsjohnson91/challenge-accepted/dbs"
basemodel "github.com/paulsjohnson91/challenge-accepted/models"
model "github.com/paulsjohnson91/challenge-accepted/models/... |
2e5b2d65de1917df90172e7cfe7bcf2b8da8e367 | 2a551c933bed07fdd168a15899bc92c2819a011e | smbzhang/go-cache-server | /src/server02/cache/inmemory.go | Go | go | 847 | no_license | // Package cache provides ...
package cache
import (
"sync"
)
type inMemoryCache struct {
c map[string][]byte
mutex sync.RWMutex
Stat
}
func (c *inMemoryCache) Set(k string, v []byte) error {
c.mutex.Lock()
defer c.mutex.Unlock()
_, exist := c.c[k]
// 更新 Stat 状态
if exist {
c.del(k, v)
}
c.c[k] = v
c... |
747511be0502901b3919a6d95e0f5b76684ccc56 | 43b6d0b997f71c5572e23a5bf0df8fe8a68ead17 | remind101/emp | /Godeps/_workspace/src/github.com/docker/docker/pkg/mflag/example/example.go | Go | go | 1,208 | permissive | package main
import (
"fmt"
flag "github.com/remind101/emp/Godeps/_workspace/src/github.com/docker/docker/pkg/mflag"
)
var (
i int
str string
b, b2, h bool
)
func init() {
flag.Bool([]string{"#hp", "#-halp"}, false, "display the halp")
flag.BoolVar(&b, []string{"b", "#bal", "#bol", "-bal"}, false... |
352e267d66d75dc78646763bc58d00f72761b5df | 0de69b08141f207aee983b6aa6baaf894172de80 | diamanticom/cluster-api | /test/infrastructure/docker/cloudinit/runcmd_test.go | Go | go | 2,897 | 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, ... |
cb36300dc1187f178174a8763a74ac82f0ba5955 | 9baf1c1b13eb6e20497ac8d7f7fdbd628e53ff83 | asmyasnikov/srtm | /tile_test.go | Go | go | 683 | permissive | package srtm
import (
"github.com/stretchr/testify/require"
"math"
"testing"
)
func TestGetElevation(t *testing.T) {
data, err := New(1, "testdata", -1)
require.NoError(t, err)
defer data.Destroy()
tile, err := data.loadTile(
LatLng{
Latitude: -45.55457,
Longitude: -65.23555,
})
require.NoError(t, ... |
c42258a283894df534c419badb6469ca9892f34b | b507eff7a2436b0a99dcfb7fa83d0654ec674e98 | ghost974/kubernetes | /test/e2e/networking.go | Go | go | 7,134 | 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... |
9640bf13b07162546907ca16074f2a654427ab16 | 8b9d726b1313dec568e75aaf9986ec5bcd70c18f | johzhao/workflow | /database/sqlx/trigger_dao.go | Go | go | 1,098 | no_license | package sqlx
import (
"github.com/jmoiron/sqlx"
"workflow/models/PO"
)
func newTriggerDAO(ext sqlx.Ext) triggerDAO {
return triggerDAO{
ext: ext,
}
}
type triggerDAO struct {
ext sqlx.Ext
}
const (
triggerTableName = "triggers"
triggerColumns = "id, target, code, enabled, hook_type, hook_id"
)
func (t t... |
9630ee5cee11a092dd2cfb6338841378af4d908d | fd9e92c87269e6f737a68bfd87e3819b65048405 | shanecandoit/exercism-go-scrabble-score | /scrabble_score.go | Go | go | 579 | no_license | package scrabble
import "strings"
// Score the scrabble score of a word
func Score(word string) (score int) {
score = 0
word = strings.ToUpper(word)
// dont index into string because unicode, even though values of concern are ascii
for _, ch := range word {
switch ch {
case 'A', 'E', 'I', 'O', 'U', 'L', 'N'... |
b7ece5958278dcde70d9621c0687f492c959d717 | bdae82297717b24a92e2bad43d3f2bea6c339454 | varshard/monkey | /ast/function.go | Go | go | 591 | no_license | package ast
import (
"fmt"
"github.com/varshard/monkey/token"
"strings"
)
type FunctionLiteral struct {
Token token.Token
Parameters []Identifier
Body *BlockStatement
}
func (f FunctionLiteral) TokenLiteral() string {
return f.Token.Literal
}
func (f FunctionLiteral) String() string {
params := ... |
0ff9b75e7ced5c0ae289ad33437146cef82e2942 | e5a69b25ce2e96b8fcec353bba86021e8904a18f | SENERGY-Platform/user-management | /pkg/tests/imports_test.go | Go | go | 2,633 | permissive | /*
* Copyright 2021 InfAI (CC SES)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
3712b18b60152cdc3ca2451de3df0c8460e906d7 | 5f0710d468e6a19c111e744e093960163c7277e5 | jimbarrett27/go-euler | /solutions/problem28.go | Go | go | 343 | no_license | package solutions
func Problem28() (solution int) {
sum := 4
position := 3
for stepsize := 2; stepsize<1002; stepsize++ {
position += stepsize
if stepsize % 2 == 0 {
sum += position
} else {
sum += position-1
}
if stepsize == 1001 {
break
}
position += stepsize
sum += position
}
so... |
67509b48864ebb8d90b510adc24a2575940ebf46 | 7edd1ba9488c8b7d719f8c5ab1a9858c7556faa2 | kevinhide/meetingwebapplication | /routes/meetings.go | Go | go | 562 | no_license | package routes
import (
"HelpNow/handlers"
"github.com/gorilla/mux"
)
//MeetingRoutes :"user routes"
func MeetingRoutes(r *mux.Router) {
r.HandleFunc("/meetings", handlers.SaveMeetings).Methods("POST")
r.HandleFunc("/meetings/{uniqueID}", handlers.GetMeeting).Methods("GET")
r.HandleFunc("/meetings", handlers.Ge... |
d9bfd78a1964c0eca737f1c3eec0aa6d49715f05 | 06599c0d2311ecaba7612b51111afdcc7cdb990f | launchdarkly/go-server-sdk | /interfaces/client_interface.go | Go | go | 11,526 | permissive | package interfaces
import (
"github.com/launchdarkly/go-sdk-common/v3/ldcontext"
"github.com/launchdarkly/go-sdk-common/v3/ldreason"
"github.com/launchdarkly/go-sdk-common/v3/ldvalue"
"github.com/launchdarkly/go-server-sdk/v6/interfaces/flagstate"
)
// LDClientEvaluations defines the basic feature flag evaluation... |
ab2833968649de860f92b150d1b350f457c6ee04 | d5eb7531f56781d9f6befa30d21f13d1f8639267 | ericmurmur/id3v2 | /common_ids.go | Go | go | 6,241 | permissive | // Copyright 2016 Albert Nigmatzianov. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package id3v2
// Common IDs for ID3v2.3 and ID3v2.4.
var (
V23CommonIDs = map[string]string{
"Attached picture": "APIC",
"Comments": ... |
07fa2b73a1bb8593a76d00b07cbdcc13ef535d46 | 0926d19bc61f6e891f40dbb022c2f872e252d88c | david-bergman/ravendb-go-client | /tcp_utils.go | Go | go | 2,148 | permissive | package ravendb
import (
"crypto/tls"
"crypto/x509"
"encoding/base64"
"fmt"
"net"
"net/url"
)
func newTLSConfig(certificate *tls.Certificate, trustStore *x509.Certificate) (*tls.Config, error) {
if certificate != nil && trustStore == nil {
return nil, newIllegalArgumentError("certificates and trustStoreASN1 ... |
0604497966612bac569cfb34e162c2a9b2eb5368 | 6c466d1b72ad021ee436dd2d99c7d23ba6f787d9 | niluwats/covid_log | /dto/companyReqResp.go | Go | go | 246 | no_license | package dto
type NewCompanyRequest struct {
CompanyId string `json:"company_id"`
CompanyName string `json:"company_name"`
}
type NewCompanyResponse struct {
CompanyId string `json:"company_id"`
CompanyName string `json:"company_name"`
}
|
21f9e280b7023772dfaeed6ceea6fb72060d52e7 | 6cffb61452b641021e0e88f33d409f66b95f2067 | zhangruiliu/go | /src/methods/reflectInit.go | Go | go | 4,245 | no_license | package methods
import (
"dbdefault"
"fmt"
"path"
"reflect"
"strings"
"sync"
)
func DefaultValueOtherSystem(data interface{}) error {
if data == nil {
return fmt.Errorf(`nil can't be a paramater`)
}
if reflect.TypeOf(data).Kind() != reflect.Ptr {
return fmt.Errorf(`parameter must be a pointer`)
}
refV... |
9cdbab16f39cd285237f839b7cdd4927d7662cad | 9db7dc5af30a09a087c4dbc7757a9398cb513607 | bonan/gosips | /sip/parser/RetryAfterParser.go | Go | go | 2,032 | permissive | package parser
import (
"github.com/bonan/gosips/core"
"github.com/bonan/gosips/sip/header"
)
/** SIPParser for RetryAfter header.
*/
type RetryAfterParser struct {
HeaderParser
}
/** Creates a new instance of RetryAfterParser
* @param retryAfter the header to parse
*/
func NewRetryAfterParser(retryAfter strin... |
85fd53ca7147f31d0709846c18ac958b0c92a09c | 6a4cd4adb842b8e24c331a83bd663992d8a7c9f7 | cserli/- | /Yh_code/src/snake/tmain.go | Go | go | 5,151 | permissive | package main
/*
#include <windows.h>
#include <conio.h>
// 使用了WinAPI来移动控制台的光标
void gotoxy(int x,int y)
{
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE); // 获取控制台句柄
SetConsoleTextAttribute(handle, FOREGROUND_INTENSITY | FOREGROUND_RED); // 设置为红色
COORD c;
c.X=x,c.Y=y;
SetConsoleCursorPosition(GetStdHa... |
7856d204c265a1e07ec3cabf23f6b7114111608e | 99ac0f56adeb96eb923b000a7c2359a2565b826c | paulieborg/konfigurator | /konfigurator/konfigurator_test.go | Go | go | 1,815 | permissive | package konfigurator_test
import (
"net/http"
"os"
. "github.com/MYOB-Technology/konfigurator/konfigurator"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
httpmock "gopkg.in/jarcoal/httpmock.v1"
)
var _ = Describe("Konfigurator", func() {
var (
konfig *Konfigurator
err ... |
560afd73ad1f24d6e77a9bbc60968acd85ddb551 | e0d2e0a0912a8226441c45c24cc37a5df069eb77 | grant-unwin/bigcommerce-api-go | /storefront_search.go | Go | go | 2,223 | permissive | package bigcommerce
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"strings"
)
type StorefrontSearchSettingsService interface {
Get(...int) (StorefrontSearchSettings, error)
Update(StorefrontSearchSettings, ...int) (StorefrontSearchSettings, error)
Delete(int, []string) error
}
type StorefrontSearchSettin... |
750539740957cd59728cb1ed5bbbd6c7e6072e11 | aa83a5a52620f520ed13065ba83bb239e6948477 | NorbertoRios/BGfho56J | /stats/stats.go | Go | go | 211 | no_license | package stats
import "github.com/shirou/gopsutil/process"
//NewProcessStat ...
func NewProcessStat() *Process {
return &Process{}
}
//Process ...
type Process struct {
process.Process
CPUPercent float64
}
|
015fc152b08eb24fb9ab32e9f90781a6a0fc2367 | 294d6110e10f5132ceb228cbab1b9a271eead8b6 | rsc/client | /go/engine/cryptocurrency.go | Go | go | 4,072 | permissive | // Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package engine
import (
"fmt"
"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
)
type CryptocurrencyEngine struct {
libkb.Contextified
arg keyba... |
630d31d414b909ee920f0b649c9ce48afe09a868 | 453abb16cc4a1ae10d0909b9fdb37c15ca8cb9f4 | cjslep/stat | /dist/norm.go | Go | go | 11,755 | no_license | // Copyright ©2014 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.
package dist
import (
"math"
"math/rand"
"github.com/gonum/floats"
"github.com/gonum/stat"
)
// UnitNormal is an instantiation of the standard normal... |
8afa65750a30f644b2391c712f64dcdf4a07f575 | c2e8f8584c19f745903d11775c83438854f5abc1 | 0gajun/amazon-ssm-agent | /agent/runcommand/scheduler_integ_test.go | Go | go | 9,099 | permissive | // Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" fil... |
e1b5d293d064b38d39c2b41e44a13a54b7c19b5e | 98f9e004b1e008845dbb4ca03db40b7f3f872871 | Aeishen/go | /testEveryDay/testEveryDay6.go | Go | go | 584 | no_license | /*
@File: testEveryDay6
@Author: Aeishen
@Date: 2019/12/23 16:45
@Description:
*/
package main
import "fmt"
func main() {
}
/*
for range 循环的时候会创建每个元素的副本,而不是元素的引用,所以 m[key] = &val 取的都是变量 val 的地址,所以最后 map 中的
所有元素的值都是变量 val 的地址,因为最后 val 被赋值为3,所有输出都是3.
*/
func testEveryDay6_1(){
s := []int{1,2,3,4}
m... |
203d7b0b3b5a19aa9f21be70ecfb9e8ecd4b9414 | 298c59b944f2475dbb1bf26cf51b6acfd1938472 | mesosphere/kfserving | /tools/tf2openapi/generator/generate.go | Go | go | 2,408 | permissive | package generator
import (
"fmt"
"github.com/getkin/kin-openapi/openapi3"
pb "github.com/kserve/kserve/tools/tf2openapi/generated/protobuf"
"github.com/kserve/kserve/tools/tf2openapi/types"
)
const (
DefaultSigDefKey = "serving_default"
DefaultTag = "serve"
)
// Known error messages
const (
SpecGenerat... |
747dd634f2131fe183514ec1bf38a3c9f64024ad | f4c6baef10a35cdaab533bff4358f4c99b227470 | tbarge9850/terragrunt | /config/dependency.go | Go | go | 36,932 | permissive | package config
import (
"bufio"
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"
"github.com/hashicorp/go-getter"
"github.com/hashicorp/hcl/v2"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/gocty"
ctyjson "github.com/zclconf/go-cty/cty/json"
"g... |
fa36a719610ca68e2a08c5eaca0d0cd4ee472e30 | 3baef1aba96f6a26cd5a915a1f35eaa69fe85ea6 | HiramGao/leetcode-go | /1202/1202.go | Go | go | 1,362 | no_license | package main
import (
"fmt"
"sort"
)
type UnionFindSet struct {
parent, rank []int
}
func NewUnionFindSet(n int) *UnionFindSet {
parent := make([]int, n)
rank := make([]int, n)
for i := 0; i < n; i++ {
parent[i] = i
rank[i] = i
}
return &UnionFindSet{parent: parent, rank: rank}
}
func (u *UnionFindSet) F... |
9de211c76978157548d6d71029c814372c460ca4 | 9525080a442b5df0285f150a6d684009285720eb | m00zi/random-1 | /random.go | Go | go | 4,519 | no_license | // The random package provides cryptographically secure random integers
// and strings.
package random
import (
"crypto/rand"
"encoding/base64"
"encoding/binary"
"errors"
"math"
)
// Uint64Range returns a random 64-bit unsigned integer in the range [start, end].
// An error is returned if start is greater than e... |
4ac0d04dfb6f4a617cf6b085c9126140eebfda79 | 7404248c49a0e69e5cacd1f7727927a8bab9a926 | 970584040/Im | /util/md5.go | Go | go | 566 | no_license | package util
import (
"crypto/md5"
"encoding/hex"
"strings"
)
//小写
func Md5Encode(data string) string {
h := md5.New()
h.Write([]byte(data)) // 需要加密的字符串为 123456
cipherStr := h.Sum(nil)
return hex.EncodeToString(cipherStr)
}
//大写
func MD5Encode(data string) string {
return strings.ToUpper(Md5Encode(data))
}
... |
8b115d93ddd0e9c1768c12b3d76b2179b149ab28 | 9916a10240902fdac26192ef04ae306948794f0a | makura46/KUMA-server | /controllers/api.go | Go | go | 700 | no_license | package controllers
import (
"net/http"
"github.com/gin-gonic/gin"
m "KUMA-server/models"
)
func LectureAPI(c *gin.Context) {
le := m.AllLecture()
c.JSON(http.StatusOK, le)
}
func TestAPI(c *gin.Context) {
test, _ := m.GetAllTest()
c.JSON(http.StatusOK, test)
}
func CancelAPI(c *gin.Context) {
cancel, _ :... |
8be50248d490007cbb84af194c7ea0336d4d003b | ddcc4e9d378bd0206e66d35f49bd976bfbc249e8 | cosisoft/termshark | /pcap/loader.go | Go | go | 61,249 | permissive | // Copyright 2019-2020 Graham Clark. All rights reserved. Use of this source
// code is governed by the MIT license that can be found in the LICENSE
// file.
package pcap
import (
"bufio"
"context"
"encoding/xml"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"regexp"
"strconv"
"strings"
"sync"
"sync/atomic"... |
9946c730e02a64260b5be5650e674a46982ebc74 | eee5b70e34f2f6c558c1da3da82e43d6fe3029f5 | hjkelly/zbbapi | /services/plans/update.go | Go | go | 932 | permissive | package plans
import (
"github.com/hjkelly/zbbapi/common"
"github.com/hjkelly/zbbapi/models"
mgo "gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
// UpdateID finds the current Plan by ID, updates all its user-updatable fields, and saves it again.
func UpdateID(id string, input models.Plan) (*models.Plan, error) {
ds :... |
c40085c9af1a329bd2616de09d5e678d10d39da4 | 5164df817e4ff67cd2a634753e4d0197a837b2e4 | mclausen792/goCRUD | /{mclausen792}/rest-api/main.go | Go | go | 1,982 | no_license | package main
import (
"encoding/json"
"log"
"net/http"
"github.com/gorilla/mux"
)
type Person struct {
ID string `json:"id,omitempty"`
Firstname string `json:"firstname,omitempty"`
Lastname string `json:"lastname,omitempty"`
Address *Address `json:"address,omitempty"`
}... |
8c783fe2629bc63e9e3fc8cadfadd4c73b1546f1 | c19d11f58e4af95f2c3233b1a68022ab6ee733c3 | fernandooliveirapimenta/go_lang | /errors/bankActivity.go | Go | go | 1,103 | no_license | package main
import (
"errors"
"fmt"
)
var(
ErrInvalidLastName = errors.New("invalid last name")
ErrInvaliRoutingNumber = errors.New("invalid routing number")
)
type directDeposit struct {
firstName string
lastName string
bankName string
routingNumber int
accountNumber int
}
func (d *directDeposit) validat... |
6890d73d8f6eb4db6b93287a5180f931db6ee200 | bfa498bb0f239c9c41c688becf6ee9f5a820cd58 | lyft/cri-o | /vendor/github.com/open-policy-agent/opa/internal/jwx/jws/jws.go | Go | go | 7,298 | permissive | // Package jws implements the digital Signature on JSON based data
// structures as described in https://tools.ietf.org/html/rfc7515
//
// If you do not care about the details, the only things that you
// would need to use are the following functions:
//
// jws.SignWithOption(Payload, algorithm, key)
// jws.Ver... |
06e4a1e0dd631f3ca0fcd477f41bb9e41c7feba2 | f195a0b7c0c0dd8e9d10d2102ac3b1874f2aa38c | majian159/kubevela-core-api | /apis/core.oam.dev/v1alpha2/core_workload_types.go | Go | go | 13,081 | permissive | /*
Copyright 2021 The KubeVela 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... |
68aeeaefc81eef18f9fe7fbb62775db0c16e443d | 1d00cc92c1554f0ebaa176a0d3a23cd558f32670 | sippy/go-b2bua | /sippy/sip_transaction_manager.go | Go | go | 27,959 | permissive | // Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
// Copyright (c) 2006-2015 Sippy Software, Inc. All rights reserved.
// Copyright (c) 2015 Andrii Pylypenko. All rights reserved.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permit... |
99f170ad5ce07a9a3d3f42dff90a19ca22a920df | d20957648c65dce764064210d04578255f56759d | cromefire/openapi-generator | /samples/openapi3/client/petstore/go-experimental/go-petstore/model_fruit_req.go | Go | go | 3,039 | permissive | /*
* OpenAPI Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package petstore
import (
"encodin... |
e93be26d409b9c4c481b2ded4c2d29a1b5f954d1 | 6a04261834f094bcad7c867b94cff67b5dfbd526 | rchamorro/pulumi-azure-nextgen | /sdk/go/azure/network/v20160901/packetCapture.go | Go | go | 11,054 | 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 v20160901
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Information about packet capture sess... |
99ee5f3b6e2b9af6d72bacd61236a5b848127522 | 5c8a7dbdc247ee1982065ce32a6066fb59c2052c | zituocn/RedisGo-Async | /client/synclient.go | Go | go | 5,240 | permissive | package client
import (
"github.com/gistao/RedisGo-Async/redis"
"sync"
"time"
)
type SynClient struct {
pool *redis.Pool
Addr string
}
var (
syncMap map[string]*SynClient
syncMutex *sync.RWMutex
)
const (
defaultTimeout = 300
)
func init() {
syncMap = make(map[string]*SynClient)
syncMutex = new(sync.RW... |
3c88ff44a8d00ce3b4ed69e2af2fe884ae59f09c | 76a0c031b8b0cc57de0603c8fe171e2d0f6ce050 | bcrusu/kcm | /cmd/add_node.go | Go | go | 4,513 | permissive | package cmd
import (
"strconv"
"github.com/bcrusu/kcm/cmd/create"
"github.com/bcrusu/kcm/cmd/start"
"github.com/bcrusu/kcm/cmd/status"
"github.com/bcrusu/kcm/cmd/validate"
"github.com/bcrusu/kcm/libvirt"
"github.com/bcrusu/kcm/repository"
"github.com/bcrusu/kcm/util"
"github.com/pkg/errors"
"github.com/spf1... |
27236ab872d32f08a3543a03de2182efd235a81a | 74a5b825c7837088b1eb1cda67c5ac1e02ce479b | willise/caskin | /error.go | Go | go | 965 | permissive | package caskin
import "fmt"
var (
// errors about entry
ErrNil = fmt.Errorf("nil data")
ErrEmptyID = fmt.Errorf("empty id")
ErrAlreadyExists = fmt.Errorf("already exists")
ErrNotExists = fmt.Errorf("not exists")
// errors about permission
ErrNoReadPermission = fmt.Errorf("no read permissio... |
07f0923d044c90ae4ec42f8864b1ebaa6fc6b3eb | 2b66fbea95893d09df783fa0410d48837796c348 | MLaszczewski/k8s-localflex-provisioner | /provisioner/vendor/k8s.io/kubernetes/cmd/kube-proxy/app/server.go | Go | go | 25,367 | permissive | /*
Copyright 2014 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, ... |
5bb132358034be2fa625c47fb69be5b72d8fad53 | d4e091169d28387ea32121c0ca8e41039d1d952f | scsldb/ticdc-release-4.0 | /cdc/model/sink.go | Go | go | 10,661 | permissive | // Copyright 2020 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... |
65a9b45a2b25dd609a07c22066662a4ebfb55a7f | f6ea8870ad54f8b6e5b702f7100f5937ab545e8e | hanaboso/go-rabbitmq | /pkg/rabbitmq/channel.go | Go | go | 2,071 | permissive | package rabbitmq
import (
"fmt"
"github.com/hanaboso/go-utils/pkg/intx"
amqp "github.com/rabbitmq/amqp091-go"
"sync"
"time"
)
type channel struct {
channel *amqp.Channel
connection *connection
confirm chan amqp.Confirmation
deliveryTag uint64
refreshed chan struct{}
open bool
id ... |
def4ead9eb2697f571449e29addb44e95e87ee06 | 536d95bbdb6858e86a7fe1cfcbb9ba750c3336ec | dream002/fightlandlord | /fightlandlord.go | Go | go | 15,836 | no_license | package fightlandlord
import (
"fmt"
"math/rand"
"net"
"os"
"sort"
"strconv"
"strings"
"time"
)
type Card struct {
Card_cseq int
Card_value int
Card_type string
Isalloc bool
}
type Player struct {
Player_addr string
//Player_cards []int
Player_cards []Card
Player_name string
Player_type ... |
1f76a0c8091cce41354438bcae9db18e0fad7ec5 | 0b2e73c837c42f68ab8e9ecbfe8c30e6989b48a1 | iuvei/red_packet | /gopkg.in/macaron.v1/recovery.go | Go | go | 4,394 | permissive | // Copyright 2013 Martini Authors
// Copyright 2014 The Macaron 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 r... |
c93f0ca4735f5170753baa4cac4b4350217eacb1 | f0295f7f1a07aace347c2d4ab144eb356ba582f3 | prosto-nik/reef-pi | /controller/modules/macro/subsystem.go | Go | go | 751 | permissive | package macro
import (
"sync"
"github.com/reef-pi/reef-pi/controller"
"github.com/reef-pi/reef-pi/controller/storage"
)
const Bucket = storage.MacroBucket
const UsageBucket = storage.MacroUsageBucket
type Subsystem struct {
sync.Mutex
devMode bool
quitters map[string]chan struct{}
controller controller.... |
3fd5eba8bc286a665a16df85859125346500720a | a5ff1c28e0cbd9b644af108b2f9bfb649f182b31 | pcjacobse/periph | /experimental/devices/mfrc522/mfrc522.go | Go | go | 19,411 | permissive | // Copyright 2018 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// Package mfrc522 controls a Mifare RFID card reader.
//
// Datasheet
//
// https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
package mfrc5... |
1ca0a6697f33bdb91abea2945c1fa2be871a54be | dd0656441d00fd7283ae043cbcce5287e2c28f7d | anoadragon453/dendrite | /cmd/dendrite-client-api-server/main.go | Go | go | 1,688 | permissive | // Copyright 2017 Vector Creations 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 agre... |
283a5e4f7fd31b2f267ca5ccc8a625651798e364 | 700c49c609aa36a865cac549e3da0b9545ee7a3b | Titanssword/pouch | /daemon/mgr/snapshot_test.go | Go | go | 1,363 | permissive | package mgr
import (
"testing"
"time"
"github.com/alibaba/pouch/pkg/errtypes"
snapshot "github.com/containerd/containerd/snapshots"
"github.com/stretchr/testify/assert"
)
func Test_SnapshotStore(t *testing.T) {
snapshots := map[string]Snapshot{
"key1": {
Key: "key1",
Kind: snapshot.KindActiv... |
6e757d3745b5b05ef3251e85b07b22ed6968d58d | 6d0a91b5ca96215caecd36852c0ceb214b7e9cc4 | laudarch/iso20022 | /CountryAndResidentialStatusType2.go | Go | go | 606 | permissive | package iso20022
// Country and residential status.
type CountryAndResidentialStatusType2 struct {
// Country to which the residential status is applicable.
Country *CountryCode `xml:"Ctry"`
// Residential status of the organisation or individual, for example, non-permanent resident.
ResidentialStatus *Residenti... |
955e2f9cfa9d4a87701c34d14eebe9301e60a64c | 33e67a5d78fb82523bad840495fc473bb6ed760f | beslnet/banking | /domain/CustomerRepositoryDb.go | Go | go | 1,539 | no_license | // Package domain provides ...
package domain
import (
"database/sql"
"github.com/beslnet/banking/app/logger"
"github.com/beslnet/banking/errs"
"github.com/jmoiron/sqlx"
)
type CustomerRepositoryDb struct {
client *sqlx.DB
}
func (d CustomerRepositoryDb) FindAll(status string) ([]Customer, *errs.AppError) {
... |
88ca95fdb948e50581e8c0a17f021e5b63dd18dc | 57c6382c707b225f130b63ee636b45377f89cf6e | Giners/cadence | /runtime/tests/checker/predeclaredvalues_test.go | Go | go | 5,389 | permissive | /*
* Cadence - The resource-oriented smart contract programming language
*
* Copyright 2019-2020 Dapper Labs, 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.ap... |
7e790c9e751ad9fe9bab6186c8eaed452276c822 | 7628042cc8b290c6b62c85aeb05190004cfbad73 | ashimjk/vagrant | /kube-cluster/tools/metrics-server/pkg/sources/summary/configs.go | Go | go | 2,026 | permissive | // Copyright 2018 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 a... |
6300b9d27dc930a2e16c325d9229a43c85f0dca4 | 5403de4e575ebeefb47a22b3fdf9b24863a69531 | TikaWorld/TIL | /Go/2.HTTP/1.GetMethod/1.GetMethod.go | Go | go | 899 | no_license | package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "http://www.google.com"
simpleGet(&url)
modifiedGet(&url)
}
func simpleGet(url *string) {
// GET 호출
resp, err := http.Get(*url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
// 결과 출력
data, err := ioutil.ReadAll(resp.Bod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.