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
381353813f8581fdc0893839cab15c79d016a444
b213e675a991d06d6a066e5d01cad47ab9689d4a
AlyRagab/starboard
/pkg/apis/aquasecurity/v1alpha1/vulnerability_types.go
Go
go
9,564
permissive
package v1alpha1 import ( "strconv" "github.com/aquasecurity/starboard/pkg/apis/aquasecurity" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/utils/pointer" ) const ( VulnerabilityReportsCRName ...
bff574c218dd27bb5ffd6676277200da4b9f6cfd
081cce24e8c0cc61357fb3b6d8435efa19810d65
brugnara/grammes
/manager/testing.go
Go
go
3,915
permissive
// Copyright (c) 2018 Northwestern Mutual. // // 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, p...
32e49160fd1c8b0a29745a5d9580e487b4b1e31b
f3679bfb71c17ebeaf9bad5f06af457e993a3c73
alexellis/jaas
/vendor/github.com/docker/docker/libcontainerd/utils_windows_test.go
Go
go
350
permissive
package libcontainerd import ( "testing" ) func TestEnvironmentParsing(t *testing.T) { env := []string{"foo=bar", "car=hat", "a=b=c"} result := setupEnvironmentVariables(env) if len(result) != 3 || result["foo"] != "bar" || result["car"] != "hat" || result["a"] != "b=c" { t.Fatalf("Expected map[foo:bar car:hat ...
2f750d9313edd3769e17d6a2a64b7c650e985155
b284ead0f94607f6ac59fb3e491e7056c84eef26
takihito/hoproxy
/config.go
Go
go
347
permissive
package hoproxy import ( "log" config "github.com/kayac/go-config" ) // NewConfig TODO あとで書く func NewConfig(path string) *Config { log.Printf("[info] loading config file: %s", path) cfg := &Config{} err := config.LoadWithEnv(&cfg, path) if err != nil { log.Fatalf("cannot load config: %s: %s", path, err) ...
2ec6e6c644050b184cbd291535d3ca7055db7911
2816405b72a06c2601801eafc17d4535db902c9b
chanced/picker
/operator_param.go
Go
go
2,079
permissive
package picker import ( "strings" "encoding/json" "github.com/chanced/dynamic" ) type Operator string func (o Operator) String() string { return string(o) } func (o Operator) toUpper() Operator { return Operator(strings.ToUpper(string(o))) } const DefaultOperator = OperatorOr const ( // OperatorOr Operator...
4f9922f265c9e2979722a2406b69cabdb86fc29a
5fd7bab081275fde394f4a89bb3b93a5a6eed70d
microsoftgraph/msgraph-beta-sdk-go
/education/users_item_assignments_item_submissions_item_outcomes_count_request_builder.go
Go
go
5,228
permissive
package education import ( "context" i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" i20a3050780ee0b0cde0a884a4f35429a20d60067e3bcda382ec5400079147459 "github.com/microsoftgraph/msgraph-beta-sdk-go/models/odataerrors" ) // UsersItemAssignments...
c9af4f50eaa09043df9feedb564714da1cc92cda
f04d6a59ce176b60f836c7b5863d4ca0f5bd26f9
thipuvaasan/godev
/runner.go
Go
go
2,104
permissive
package main import ( "fmt" "sync" ) // RunnerConfig configures the Runner type RunnerConfig struct { Pipeline []*ExecutionGroup LogLevel LogLevel } // RunnerTriggerCount keeps track of the number of piplines run var RunnerTriggerCount = 0 // Runner is the main component responsible for running the execution pi...
fc8407a34d33d83016240aee55920e3ea44fd53c
8707559b84393b570393d0a85452082cd3c6127e
appveen/mongo-go-driver
/x/mongo/driver/topology/fsm.go
Go
go
8,501
permissive
// Copyright (C) MongoDB, Inc. 2017-present. // // 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 package topology import ( "bytes" "fmt" "gith...
9459129b61ae9dbad7b25cbcc87e5203b21a487c
fe940177ae630347c15bc3f1adc4086b1bd60720
hfeng101/niwo
/controller/catalog/v1/catalog_operation.go
Go
go
10,157
permissive
package v1 import ( "github.com/cihub/seelog" "github.com/hfeng101/niwo/storage/mysql" "github.com/hfeng101/niwo/utils/consts" "github.com/kataras/iris/v12" ) //根据关键字获取记录列表 func GetRecordListByKey(ctx iris.Context) { resBody := &ResponseContent{ Code: consts.SUCCESSCODE, Message: consts.SUCCESSCODEMESSAGE, ...
81863ed6d3de6515d28bf45d3de1ae1aa2f89798
a89c77e8fe333dda9d6cac2d5e4ec0a4c86ca86c
emi1997/con-app
/cmd/getDocuments.go
Go
go
516
permissive
package cmd import ( "github.com/emi1997/con-app/client" "github.com/spf13/cobra" ) //calls on rootCmd from root.go with AddDocument function and passes it newly created command as argument func init() { rootCmd.AddCommand(getDocument) } //Defining new command var getDocument = &cobra.Command{ Use: "getdoc", ...
8f94043766fb6a97dc8df03ea99e82815844ce7d
a8f4e3c17da66ceb8fea086a32b5132b448ce857
breml/sysinspect
/Godeps/_workspace/src/github.com/shirou/gopsutil/cpu/cpu_freebsd.go
Go
go
3,416
permissive
// +build freebsd package cpu import ( "fmt" "os/exec" "regexp" "strconv" "strings" "github.com/breml/sysinspect/Godeps/_workspace/src/github.com/shirou/gopsutil/internal/common" ) // sys/resource.h const ( CPUser = 0 CPNice = 1 CPSys = 2 CPIntr = 3 CPIdle = 4 CPUStates = 5 ) var Clocks...
e375aed20c8cbeeb4a9e4ef6b3189e5df190acfe
14203c6a734d2498ffba7f3cf8854e7138d70e22
hardtosaygoodbye/pineapple-go
/service/sues.go
Go
go
4,772
no_license
package service import ( "errors" "net/http" "os" "pineapple-go/core/req" "pineapple-go/model" "pineapple-go/util" "strings" "github.com/gin-gonic/gin" "github.com/google/uuid" "github.com/gorilla/websocket" "github.com/spf13/cast" ) type suesService struct { } var SuesService = suesService{} var proxy ...
1f0adb6c229e21255342c1783ffdaa81b27094a3
f78e3b3a5da0e8e352a3e612b8d7e4cbf4e362c4
carol8421/gosh
/3rd/go/src/pkg/container/heap/heap.go
Go
go
1,934
permissive
// 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. // This package provides heap operations for any type that implements // heap.Interface. // package heap import "sort" // Any type that implements heap.Interf...
0f4bd95bd71039c77fe7796e0ff8d6001c014fa0
8c0612d0b8d5d05eb78087a3c1afea30a9aaa69b
Abirdcfly/Leetcode
/237.删除链表中的节点.go
Go
go
291
permissive
/* * @lc app=leetcode.cn id=237 lang=golang * * [237] 删除链表中的节点 */ /** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */ func deleteNode(node *ListNode) { node.Val = node.Next.Val node.Next = node.Next.Next }
5685f4ed833f6e79f87b4025ce495d8d4f6b3b13
cd486de6e98b73637b0ca4f887634c1169364f7b
TheThingsNetwork/lorawan-stack
/pkg/band/cn_470_510_rp1_v1_0_2_rev_b.go
Go
go
3,437
permissive
// Copyright © 2021 The Things Network Foundation, The Things Industries B.V. // // 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 // // Un...
6583378e50b2172fd481ce19375bf1fe542308c8
bae30bccbfa4af673d2ee75595b2398c4356ad98
figoxu/rabbit
/cmd/task_worker/main.go
Go
go
2,355
no_license
package main import ( "bytes" "fmt" "log" "time" "github.com/streadway/amqp" ) func main() { con := "amqp://root:123123@localhost:5672/" for i := 0; i < 3; i++ { go receive(con, i) } for i := 0; i < 100; i++ { send(con, fmt.Sprint("Hello ", i)) } forever := make(chan bool) log.Printf(" [*] Waiting fo...
8f08d9123224baece4fa76d142aa1a0f3bf787f5
ebfb7049db3f0797f1eb0c681bedc5ee5dda7825
XDfield/go-bilibili-tools
/bservice/share.go
Go
go
1,544
no_license
package bservice import ( "fmt" "sync" ) type failState struct { State bool `json:"state"` Data string `json:"data"` } // ShareService 视频分享服务 func (b *BService) ShareService(wg *sync.WaitGroup) { defer wg.Done() if !b.config.ShareServerEnable { return } b.logger.Println("启动视频分享服务") for { aid, err := ...
11297aab5fb326808d5e7d1fe633803bd55d67da
c6aa4bcc46373b8103de92c3b318ab0a4cd8d9f5
bornehill/golang-bootcamp-2020
/server.go
Go
go
535
no_license
package main import ( "log" "net/http" "github.com/bornehill/golang-bootcamp-2020/config" "github.com/bornehill/golang-bootcamp-2020/infrastructure/datastore" "github.com/bornehill/golang-bootcamp-2020/infrastructure/router" "github.com/bornehill/golang-bootcamp-2020/registry" ) func main() { config.ReadConfi...
4d8d6c4bb75e6269891adf4657cbf644713743c4
afded7037c671f059e044d8b941775b5d60fbb0b
stevesloka/contour
/cmd/contour/certgen.go
Go
go
6,412
permissive
// Copyright Project Contour 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...
d984e8af145d32fa11e8cb95df7c8994a24d86f9
83c95b87ccbb0393b8b8e7303e13e89a5939d2c5
Mensu/Agenda-Go
/vendor/cmd/list.go
Go
go
641
permissive
package cmd import ( "fmt" "os" "service" "github.com/spf13/cobra" ) var listCmd = &cobra.Command{ Use: "list", Short: "show registered users", Long: `show registered users`, Run: func(cmd *cobra.Command, args []string) { results, err := service.FindAll() if err == nil { fmt.Println("All registered...
adc5323ed57507ca7769449aa328ca4f1647a8a9
9137ab146502d84b5c1d059c79d46956275fa36b
NikitaBolbatun/chain
/peer.go
Go
go
723
no_license
package bulba_chain import ( "errors" ) func (c *Node) AddPeer(peer Blockchain) error { remoteAddress, err := PubKeyToAddress(peer.NodeKey()) if err != nil { return err } if c.address == remoteAddress { return errors.New("self connection") } if _, ok := c.peers[remoteAddress]; ok { return nil } out ...
aebaea2b7369cb76bc41207ed94c3949daccac66
038ed884c81accefde6fe42097a196bbfc198688
Cloudxtreme/grpc-go
/clientconn.go
Go
go
16,107
permissive
/* * * Copyright 2014, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of condi...
dad234ba98a3d06e4fafa532316507d7c3d7ed29
1192620dd7cac864045b7f8264624c1146d42f79
usench/pandas
/kuiper/xsql/processors/window_rule_test.go
Go
go
43,170
permissive
package processors import ( "github.com/cloustone/pandas/kuiper/xstream" "github.com/cloustone/pandas/kuiper/xstream/api" "testing" ) func TestWindow(t *testing.T) { //Reset streamList := []string{"demo", "demoError", "demo1", "sessionDemo"} handleStream(false, streamList, t) var tests = []ruleTest{ { nam...
befe61d3ffd632e335e82afdecb8122b136b21e9
7a3a8b5a7ca452a5650bb830f0932308fa43dc06
ajanthan/playground
/exercises/ch04/min_height_bst.go
Go
go
372
permissive
package ch04 import ( "playground/ds/tree" ) func MinHeightBST(in []int) *tree.BTNode { if len(in) == 1 { return &tree.BTNode{Data: in[0]} } else if len(in) == 0 { return nil } root := &tree.BTNode{} mid := len(in) / 2 root.Data = in[mid] left := MinHeightBST(in[:mid]) root.Left = left right := MinHeigh...
7e9fe1b0f35caa08733274b558d0dfa9e2385112
0da38d0a50dcc13fd1168cc0d08c058048d877d8
coacer/line-bot-demo
/services/webhook/infrastructure/spanner/client_test.go
Go
go
1,552
no_license
package spanner import ( "context" "fmt" "os" "testing" "time" "webhook/interface/repository" ) var ( project = os.Getenv("GCP_PROJECT_ID") instance = os.Getenv("DB_INSTANCE_NAME") dbName = os.Getenv("DB_NAME") sql repository.Sql sqlClient repository.SqlClient ctx context.Context ) func T...
dc44f74c46524ec62fe97d529558e63a4948c755
1fa003f9a0c5cb95dbc61f9132ac12b3c7cb4a4e
ulzeraj/telegraf-p2ksp
/ulgp2ksp.go
Go
go
2,440
permissive
package ulgp2ksp import ( "os" "fmt" "log" "strings" "strconv" "io/ioutil" "path/filepath" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/plugins/inputs" "github.com/influxdata/telegraf/plugins/inputs/system" ) type ULGP2KSPStats struct { ps system.PS } ...
9d9400b8f50e6fa707c34dcb5ebdc8c9b87f99d7
b44a414dd83d7e053eab84f387c157b7e50ab0b1
rodrigo-brito/thumbnail
/image.go
Go
go
1,885
permissive
package main import ( "fmt" "image" "image/png" "log" "os" "strings" "github.com/disintegration/imaging" "github.com/fogleman/gg" ) type Option func(image.Image) image.Image func Resize(w, h int) Option { return func(img image.Image) image.Image { return imaging.Fill(img, w, h, imaging.Center, imaging.La...
db8aaa868339ec3353b99044904996376d78c7a1
1e080f9097f0ee370b599735e938c660f3959b05
rbaumgar/operator-metering
/pkg/operator/prestostore/importer.go
Go
go
7,174
permissive
package prestostore import ( "context" "sync" "time" prom "github.com/prometheus/client_golang/api/prometheus/v1" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/common/model" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/util/clock" ) type ImporterMetricsCollectors struct { ...
bccbfacd666a275b21229c432a1c19075fdf856a
0c7a0d3ad32e005df65eb1eab9f717341130d99f
bailiyan/go_notes-qyuhen
/chapter01/page013_01/main.go
Go
go
211
no_license
package main import "fmt" type user struct { name string age byte } type manager struct { user tile string } func main() { var m manager m.name = "Tom" m.age = 29 m.tile = "CTO" fmt.Println(m) }
d44b778d29671212b562cdca3d2dc5cddc48d8c4
0d21b033c32e1c6bc4c1c48d518beac55046354e
manjdk/Carbon-Based-Life-Forms
/api/controller/get_mineral_test.go
Go
go
3,391
no_license
package controller import ( "errors" "net/http" "net/http/httptest" "testing" "github.com/gorilla/mux" "github.com/manjdk/Carbon-Based-Life-Forms/custom_http" "github.com/manjdk/Carbon-Based-Life-Forms/mocks" "github.com/stretchr/testify/mock" ) func TestGetMineral(t *testing.T) { type args struct { httpC...
3657afec67af2398ce93a2b20d0d43691721f4a1
0286ebd39832cc2f10bdde175af7fc1cc87c5514
hawkingrei/cibo
/options.go
Go
go
940
no_license
package main import ( "bufio" "fmt" "log" "os" "github.com/BurntSushi/toml" ) type ConfigMap struct { Service []service } type service struct { ServiceName string `yaml:"ServiceName"` ServicePort int `yaml:"ServicePort"` } type Options struct { InputFile string Conf string OutputFile string T...
79fea1527e46dc0feca715599d8f2948236f437f
669a55d15f81f1083ce7be5d52127c939d9c795a
huangweiboy/rio
/cli/cmd/builds/builds.go
Go
go
706
permissive
package builds import ( "github.com/rancher/rio/cli/pkg/builder" "github.com/rancher/rio/cli/pkg/clicontext" "github.com/urfave/cli" ) func Builds(app *cli.App) cli.Command { ls := builder.Command(&Ls{}, "List Builds", app.Name+" builds ls [OPTIONS]", "") restart := builder.Command(&Restart{}, "Restart b...
581b909c56809e6bb28ceb6c0dac84df6b25b80a
4dc85fb90e957416e237c6b48021d31454e8d79f
hilalisa/go-jsval
/internal/cmd/genmaybe/genmaybe.go
Go
go
7,650
permissive
package main import ( "bytes" "fmt" "go/format" "log" "os" "sort" "strconv" ) const tPreamble = `package jsval_test import ( "testing" "github.com/lestrrat/go-jsval" ) ` const preamble = `package jsval import ( "bytes" "encoding/json" "reflect" "time" ) type ErrInvalidMaybeValue struct { Value int...
4f36caaf3d1f72f0ad4709c7109dfe8fb0d10a3d
77f3e02c8a50c6742fea1909b094142371ad4ef8
yinweiyi/go-blog-web
/app/services/article_service.go
Go
go
1,735
no_license
package services import ( "blog/app/models" "blog/vendors/model" "blog/vendors/pagination" "net/http" "gorm.io/gorm" ) type ArticleService struct { } // Get 通过 ID 获取文章 func (ArticleService) GetBySlug(slug string) (models.Article, error) { var article models.Article err := model.DB.Preload("Category").First(&...
62ed4efcb387029f6ed63c22fb287fb2af0f766d
a73eea7341efb4eeafcfd47dcf84006c80c948c9
Kif11/AuthorizeCIM
/_examples/new_transaction/main.go
Go
go
1,202
permissive
package main import ( "fmt" "os" auth "github.com/hunterlong/authorizecim" ) var newTransactionId string func main() { apiName := os.Getenv("apiName") apiKey := os.Getenv("apiKey") auth.SetAPIInfo(apiName, apiKey, "test") if auth.IsConnected() { fmt.Println("Connected to Authorize.net!") } ChargeCust...
137683c163e0839902aab3e08f7029661ba31607
1cd0bc9c2d37844d300b1c327fa8b4800f0402ca
IkiM0no/s3-to-redshift
/vendor/github.com/Clever/pathio/pathio.go
Go
go
6,207
permissive
/* Package pathio is a package that allows writing to and reading from different types of paths transparently. It supports two types of paths: 1. Local file paths 2. S3 File Paths (s3://bucket/key) Note that using s3 paths requires setting two environment variables 1. AWS_SECRET_ACCESS_KEY 2. AWS_ACCESS_KEY_ID */ ...
6210850b9d5da7351d65bac9bf01ecec127264e6
fdf13fdc94a7202ee2dfa49bd85f31c55468b440
VineethReddy02/kubectl-pg
/vendor/github.com/fsnotify/fsnotify/inotify_test.go
Go
go
10,907
permissive
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux package fsnotify import ( "fmt" "os" "path/filepath" "strings" "sync" "testing" "time" ) func TestInotifyCloseRightA...
fa7fa2209a228a32d5688f86d812af8296ca3e65
cba01872361309c1435ad848acec4170d4e2e4ed
LubyRuffy/XDGv2
/qtui/uic_singlesite.go
Go
go
17,537
no_license
package qtui import ( "github.com/therecipe/qt/core" "github.com/therecipe/qt/widgets" ) type __singlesiteanalyzer struct{} func (*__singlesiteanalyzer) init() {} type SingleSiteAnalyzer struct { *__singlesiteanalyzer *widgets.QWidget GridLayout *widgets.QGridLayout Widget_7 ...
7070d0136318f52b3e73dbec82adcd0763b6070f
22389d2d9da7d717cd76228b9b66b85942a89f16
Jordanzuo/goutil
/syncUtil/rwLocker_test.go
Go
go
3,504
no_license
package syncUtil import ( "fmt" "testing" "time" ) func TestRWNewLocker1(t *testing.T) { count := 1000000 succeedCount := 0 expected := 1000000 goroutineCount := 1 lockerObj := NewRWLocker() ch := make(chan bool, goroutineCount) for i := 0; i < goroutineCount; i++ { go rwLockerTest(lockerObj, &succeedCo...
80406c83a55576d7f19b71f91ccbbbe9dea67da9
4b73bc86e74fe7bd869171428e0aaf3ce231f81d
stowelly/aws-sdk-go
/service/rekognition/rekognitioniface/interface.go
Go
go
4,654
permissive
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. // Package rekognitioniface provides an interface to enable mocking the Amazon Rekognition service client // for testing your code. // // It is important to note that this interface will have breaking changes // when the service model is updated and adds new API op...
dfae0dc95e1ce48e006aefe33fda91403e9f66ac
60f53a8fbcf5ebebb78b3b33c2ef43923e532100
simaotwx/caddy-auth-portal
/pkg/authn/handle_register.go
Go
go
8,505
permissive
// Copyright 2020 Paul Greenberg greenpau@outlook.com // // 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...
801ebb281e5bd48ecf87b153fbfeda26ac852147
d91234744c6bc36173af59c3d75b3a17abdf123f
moby/moby
/api/types/port.go
Go
go
543
permissive
package types // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command // Port An open port on a container // swagger:model Port type Port struct { // Host IP address that the container's port is mapped to IP string `json:"IP,omitempty"` ...
9d62209178368b5acea86ccf68436a7e76f2b2ad
eee6ccf40a16419ee334117f4f58acdfbe0bbdbe
JustinFullerNYT/swag
/examples/gin/main.go
Go
go
2,177
permissive
// Copyright 2017 Matt Ho // // 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,...
6736c6d7f5f02dc79f70c2c3411aeb86a43bb125
f8ec0f816903d658d26017cb01eda6b573047057
coontash/Fabric-Chinese
/common/graph/tree.go
Go
go
3,853
permissive
//此源码被清华学神尹成大魔王专业翻译分析并修改 //尹成QQ77025077 //尹成微信18510341407 //尹成所在QQ群721929980 //尹成邮箱 yinc13@mails.tsinghua.edu.cn //尹成毕业于清华大学,微软区块链领域全球最有价值专家 //https://mvp.microsoft.com/zh-cn/PublicProfile/4033620 /* 版权所有IBM公司。保留所有权利。 SPDX许可证标识符:Apache-2.0 **/ package graph //迭代器定义可用于遍历顶点的迭代器 //图的 type Iterator interface { //next返...
24f60238329b3257a8794b7698498a179f4ae832
7cf03154397a4e6e860860d79ee19d885daa402e
fossabot/gotgt
/pkg/scsi/backingstore.go
Go
go
5,052
permissive
/* Copyright 2017 The GoStor 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 agreed...
fbb40ccb83d6bed78cf511167be7552457a55a33
ce6fa3a15f0069d01b3ea0545ba9592ea376f62a
akansh97531/service-mesh-hub
/services/mesh-networking/pkg/federation/decider/federation_decider.go
Go
go
5,256
no_license
package decider import ( "context" "fmt" "github.com/solo-io/go-utils/contextutils" core_types "github.com/solo-io/service-mesh-hub/pkg/api/core.zephyr.solo.io/v1alpha1/types" networking_v1alpha1 "github.com/solo-io/service-mesh-hub/pkg/api/networking.zephyr.solo.io/v1alpha1" discovery_core "github.com/solo-io/...
55603463bde8c5be17cddb75f603ccf0b3dfb5bf
977b0641a39c0c9e1e9914c3ff25db03751d4ca8
lzbernardo/VantageSportsLoL
/lolobserver-master/vendor/github.com/VantageSports/users/client/util.go
Go
go
1,506
permissive
package client import ( "fmt" "golang.org/x/net/context" "google.golang.org/grpc/metadata" "github.com/VantageSports/users" ) // TokenContextKey is the context map key where the token string is stored. const tokenContextKey = "vstoken" type ErrAuthMissing struct { error } type ErrAuthInvalid struct { error ...
3cd0d55382d197f371dc8b4e0fa6365fad3a2be2
87eb46238365a731cd21659eca22c5c1085feaa9
apache/trafficcontrol
/tc-health-client/tmagent/parenthealth.go
Go
go
12,154
permissive
package tmagent /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the *...
0abe0ccf10246093edbe59e0986691e9a238f53a
572d1479c7bf35a4e8a2fc9ebf7086a7c37bdf5c
samscloud/go-livepeer
/cmd/livepeer_cli/wizard_bond.go
Go
go
8,755
permissive
package main import ( "encoding/json" "errors" "fmt" "io/ioutil" "math/big" "net/http" "net/url" "os" "strconv" "github.com/golang/glog" "github.com/ethereum/go-ethereum/common" lpcommon "github.com/livepeer/go-livepeer/common" "github.com/livepeer/go-livepeer/eth" lpTypes "github.com/livepeer/go-livep...
94b15eaf19e21f6b504eb4c707d786d1a62d7e37
bbaba5869e629106bc14fc00eeb49abc95f83634
gavinfish/kubernetes
/pkg/apis/policy/validation/validation_test.go
Go
go
38,132
permissive
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
4f2b97884f4efa4bb0107e19494272fa6fa0cda5
0c59ec3e45e31b9ae7faa3382d1c98be269b2967
chengxuncc/saber
/net.go
Go
go
1,000
no_license
package saber import ( "io" "net/http" ) func Curl(url string) *Compound { return Do().Curl(url) } func (c *Compound) Curl(url string) *Compound { return c.Next(func(cmd *Command) error { resp, err := c.Script.HttpClient.Get(url) if err != nil { return err } defer resp.Body.Close() _, err = io.Copy(...
dcd67f9c86e9fa21deb7cf3c126d9d032f582bad
f3f5a4b5532e86e4fd3ff40fef733468748e3741
chacha923/golearn
/algorithm/structure/queue.go
Go
go
757
no_license
package structure type IQueue[T any] interface { // 进队 Push(v T) // 出队 Pop() T // 队列长度 Len() int // 观察队头节点 Peek() T } // 用切片模拟一个普通的 FIFO 队列 // 下标 0 为队头,下标 len(data)-1 为队尾 type Queue[T any] struct { data []T } func NewQueue[T any]() *Queue[T] { return &Queue[T]{ data: make([]T, 0), } } func (q *Queue[T]...
35e7a631c853e0bf10149598b5635a4b30e7b67f
571b342769662144f9a7a9a0b3b0a6477596df67
barryz/goat
/context/context.go
Go
go
445
permissive
package context import "os" // Context represents a context of a process. type Context struct { Wd string Config *Config Interval int } // NewContext generates a Context and returns it. func NewContext(interval int) (*Context, error) { wd, err := os.Getwd() if err != nil { return nil, err } config, ...
2df7c0bc8d4d9c6a2d40d73c99f9db454957c146
f2eac9bab5d1396561441316bf96a26092a33c9d
nickramsay19/go-currency-converter
/main.go
Go
go
2,092
no_license
package main import ( "fmt" "os" "io/ioutil" "log" "strconv" ) type Currency struct { name string rate float32 } func main(){ // get arguments and check if valid args := os.Args[1:] if len(args) == 0 { log.Fatal("Failed: Please provide arguments. Use \"help\" to recieve helpful dialogue.") } else if ar...
a5cd3cc758e4fe60ebbc2f8132ca381b37435269
d7babe322ddcba741bd930de1d6ab528da3fd14e
bistuzx/onecloud
/pkg/mcclient/options/servers.go
Go
go
35,904
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...
690bd7823898fea99bf6e98ff4125d2004ccbd5e
35e6b37919eec197639987b2e4c051910d1fd90d
timescale/outflux
/internal/cli/connection_config.go
Go
go
336
permissive
package cli // ConnectionConfig holds all arguments required to establish a connection to an input and output db type ConnectionConfig struct { InputHost string InputDb string InputMeasures []string InputUser string InputPass string InputUnsafeHTTPS bool OutputDbConn...
3fa5b1ba420570d04bf374dd69fd29aac735bb78
0b5d23125f595d96a3eeb5e18c01b23d7bfeb1fb
renjuashokan/Ver-Loop
/datastore.go
Go
go
8,047
no_license
package main import ( "database/sql" "encoding/json" "fmt" "net/http" "os" "strings" "time" "github.com/fsnotify/fsnotify" _ "github.com/lib/pq" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/spf13/viper" ) func (instance *datastore) initDatastore() { log.Debug("initiating datastor...
2ef90cde0dda08edc60504bf498fa42ccd6e2264
83093a5571a1ad7f7db90a478d0ef42764173091
WilliamChang80/sea-apd
/mocks/usecase/merchant/merchant.go
Go
go
2,313
no_license
package merchant import ( "errors" "github.com/golang/mock/gomock" domain "github.com/williamchang80/sea-apd/domain/merchant" "github.com/williamchang80/sea-apd/dto/request/merchant" ) var ( emptyUpdateMerchantBalanceRequest = merchant.UpdateMerchantBalanceRequest{} emptyMerchantRequest ...
06022092eff308150fabaf0df0064ec312d7b54d
069c61fb57429bfce0c1845b1c0b63a068507f8e
potehinre/reform
/reform/log.go
Go
go
487
permissive
package main import ( "fmt" "log" "os" ) // Logger is our custom logger with Debugf method. type Logger struct { *log.Logger Debug bool } // NewLogger creates a new logger. func NewLogger() *Logger { return &Logger{ Logger: log.New(os.Stderr, "reform: ", 0), Debug: false, } } // Debugf prints message on...
1200556066b3937732ac6c33c36d86d8f7729c00
dd526ab8098bfaac950b07911fff2c52d5178ac1
kasvith/crossplane
/pkg/controller/azure/resourcegroup/resourcegroup_test.go
Go
go
22,021
permissive
/* Copyright 2018 The Crossplane 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, ...
0ce4c1a307b3800156300ed7cc763b7e83ea9fb3
8491c59881e8d9ff622b5f4e89c94824eac9d6c7
benjic/script
/ops/arithmetic_test.go
Go
go
14,836
permissive
package ops import ( "testing" ) func TestArithmeticOps(t *testing.T) { runOpTests(t, []opTests{ { "op1Add", op1Add, []opTest{ { "empty stack", config{}, opWant{ &stack{}, &stack{}, ErrInvalidStackOperation, }, }, { "adds 1 to number", config{st...
45426eb6b2d5226a4e2c77085e5c4da89e4d7193
fd0b0283b10cffdeecb0cdd7b2f227ea2f6c4dc8
MooooonStar/toychain
/core/keypair_test.go
Go
go
398
no_license
package core import ( "testing" "github.com/stretchr/testify/assert" ) func TestAddress(t *testing.T) { assert.False(t, ValidateAddress("1mvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2")) assert.True(t, ValidateAddress("1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2")) assert.True(t, ValidateAddress("3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"...
4cca2479508384220ae7c8806f0546840e407209
989dc347d5fe6ef1edd9174df9f92817cefeefae
zhiltsov/go-yandex-market-language
/parser/document_test.go
Go
go
2,631
no_license
package parser import ( "os" "reflect" "testing" "time" ) var ( offersTable = map[string]Offer{ "12341": { ID: "12341", Type: OffertTypeVendorModel, Available: true, Vendor: "НP", Model: "Color LaserJet 3000", URL: "http://magazin.ru/product_page.asp?pid=14344", Na...
d5c834d67ebd6ba7867eb79240004fd1ce5536c3
5e6052d3ef4c6155e0e473e9f25b5b06eda26b5d
fabian-z/gitea
/routers/user/setting_openid.go
Go
go
3,827
permissive
// Copyright 2017 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package user import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/auth" "code.gitea.io/gitea/modules/auth/openid" "code.gitea.io/gitea/mo...
902db02caed41d2644c89582afec1d0832d8eed6
b04fe3b9a223e27dd6a3077cc03fef6d3bdc4307
weslan97/golang-waitgroup-examples
/wait.go
Go
go
304
no_license
package main import ( "fmt" "sync" ) func facaAlgo(w *sync.WaitGroup) { fmt.Println(" Feito!") w.Done() } func main() { // OBS: Executar em um ambiente com vários núcleos de processamento var w sync.WaitGroup fmt.Println("Inicio") w.Add(1) go facaAlgo(&w) w.Wait() fmt.Println("Fim") }
dd737b2f71e65a6576858f16c809c1310149b1ad
c05b3a3fe0f1ab24da39739b6869a1909a105266
wickyyang/ann-go-sdk
/crypto/priv_key.go
Go
go
3,554
no_license
package crypto import ( "bytes" "fmt" "github.com/dappledger/AnnChain-go-sdk/ed25519" "github.com/dappledger/AnnChain-go-sdk/ed25519/extra25519" "github.com/dappledger/AnnChain-go-sdk/wire" ) const ( // A series of combination of ciphers // ZA includes ed25519,ecdsa,ripemd160,keccak256,secretbox CryptoTypeZh...
5cf80773814da13f0359c3108cd7823ae7cb9ec1
c0669c21f85c6cffdcec7c1b03ac58c2bdc2c136
tyuyu/go-wait-future
/work.go
Go
go
1,794
no_license
package future import ( "context" "fmt" "runtime" "sync" "time" ) type workgroup struct { wg sync.WaitGroup ctx context.Context limit chan struct{} } type Future struct { group *workgroup err error result interface{} cost time.Duration } func (f *Future) Cost() time.Duration { f.Wait() retu...
117c99f1657b2d95d834f06bfb8513aee76a2545
2a24efa8058c96af45bc5d61c8e95cbb9750d183
luiscvega/teetactoe.com.go
/models/user.go
Go
go
423
no_license
package models type User struct { Id int Email string FirstName string LastName string CryptedPassword string Campaigns []*Campaign } func (u *User) FullName() string { return u.FirstName + " " + u.LastName } //CREATE TABLE users //( //id SERIAL PRIMARY KEY, //email V...
db980a220aab1c6f15c09fb55acf74e69e12ecc2
726f35bb4a40f337792fb147793a33ffcaf1aad4
MyPureCloud/platform-client-sdk-go
/platformclientv2/gamificationscorecardchangetopicscorecardchange.go
Go
go
5,551
permissive
package platformclientv2 import ( "github.com/leekchan/timeutil" "reflect" "encoding/json" "strconv" "strings" ) // Gamificationscorecardchangetopicscorecardchange type Gamificationscorecardchangetopicscorecardchange struct { // SetFieldNames defines the list of fields to use for controlled JSON serialization ...
893973cc3df38544cc513d63e505f67f466bccb7
4c757ca8fb48e416e74dc4790d3ebe7d16a3df11
matthework/badgeapp
/tier.go
Go
go
2,156
no_license
package main import ( "fmt" // "time" "gopkg.in/mgo.v2/bson" ) type Tier struct { ID bson.ObjectId `json:"_id,omitempty" bson:"_id,omitempty"` Index int `json:"index" bson:"index"` Tier int `json:"tier" bson:"tier"` Grades []int `json:"grades" bson:"grades"` Judgement string `json:"judgement" bson:"ju...
844abea8a12b0923800557ffebda5b2205f4a09e
0429b33c4994cc04d9802e17df6ca1831f5cd54c
manuelpuyol/gotc
/miner/miner.go
Go
go
3,425
no_license
package miner /* #cgo LDFLAGS: -L${SRCDIR}/../ -lgpu #include<stdlib.h> u_int32_t cmine(const char *str, int difficulty, u_int32_t max); */ import "C" import ( "fmt" "gotc/blockchain" "gotc/constants" "gotc/hash" "gotc/merkle" "gotc/sync" "strconv" "sync/atomic" "unsafe" "github.com/gitchander/permutation...
40809066f2de0d44183907a41a0cbc00a5382ede
c21a435dd5a62e5abdbd0d5b3cf71e18f240e0d5
lcsol/lessonService
/oldVersion/handlers/lessonHandlers.go
Go
go
5,228
no_license
package handlers import ( "encoding/json" "log" "net/http" "time" "lessonService/models" "github.com/go-playground/validator" "github.com/gorilla/mux" ) // LessonHandler is a handler to handle CRUD requests for lessons type LessonHandler struct { infoLog *log.Logger errLog *log.Logger lessons *models.Les...
ac895a80a75b9be6ec3334c0bf637286f6b4dec3
172ad64193ca8b50f8022e53e0652882d56274ff
chrsan/shadow
/internal/f735.go
Go
go
990
permissive
package internal func f735(ctx *Context) { var l0 int32 _ = l0 var s0i32 int32 _ = s0i32 var s1i32 int32 _ = s1i32 var s2i32 int32 _ = s2i32 var s3i32 int32 _ = s3i32 s0i32 = 28784 s0i32 = int32(ctx.Mem[int(s0i32+0)]) l0 = s0i32 s1i32 = 2 if uint32(s0i32) > uint32(s1i32) { s0i32 = 1 } else { s0i32 ...
e8388bbc3b76f6314eadd587a73ee10c577f7d00
d23cdcd017c6936a0c4b5cba648b46c63ad9648b
aramrami/client-go
/pkg/client/client.go
Go
go
2,897
permissive
package client import ( "crypto/tls" "crypto/x509" "fmt" "io/ioutil" "github.com/falcosecurity/client-go/pkg/api/output" "github.com/falcosecurity/client-go/pkg/api/version" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) // Client is a wrapper for the gRPC connection // it allows to connect ...
30369e1ecad1337b04d8374e2161cdd6ec08cc89
0c6e6264752243ea62efa14a0e23e137cdf7623d
imaninja187/google-api-go-client
/siteverification/v1/siteverification-gen.go
Go
go
44,577
permissive
// Copyright 2021 Google LLC. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Code generated file. DO NOT EDIT. // Package siteverification provides access to the Google Site Verification API. // // For product documentation, see: https://developers.google.co...
74c2bc44f6f44c1a981610687e410aecdedd78e6
463b9db3eaf3421ce70393f483e91696ed0beb70
ent-framework/revel
/cmd/revel/gensource.go
Go
go
1,047
permissive
// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved. // Revel Framework source code and usage is governed by a MIT style // license that can be found in the LICENSE file. package main import ( "fmt" "os" "github.com/dancewing/revel" "github.com/dancewing/revel/cmd/harness" ) var cmdGenso...
077f35a682cd3cfe43c4925a0939f5774e37b569
3acfbe0a395fed40fcb2792892ae1cc1f54b3ed6
EZLippi/mosn
/test/integrate/common_test.go
Go
go
4,731
permissive
package integrate import ( "testing" "time" "mosn.io/mosn/pkg/protocol" _ "mosn.io/mosn/pkg/protocol/http/conv" _ "mosn.io/mosn/pkg/protocol/http2/conv" _ "mosn.io/mosn/pkg/protocol/rpc/sofarpc/codec" _ "mosn.io/mosn/pkg/protocol/rpc/sofarpc/conv" _ "mosn.io/mosn/pkg/stream/http" _ "mosn.io/mosn/pkg/stream/h...
a2fe6d63ece7fdcb4604eeefe9bd5bfee32ef227
b5c7e3207e0c669937f1d18b484320b8edf7fd04
YotpoLtd/libra
/backend/backend.go
Go
go
3,667
permissive
package backend import ( "fmt" "os" log "github.com/sirupsen/logrus" "github.com/YotpoLtd/libra/config" "github.com/YotpoLtd/libra/structs" ) // ConfiguredBackends struct type ConfiguredBackends map[string]structs.Backender // InitializeBackends loads valid backends into a map func InitializeBackends(backends...
024067a119feb4dbcc358dfc27c7f38d4eba53aa
4ac9cc9f3680c5be8c3f52bf70a33f3bd1c79814
anfernee/antrea
/test/e2e/service_test.go
Go
go
6,740
permissive
// Copyright 2021 Antrea Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
45e0201a0121bc6a2d45dda9d31c19188b222777
14c52a78e0b21a399da4c6b8f21b40a802cba55e
pjchender/go-mailer-sandbox
/cipher/cipher.go
Go
go
2,183
no_license
package cipher import ( "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/hex" "fmt" "io" ) // https://www.melvinvivas.com/how-to-encrypt-and-decrypt-data-using-aes/ func GenerateKey() string { bytes := make([]byte, 32) //generate a random 32 byte key for AES-256 if _, err := rand.Read(bytes); err != nil ...
434aa6aebc0aaf27a0880523380f33d7c9f400ea
62b6420fa9d33e8a8561dc51eec0859f895c6964
hibooboo2/hopwatch
/hopwatch_test.go
Go
go
563
permissive
// Copyright 2012 Ernest Micklei. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package hopwatch import ( "log" "testing" ) func TestWatchpoint_Caller(t *testing.T) { go shortCircuit(commandResume()) CallerOffset(2).Break() } func co...
83a623fc689ebd51e2742d1731eef4bd52023f19
ef0484685fe7a2af573a3b622a3d36aeed2f4834
sabrinaj206/magma
/orc8r/cloud/go/pluginimpl/plugin.go
Go
go
5,412
permissive
/* Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. */ package pluginimpl import ( obsidianh "magma/orc8r/cloud/go/obsidian/handlers" "magma/orc8r/cloud/go/obsidian/han...
5ee6a2efcd1330a315cbd4252e75d5f9e53cc8c3
0afd32fe457d31906cc5edae448d193f03748769
flylzj/leetcode
/2018-12-27.go
Go
go
1,784
no_license
package main import "fmt" //给出两个 非空 的链表用来表示两个非负的整数。其中,它们各自的位数是按照 逆序 的方式存储的,并且它们的每个节点只能存储 一位 数字。 // //如果,我们将这两个数相加起来,则会返回一个新的链表来表示它们的和。 // //您可以假设除了数字 0 之外,这两个数都不会以 0 开头。 // //示例: // //输入:(2 -> 4 -> 3) + (5 -> 6 -> 4) //输出:7 -> 0 -> 8 //原因:342 + 465 = 807 //type ListNode struct { // Val int // Next *ListNod...
5bd7c14400565752efeadd245dd844c3c6929d0b
ab487f1bb2d3c9621bc0343f956b22eca7b953c5
xxxllluuu/kubernetes
/pkg/scheduler/scheduler.go
Go
go
31,440
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, ...
68d703352ee9019c0cc1a18a854b906f996574a7
c3b8351fcdafdc85db3540199d397360e981a2af
kriskowal/gg
/internal/gg/cmdwrite.go
Go
go
1,189
permissive
// Copyright (c) 2018 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 ...
92d131a11b9ca1b35147f7c7738cecb2511f0501
fd4ef10e004856f52727b04626054ce9b0878ff6
yaegashi/aadsync
/app_sp.go
Go
go
1,767
permissive
package main import ( "context" "fmt" "github.com/spf13/cobra" cmder "github.com/yaegashi/cobra-cmder" msgraph "github.com/yaegashi/msgraph.go/beta" V "github.com/yaegashi/msgraph.go/val" ) type AppSP struct { *App SpID string ServicePrincipalList []msgraph.ServicePrincipal ServicePrincipal...
544dcfd4004da8764f60c0a39e69ad8ec5dddf61
524e4992afb9d9c8941b876ee6683f47c389aecf
CanDIG/beacon
/candig-client/model_ga4gh_search_rna_quantification_sets_response.go
Go
go
3,848
no_license
/* * CanDIG Services * * Below is a list of APIs that CanDIG currently supports.<br/><br/>For /search and /count endpoints, refer to [this documentation](https://www.distributedgenomics.ca/static/search_count_services_usage.pdf) for instructions and sample queries.<br/>For all metadata and variant services endpoints...
81075cbb0e840ad24fabe96f2f8ab3daf53a6897
39aa806e31fddd70fd739c0773c25876803f7d04
pfnet-research/node-operation-controller
/api/v1alpha1/groupversion_info.go
Go
go
1,244
permissive
/* Copyright 2021. 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 un...
f47f9c121b0abc2f1fcd6fc7972a357f46c79ad6
40d1909ecb4903b80c86208afcc33a1463c9e33a
sutcalag/milvus
/internal/datacoord/server.go
Go
go
19,765
permissive
// Copyright (C) 2019-2020 Zilliz. 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 l...
51ddcfd3a70e0d33acdcb64ea6feed901deef851
583b661d8515df37ab22c343549e9a9ca1c0bf17
ottotech/paginate
/paginate_test.go
Go
go
9,515
permissive
package paginate import ( "fmt" "log" "net/url" "testing" ) func ExampleNewPaginator_1() { type Application struct { ID int `paginate:"id;col=id"` System string `paginate:"filter"` } opt := TableName("test") app := Application{} u, err := url.Parse("http://ottotech.com?system=platform") if err !=...
b11b10eebb518e31fb7ac55dbc99fccc0b3b097f
9760a090e62a03662b0cbba6429bc5f729c988b2
huaweicloud/huaweicloud-sdk-go-v3
/services/workspaceapp/v1/model/model_persistent_storage.go
Go
go
863
permissive
package model import ( "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/sdktime" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils" "strings" ) // PersistentStorage WKS存储 type PersistentStorage struct { // WKS存储ID Id *string `json:"id,omitempty"` // 名称 Name *string `json:"name,omitempty"` Storage...
a531c06d95012d0a9053e0b8611d583495f10164
ed71f77ece7a1e685098945879779e3d228e76fb
sjones512/ktunnel
/pkg/k8s/injector.go
Go
go
2,667
permissive
package k8s import ( "context" "errors" "fmt" log "github.com/sirupsen/logrus" appsv1 "k8s.io/api/apps/v1" apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func injectToDeployment(o *appsv1.Deployment, c *apiv1.Container, image string, readyChan chan<- bool) (bool, error) { if hasSi...
d44d2e30a5e54eb5deacf328e63c625c5c66d56a
debe499db50c0a0722c0a5024bf26c56ab04489a
Efrat19/go-exercises
/todo/main.go
Go
go
670
permissive
/* Copyright © 2019 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
6b655860a09cba3503d93afb1aa119bcfc274696
e27caa307e6cda1831ebcc55901eeffd4e48bd03
kubevirt/kubevirt-template-validator
/pkg/validation/specialized.go
Go
go
9,973
permissive
/* * This file is part of the KubeVirt project * * 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 la...
432ce6964531aa413a130840aa36f43dcdb3c27f
7ab6fb0421f54f03502ff534f3724a3258772ee3
lilith44/storage
/storage.go
Go
go
271
no_license
package storage import `github.com/storezhang/pangu` func newStorage(config *pangu.Config) (disk *Disk, err error) { panguConfig := new(panguConfig) if err = config.Load(panguConfig); nil != err { return } disk = &Disk{ Config: panguConfig.Disk, } return }
78d60b1110ec29a0d400906a8c311b037e0cd76f
4ff2d5e5e22ecdbfe8ea879cb3d2c83f9cff7379
makkes/kudo
/pkg/kudoctl/cmd/init.go
Go
go
7,977
permissive
package cmd import ( "errors" "fmt" "io" "strings" "github.com/kudobuilder/kudo/pkg/kudoctl/clog" cmdInit "github.com/kudobuilder/kudo/pkg/kudoctl/cmd/init" "github.com/kudobuilder/kudo/pkg/kudoctl/kube" "github.com/kudobuilder/kudo/pkg/kudoctl/kudohome" "github.com/kudobuilder/kudo/pkg/kudoctl/util/repo" ...
f7e39d30c8b3bc703ad388f8c7108ed08d30fd49
1a5e0177a14225cef5f54ef20c9a31aef2e5ae7e
vmmgr/node-v2
/cmd/start.go
Go
go
440
no_license
package cmd import ( "github.com/vmmgr/node/data" "github.com/vmmgr/node/vm" "log" "github.com/spf13/cobra" ) var startCmd = &cobra.Command{ Use: "start", Short: "start client server", Long: ``, Run: func(cmd *cobra.Command, args []string) { if err := vm.StartUPVM(); err != nil { log.Println("Error: ...
71858c54c4f0d1a41cc032c83ad36c371c373813
365b9e6cc720260a6618695f18eeded49fb43991
banzaicloud/pipeline
/src/auth/util.go
Go
go
2,066
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 ...
74f85b9fb80d0652c0f963f2c5e730583c845a37
c100260a7f990e92881c0cd616aeb525d558833e
rpcxio/rpcx-examples
/101basic/client/async/client_async.go
Go
go
800
permissive
package main import ( "context" "flag" "log" example "github.com/rpcxio/rpcx-examples" "github.com/smallnest/rpcx/client" ) var ( addr2 = flag.String("addr", "localhost:8972", "server address") ) func main() { flag.Parse() d, _ := client.NewPeer2PeerDiscovery("tcp@"+*addr2, "") xclient := client.NewXClien...
b20af6f6b795a7ceaf9f423a27040de214fbdd16
22c89789bd249402207309b41f34d1fc7ef40373
cedric-cordenier/goformation
/cloudformation/wafv2/aws-wafv2-webacl_ipsetreferencestatement.go
Go
go
1,620
permissive
package wafv2 import ( "github.com/awslabs/goformation/v4/cloudformation/policies" ) // WebACL_IPSetReferenceStatement AWS CloudFormation Resource (AWS::WAFv2::WebACL.IPSetReferenceStatement) // See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ipsetreferencestatement.htm...