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 |
|---|---|---|---|---|---|---|---|---|
515bb21b675653ebfa301d0e6a5b792854734b51 | 23f491237322e737efa6054b612c28721e01b470 | gberche-orange/cli | /actor/v7action/space_test.go | Go | go | 29,448 | permissive | package v7action_test
import (
"errors"
"code.cloudfoundry.org/cli/actor/actionerror"
. "code.cloudfoundry.org/cli/actor/v7action"
"code.cloudfoundry.org/cli/actor/v7action/v7actionfakes"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccerror"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv3"
"code.cloudfou... |
7174645a046d7dde2c6afca5dcba3587b643a431 | 8f90a62d0aff60951aaa0937c5c4d13a05489dfa | liborio7/npong | /component/motion.go | Go | go | 431 | no_license | package component
const MotionSignature = 1 << MOTION
type Motion struct {
// UseGravity bool ?
SpeedX *MotionSpeed
SpeedY *MotionSpeed
AccelerationX *MotionAcceleration
AccelerationY *MotionAcceleration
}
type MotionSpeed struct {
Max, Min, Value float64
}
type MotionAccelerat... |
08dd2132ea94160d1c94966b661cb2d84f2bfe5f | 3a87cdecb30d80182d7c8ffd965dbfdd19fcc36f | shiyufeng0919/goLang | /src/data/文本处理/file.go | Go | go | 1,123 | no_license | package 文本处理
import (
"os"
"fmt"
)
/*
文件操作:生成文件目录,文件(夹)编辑等操作
os包
*/
func FileDemo1() {
os.Mkdir("dir1",0777) //创建dir1目录,权限0777
os.Mkdir("dir11/dir2/dir3",0777)//根据path创建多级子目录,权限0777
err:=os.Remove("dir1") //移除目录
if err !=nil{
fmt.Println(err)
}
os.RemoveAll("dir11") //移除dir11目录包下的所有子目录
}
//文件操作--建立与打开文件... |
330deb85ccec82004314eabc9a51445524ee5515 | 509210885623dce98756a8ef35ef206dbc3a939e | YWak/atcoder | /submissions/2022/03/16/agc017a/main.go | Go | go | 9,667 | permissive | //lint:file-ignore U1000 using template
package main
import (
"bufio"
"fmt"
"io"
"math"
"math/bits"
"os"
"sort"
"strconv"
"strings"
)
// INF18 は最大値を表す数
const INF18 = int(1e18)
// INF9 は最大値を表す数
const INF9 = int(1e9)
var in *In
var out *Out
func calc() {
n, p := in.NextInt2()
dp := make([]int, 2)
dp1 := ... |
1bbbc53c1e5bd612c5f64dac3a0e1aeba3cc35e0 | 3163e9711f5753ba0882d8a5c7360f31731b95a5 | henriqueholanda/photoprism | /internal/workers/sync_test.go | Go | go | 257 | permissive | package workers
import (
"testing"
"github.com/photoprism/photoprism/internal/config"
"github.com/stretchr/testify/assert"
)
func TestNewSync(t *testing.T) {
conf := config.TestConfig()
worker := NewSync(conf)
assert.IsType(t, &Sync{}, worker)
}
|
ca814ad1d0199975424b524c11ca0fceea5c0eb7 | 8f23b7e6cf8d93e152cc790372cd396ddcc92d3a | accaolei/gotools | /menus_true.go | Go | go | 6,657 | no_license | package gotools
import "sort"
// Tree 统一定义菜单树的数据结构,也可以自定义添加其他字段
type Tree struct {
Title string `json:"title"` //节点名字
Data interface{} `json:"data"` //自定义对象
Leaf bool `json:"leaf"` //叶子节点
Selected bool `json:"checked"` ... |
39fc8d2cd80de852828e16ca6b2817ff5f04a1a3 | 9f72f2e3dc61b8d04090c5a6b452f5d07e695f0f | unixpickle/cudnn | /conversions.go | Go | go | 232 | no_license | package cudnn
import "C"
func safeIntToC(x int) C.int {
if x > int(C.int(^C.uint(0)/2)) {
panic("int value out of bounds")
} else if x < int((-C.int(^C.uint(0)/2))-1) {
panic("int value out of bounds")
}
return C.int(x)
}
|
b58134f9640399fc184eec1cdd97d01922ee2eb5 | a0e9722bff075057b6053a952cad1fd55b092dca | KasterZhang/go-playground | /leetcode/no_m_1024.go | Go | go | 836 | no_license | package leetcode
func videoStitching1024(clips [][]int, T int) int {
step, start, end := 0, 0, T
if T == 0 {
return 0
}
if len(clips) == 0 {
return -1
}
for start < end {
// fmt.Printf("--------- start %d end %d ----------",start, end)
ts, te, k, j := 0, 0, -1, -1
for i, clip := range clips {
if cli... |
f7f01a249830fc0fd565167f2f904b1ba995a08f | 7940c9b87222dca9d2e5f9298c11574856aed916 | prashantv/m3 | /src/dbnode/storage/database_test.go | Go | go | 32,132 | 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... |
403f045561aebe45244f47245b34109bc6e26c9b | de7cd1cb93c8d377f31ec813cb7f7c926b27328d | codenotary/immudb | /test/document_storage_tests/documents_tests/models/search.go | Go | go | 1,233 | permissive | /*
Copyright 2023 Codenotary Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... |
e98e61b3a36afde279f9d7df04746c7f31f8e753 | cfa9656ac9818b72cfe071ec85d0467410eb3b28 | niranvv/istio | /pilot/pkg/serviceregistry/kube/controller/controller.go | Go | go | 45,629 | permissive | // Copyright Istio 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 wri... |
ced07ac3160f92d4725dc46a26dd6bf50e8d05e8 | 9bbd4b9a4cf3adfc6d9887b93b29e90736f6650f | tsandall/automate | /components/config-mgmt-service/params/parameters_test.go | Go | go | 3,098 | permissive | //
// Author:: Salim Afiune <afiune@chef.io>
// Copyright:: Copyright 2017, Chef Software Inc.
//
// This new file is extending the `rest` package so that we can
// test the its private methods, if the functionality you are
// trying to test is not private it shouldn't be here
package params_test
import (
"fmt"
"... |
6c6fad57660a49b65e511a0a0b819a181d5a2653 | 1ef27d393fa1be2d4181b44a32221aae624afea7 | timidri/washhub | /cmd/root.go | Go | go | 2,358 | 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 ... |
e5cf79047006cc164107849c8e047d4d858c2b59 | 2775fe5aecb60fe64570cb34dacffcf74d066bb2 | seregant/cockroach-test | /controllers/divisi.go | Go | go | 1,815 | permissive | package controllers
import (
"fmt"
gin "github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"github.com/seregant/cockroach-test/database"
"github.com/seregant/cockroach-test/hash"
"github.com/seregant/cockroach-test/structs"
)
type Divisi struct{}
func (w *Divisi) GetAllDivisi(c *gin.Context) {
var arr_divisi... |
456cf8028efa8fab8b2a1ce7b03168e315caa078 | 1986868ccebf0f917e462ef624bada1224348d04 | andrei-x1/elastic-indexer-go | /mock/databaseWriterStub.go | Go | go | 1,890 | no_license | package mock
import (
"bytes"
"github.com/elastic/go-elasticsearch/v7/esapi"
)
// DatabaseWriterStub -
type DatabaseWriterStub struct {
DoRequestCalled func(req *esapi.IndexRequest) error
DoBulkRequestCalled func(buff *bytes.Buffer, index string) error
DoBulkRemoveCalled func(index string, hashes []string)... |
8c9ca21b4d413a9ec88fc9295b354a61887f479a | 97267187d71967c21698ca02a6cf7a43266e3aec | wyfaq/janus | /pkg/proxy/definition.go | Go | go | 1,901 | permissive | package proxy
import (
"encoding/json"
"strings"
log "github.com/Sirupsen/logrus"
"github.com/hellofresh/janus/pkg/router"
)
// Route is the container for a proxy and it's handlers
type Route struct {
proxy *Definition
handlers []router.Constructor
}
type routeJSONProxy struct {
Proxy *Definition `json:"p... |
64d8ac7a4a584dd54511b705c3e1a295cfd346a6 | d5cd39260a1dd46977cd2b00d388d29215ddb94d | klferreira/events-rest-api | /api/server.go | Go | go | 808 | no_license | package api
import (
"net/http"
"github.com/gorilla/mux"
"github.com/klferreira/events-rest-api/api/handler"
"github.com/klferreira/events-rest-api/internal/event"
"github.com/klferreira/events-rest-api/pkg/mongo"
)
type Server struct {
db mongo.Client
router *mux.Router
}
type Config struct {
DatabaseU... |
27aad7128ea2181b5c19474a939b407f03f7914d | 4a8d6d79b4350ae0b7b79b0b8fd40e3059470a7e | Web3verse/bcdhub | /cmd/metrics/bigmapdiff.go | Go | go | 2,067 | permissive | package main
import (
"sync"
contractHandlers "github.com/baking-bad/bcdhub/internal/handlers"
"github.com/baking-bad/bcdhub/internal/metrics"
"github.com/baking-bad/bcdhub/internal/models"
"github.com/baking-bad/bcdhub/internal/models/bigmapdiff"
"github.com/pkg/errors"
)
var bigMapDiffHandlers = []contractHa... |
3145d60e494c07a1ec8eac7ce17982f86e7dd9a9 | 11db6a3dc2225a1121066956fe0ac7320573d9b2 | David-Elizondo/istio | /pilot/pkg/serviceregistry/kube/controller/endpoints.go | Go | go | 7,324 | permissive | // Copyright 2017 Istio 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 i... |
07dff2bcb4d746f96d1ac4535b5f1cecfe634e37 | da6d896d3d12054e1314a2f7911af8f584b5516a | ishan-marikar/koding | /go/src/vendor/github.com/mitchellh/packer/builder/googlecompute/step_wait_instance_startup_test.go | Go | go | 1,119 | permissive | package googlecompute
import (
"github.com/mitchellh/multistep"
"testing"
)
func TestStepWaitInstanceStartup(t *testing.T) {
state := testState(t)
step := new(StepWaitInstanceStartup)
config := state.Get("config").(*Config)
driver := state.Get("driver").(*DriverMock)
testZone := "test-zone"
testInstanceName... |
167f34d52d0163bb525fce2119e21d8ee94d8144 | 564e28d802dc66bdcfb363be760c9f44d284db4a | TrueNewBee/goDemo | /day02/09slice_append/main.go | Go | go | 753 | no_license | package main
import "fmt"
// append() 为切片追加元素
func main() {
s1 := []string{"北京", "上海", "深圳"}
fmt.Printf("s1=%v len(s1)=%d cap(s1)=%d\n", s1, len(s1), cap(s1))
// s1[3] = "广州" // 错误的写法,索引会导致编译错误:索引越界
// fmt.Println(s1)
// 调用append函数必须用原来的切片变量接收返回值
// append追加元素,原来的底层数组放不下收,Go底层就会把底层数组换一个
// 必须用变量接收append的返回值
... |
5c7a5c438d128a6164ecc5f858cbd230e1a165ce | ee5064b7da2cea76c8e736a8be71660a2aa2b04f | edwin-jones/gosort | /main.go | Go | go | 1,159 | permissive | package main
import (
"flag"
"fmt"
"log"
"strconv"
"strings"
"github.com/edwin-jones/gosort/algorithm"
)
type Sorter interface {
Sort(data []int)
}
func main() {
var selectedAlgorithm string
var rawData string
var sorter Sorter
flag.StringVar(&selectedAlgorithm, "algorithm", "bubble", "the sorting algo... |
0d532bc8d0bc744864ffa1f2b952a66060047765 | 3cd3a93bd0dc659a4a24a1696e80e5296848192d | superiqbal7/go-practice | /packages/utility/heheh.go | Go | go | 273 | no_license | package utility
// Hello hi
// a custom func to learn how to create package
func Hello() string {
return "hello from utility"
}
// Adder hi
// a custom func to learn how to create package
func Adder(args ...int) (sum int) {
for i := range args {
sum += i
}
return
}
|
4130d04366b4e032c01c3ab5dd8e154f55f446cf | 250329f8a8835c0d3afaa21fe951a18b2cc99c45 | vmlemon/eve | /pkg/newlog/vendor/github.com/lf-edge/eve/pkg/pillar/types/zedagenttypes.go | Go | go | 16,347 | permissive | // Copyright (c) 2017 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package types
import (
"fmt"
"strings"
"time"
"github.com/google/go-cmp/cmp"
"github.com/lf-edge/eve/pkg/pillar/base"
"github.com/satori/go.uuid"
)
// This is what we assume will come from the ZedControl for base OS.
// Note that we can... |
00c370d1e392f515074272646dcbb6830abaf5f2 | 57b15a7ee625fcac238020b1cd4244b39945cba4 | phpyandong/opentaobao | /model/flight/BookFlightVo.go | Go | go | 642 | permissive | package flight
// BookFlightVo
type BookFlightVo struct {
// 到达机场三字码
ArrAirport string `json:"arr_airport,omitempty" xml:"arr_airport,omitempty"`
// 出发机场三字码
DepAirport string `json:"dep_airport,omitempty" xml:"dep_airport,omitempty"`
// 出发时间
DepTime string `js... |
5feaa8a1f7f2909003a920334eef5b3ddafc38bf | 389c23981048958154a30462d037aa9c5d265aaf | chuan717/PPGO_JOB | /controllers/common.go | Go | go | 9,664 | no_license | /**********************************************
** @Des: base controller
** @Author: haodaquan
** @Date: 2017-09-07 16:54:40
** @Last Modified by: haodaquan
** @Last Modified time: 2017-09-18 10:28:01
***********************************************/
package controllers
import (
"github.com/astaxie/beego"
"github... |
ba3eb4dcd5c04ba22fa76960fbe9a3dd41c336b6 | 62ecaaafe491ae097aebf2c846316338d5f89ccc | AzisHop/2021_1_BERM-1 | /postservice/internal/app/models/order.go | Go | go | 838 | no_license | package models
type Order struct {
ID uint64 `json:"id,omitempty" db:"id"`
OrderName string `json:"order_name,omitempty" db:"order_name"`
CustomerID uint64 `json:"customer_id,omitempty" db:"customer_id"`
ExecutorID uint64 `json:"executor_id,omitempty" db:"executor_id"`
Budget uint64 `json:"budge... |
4324d5cfd73c589dab0b3f37f18640d1698c2ac2 | 056073ca335cf3b2e7a9972da6b343f583a75f0d | nya3jp/tast-tests | /src/chromiumos/tast/local/bundles/cros/camera/hdrnet_e2e.go | Go | go | 6,967 | permissive | // Copyright 2021 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package camera
import (
"context"
"os"
"time"
"chromiumos/tast/common/media/caps"
"chromiumos/tast/errors"
"chromiumos/tast/local/camera/cca"
"chromiumos/tast/local/... |
6d8f8d894f0999956978aceeceec2983f1c0fa89 | 83c8dd34376bfcb77d41ab022ca7c3df60fb1f30 | sgtest/monorepo-test-3 | /kubernetes-13/pkg/apis/settings/v1alpha1/doc.go | Go | go | 899 | 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, ... |
aaa5a49592dc90f16c080dc04c8b7fdc713f5eb3 | f8104b66854811e97e588b8a48c30b7668e7ae8a | deadkrolik/phargo | /signature.go | Go | go | 2,119 | permissive | package phargo
import (
"bytes"
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"encoding/binary"
"errors"
"hash"
"io"
"os"
)
type signature struct {
options Options
}
// http://php.net/manual/en/phar.fileformat.signature.php
func (s *signature) check(filename string) error {
file, _ := os.Ope... |
496737ee59d0becc6882a8ce845c163fbcdcc05b | 3439f499bb60d56eabef11a1a0762c6d793ab35e | kprd/kapacitor | /task.go | Go | go | 12,750 | permissive | package kapacitor
import (
"bytes"
"errors"
"fmt"
"math/rand"
"sync"
"time"
"github.com/influxdata/kapacitor/edge"
"github.com/influxdata/kapacitor/keyvalue"
"github.com/influxdata/kapacitor/pipeline"
)
type TaskDiagnostic interface {
WithNodeContext(node string) NodeDiagnostic
Error(msg string, err erro... |
aa51298c886de0a75dbaa72c15be77e01d9439e7 | ea68834bd48ee75f4c34b450fdaae88a0733ba8b | NikolayS/ds-deployer | /internal/controller/deployment_logs.go | Go | go | 2,115 | no_license | package controller
import (
"errors"
"io"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
deployer_v1 "github.com/dotmesh-io/ds-deployer/apis/deployer/v1"
)
var (
ErrDeploymentNotFound = errors.New("deployment not found")
)
func (c *Contr... |
d5027a09f3d91c1f40c86c6c01fdfed577b52914 | 39620c06d71044bbda9fc0b7fe0fec3716034adb | 0x27/coyim | /session/logger.go | Go | go | 268 | permissive | package session
import (
"io"
"log"
"os"
)
type logger struct {
*log.Logger
}
func newLogger() io.Writer {
return &logger{
log.New(os.Stderr, "", log.LstdFlags),
}
}
func (l *logger) Write(m []byte) (int, error) {
l.Print(string(m))
return len(m), nil
}
|
3177b8fb3303fdc21a814be480f86bb362326482 | 116bcf0e2c9cc40378bcebbc71c1f99bf8676374 | nasa9084/go-isbn | /isbn.go | Go | go | 3,857 | permissive | // Package isbn is a package for parsing, updating, validating International Standard Book Number code.
package isbn
import (
"strconv"
"strings"
)
// ISBN represents a parsed ISBN code.
type ISBN struct {
// a prefix element for 13-digit ISBN which is a GS1 prefix (978 or 979)
Prefix string
// RegistrationGroup... |
06e6cafe49c4500148ab85a4be5b430118685beb | a49a7ce69e33f4f60d0634ef61f219b90a742aae | olejk/heis | /fakedriver/driver.go | Go | go | 3,584 | no_license | package fakeDriver
import (
"fmt"
"time"
)
const (
N_FLOORS=4
Up = 1
Down = -1
Stop = 0
On = 1
Off = 0
Command = 2
)
func HwInit() int {
fmt.Printf("initalizing hw\n")
return 1
}
func GetFloorSensorSignal() int {
return -1
}
func GetObstructionSignal() int {
return 0
}
func GetStopSignal()... |
53484675ebec3addde7ccf35f473ef38dba6dfca | 0ff0d5c1e1bd51d773e05ecf3964868b8e9ad3b0 | adityak368/swissknife | /response/result.go | Go | go | 636 | permissive | package response
// Result Defines a internal function result
type Result interface {
Data() interface{}
ToMessage() *Message
}
// ExecResult defines an internal function result
type ExecResult struct {
Result interface{}
MessageID string
MessageArgs []interface{}
}
// Data implements the ... |
c5803fba6d8a126756a4216c69c19940d3681470 | 2e21519ec6f11a8d97679467a6b2455c0cfa2a1e | huaweicloud/huaweicloud-sdk-go-v3 | /services/dns/v2/model/model_list_private_zones_response.go | Go | go | 635 | permissive | package model
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
"strings"
)
// ListPrivateZonesResponse Response Object
type ListPrivateZonesResponse struct {
Links *PageLink `json:"links,omitempty"`
Metadata *Metadata `json:"metadata,omitempty"`
// zone列表信息。
Zones *[]PrivateZoneRes... |
565c4bd92eda1bf1ec906c0640bc4163e11e0d1b | 6dcac2042a5742735e99da9bf382d3d5af9c30cb | michaelandrepearce/kubemq-targets | /examples/azure/storage/files/main.go | Go | go | 1,787 | permissive | package main
import (
"context"
"fmt"
"github.com/kubemq-io/kubemq-targets/pkg/uuid"
"github.com/kubemq-io/kubemq-targets/types"
"github.com/kubemq-io/kubemq-go"
"io/ioutil"
"log"
"time"
)
func main() {
client, err := kubemq.NewClient(context.Background(),
kubemq.WithAddress("kubemq-cluster", 50000),
kub... |
308a53d81c1bd2d3993ad94bf01a1b881a020e8c | ec70b6aedbc17e74581223ab3bdf14db25e6e33c | jopbrown/gtk-sugar | /lib/gtk/widget.gtk3.go | Go | go | 901 | permissive | package gtk
import "github.com/jopbrown/gtk-sugar/lib/gdk"
// FUNCTION_NAME = gtk_widget_override_background_color, NONE, NONE, 3, WIDGET, INT, WIDGET
func (w *Widget) OverrideBackgroundColor(state StateType, color *gdk.RGBA) {
w.Candy().Guify("gtk_widget_override_background_color", w, state, color)
}
// FUNCTION_N... |
80de70742e3869bc6bdc284ebb0f3d655b5f7446 | 70289c09f87017ca341e9d56dd713333fd9cb928 | everyside/resin-supervisor | /gosuper/gosuper/main_test.go | Go | go | 2,534 | permissive | package main
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"strings"
"testing"
)
var purgeTests = []struct {
JsonInput string
AppId string
JsonResponse string
IsSuccess bool
HttpStatus int
}{
{`{"applicationId": "1"}`, "1", `{"Data":"OK","Error":""}`, true, http.StatusOK},
{`{"a... |
888c602d5993f223aea9d3ffc8b8b5e2e13e2eb0 | c5e1f2def4a7c7622c5cac636c700e671f2ca936 | laopeng2021/milvus | /internal/rootcoord/root_coord.go | Go | go | 66,880 | 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... |
adcc8b4273d1a13ac4cf1ed16cea549f02f4c806 | f1b10f810952aaf5699e301b5136d51ee17050d9 | subscreasy/subscreasy-go-client | /offer.go | Go | go | 572 | no_license | /*
* Api Documentation
*
* Api Documentation
*
* API version: 1.0
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package swagger
type Offer struct {
Company *Company `json:"company"`
Id int64 `json:"id,omitempty"`
Name string `json:"name"`
OpenEnded bool `json:"... |
0be3a9744d433d7a09c38bc137e1df549b8e1001 | fc45992bae8696012f88129b0f6cec424a63ed58 | Magestro/bitshares | /operations/witnesscreateoperation.go | Go | go | 1,441 | permissive | package operations
//go:generate ffjson $GOFILE
import (
"github.com/denkhaus/bitshares/types"
"github.com/denkhaus/bitshares/util"
"github.com/juju/errors"
)
func init() {
types.OperationMap[types.OperationTypeWitnessCreate] = func() types.Operation {
op := &WitnessCreateOperation{}
return op
}
}
type Wit... |
721ba307e8b419b6d4364d7afb94bcc2a64a8081 | 8b631e9dbb8768b5a3c69d2f2a6dc4e17edcf220 | zhglin/go-chassis | /core/match/match.go | Go | go | 3,602 | permissive | /*
* 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 "License"); you may ... |
293edfc4c83c64ecb2531fa0d8e1128a57fd2d6a | 40379690b0dd56209584f2077399d9085188c010 | coolsvc/pulumi | /pkg/backend/httpstate/state.go | Go | go | 14,203 | permissive | // Copyright 2016-2018, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
7e43803b9e2be0105a30526c507cbc0f293780f7 | 7ddf068e89c24b1048aee3a1c93ef06560f6aecd | huaweicloud/huaweicloud-sdk-go-v3 | /services/cloudrtc/v2/model/model_stop_individual_stream_job_request.go | Go | go | 880 | permissive | package model
import (
"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
"strings"
)
// StopIndividualStreamJobRequest Request Object
type StopIndividualStreamJobRequest struct {
// 使用AK/SK方式认证时必选,携带的鉴权信息。
Authorization *string `json:"Authorization,omitempty"`
// 使用AK/SK方式认证时必选,请求的发生时间。
XSdkDate *str... |
eef8a0b4b0305e938a7d439db5a43382cd4a9fc7 | e2ee362bcc2c26ab38f0d1025bdfb1696f9bc707 | rchamorro/pulumi-azure-nextgen | /sdk/go/azure/dbformysql/v20180601privatepreview/getPrivateEndpointConnection.go | Go | go | 2,014 | 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 v20180601privatepreview
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func LookupPrivateEndpointConnection(ctx *pulumi.Context, args *LookupPriv... |
b0cfb99d0820f0720c4c26ad5de28d6598492f3d | e43046235ea2e704746ea8abe8b77db3f0248594 | OrlovEvgeny/stubborn | /client_test.go | Go | go | 17,456 | permissive | package stubborn
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"math/rand"
"testing"
"time"
)
const (
countMessages = 5
sampleMessage = "[websocket sample message, websocket sample message, websocket sample message, websocket sample message, websocket sample message]"
authSuccessString = "... |
41ad25c846bcc84ef3f686942743c08a3705cfb1 | 15f008daedf3f731a46b0fd3f38aec49250a4945 | swiftma/gologic | /basic/c2/demo.go | Go | go | 395 | no_license | package main
import "fmt"
func main() {
var b byte = 23
fmt.Println(b)
var s int16 = 3333
fmt.Println(s)
var i = 9999
fmt.Println(i)
var l int64 = 32323
fmt.Println(l)
var a int64 = 3232343433
fmt.Println(a)
var d = 333.33
fmt.Println(d)
var f float32 = 333.33
fmt.Println(f)
var arr = [...]int{1... |
e4ff62d8cec4bc072b477c37db0e85a52221848a | 03809b18c7dd86a7ace9b14a26a28348579a8d47 | wangjian138/wangjian-go-zero | /shorturl/wangjian-zero/etcd/tests/e2e/ctl_v3_lock_test.go | Go | go | 2,931 | permissive | // Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
13ac294e2f774792c928ae22aaa29c506bb2869e | 1720516ad751565fe7fe420e63aedbac6e4edcbd | aquasecurity/tracee | /pkg/pcaps/common.go | Go | go | 5,879 | permissive | package pcaps
import (
"fmt"
"math"
"os"
"strings"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcapgo"
"github.com/aquasecurity/tracee/pkg/config"
"github.com/aquasecurity/tracee/pkg/errfmt"
"github.com/aquasecurity/tracee/pkg/logger"
"github.com/aquasecurity/tracee/pkg/utils"
"github.... |
1ad0ae023c372255bb6b38311b0b12b90c79a0bf | e6dfb2eaa7a22ed280c94c481b15a0b9125d54de | atpons/etcd | /lease/leasehttp/http.go | Go | go | 6,634 | permissive | // Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
6b5ca1a4a96f4954746ed09675d105142f064177 | 1188787b095362b6f98a37587f5d8bc907ebc5df | felixsiburian/project-backend | /API/models/User/User.go | Go | go | 4,455 | permissive | package User
import (
"errors"
"github.com/badoux/checkmail"
"github.com/jinzhu/gorm"
"golang.org/x/crypto/bcrypt"
"html"
"log"
"strings"
"time"
)
type User struct {
Id uint32 `gorm:"primary_key;auto_increment" json:"id"`
Email string `gorm:"size:100; no null; unique" json:"email"`
Passw... |
73d0e06f7ed07060d21833e7e513fd10df0add02 | 31a7c9e60e024f1c6ae023a1c2df906224e20904 | bictorman/imageserver | /cache/server_test.go | Go | go | 2,497 | permissive | package cache_test
import (
"crypto/sha256"
"testing"
"github.com/pierrre/imageserver"
. "github.com/pierrre/imageserver/cache"
cachetest "github.com/pierrre/imageserver/cache/_test"
"github.com/pierrre/imageserver/testdata"
)
func TestCacheImageServerInterface(t *testing.T) {
var _ imageserver.ImageServerInt... |
1ce8d7503649e50ccf2222edffd2057cf6936be9 | 5704066863536c23446028410be8cb2107342163 | onap/multicloud-k8s | /src/k8splugin/api/profilehandler_test.go | Go | go | 11,457 | permissive | /*
* Copyright 2018 Intel Corporation, 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... |
e914113d7d87e4c1c36709b8ab84a4a76464a626 | 2bb518189df947d562dede291427bc826250769e | marcosggoncalves/api-golang-mysql | /api/src/controllers/usuario.go | Go | go | 4,060 | no_license | package controllers
import (
"api/api/src/database"
"api/api/src/models"
"api/api/src/repositories"
"api/api/src/responses"
"encoding/json"
"io/ioutil"
"net/http"
"strings"
"github.com/gorilla/mux"
"strconv"
)
func CriarUsuario(w http.ResponseWriter, r *http.Request) {
bodyRequest, erro := ioutil.ReadAll(r... |
020f3c95ce88e3524faada8ac004d969a1bd8f61 | 476ce06751ba0d5a11ffa6cf70a7663e0ee89b22 | daxialishiliang/hellow | /自动推导类型.go | Go | go | 500 | no_license | package main //必须有一个main包
import "fmt"
func main() {
//赋值,赋值前,必须先声明变量
var a int
a = 10 //赋值,可以使用n次
a = 20
a = 30
fmt.Println("a=", a)
//:=,自动推导类型,先声明白能量b,再给b赋值为20
//自动推导,同一个变量名只能使用一次,用于初始化那次
b := 20
fmt.Println("b=", b)
//b:=30//前面已经有变量b,不能再新建一个变量b
b = 30 //只是赋值,可以的
fmt.Println("b2=", b)
}
|
1124b157900a6abdc2bb8a902c032135502d5ced | c335f1c3e31ea4c34e4dec1c2461f55d868065fb | invokethreatguy/fibratus | /pkg/kcap/reader.go | Go | go | 6,856 | permissive | // +build kcap
/*
* Copyright 2019-2020 by Nedim Sabic Sabic
* https://www.fibratus.io
* 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.... |
c5225d0192daccb13a3ad88ecf95915922ac5fce | 72388e0ff789e2f7c35a76c6a89f28bbccc769ae | dfc-cash/dfc-api | /exp/txnbuild/asset_test.go | Go | go | 2,834 | permissive | package txnbuild
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/dfc/go/xdr"
"github.com/stretchr/testify/assert"
)
func TestNativeAssetToXDR(t *testing.T) {
asset := Asset{}
received, err := asset.ToXDR()
assert.Nil(t, err)
expected := xdr.Asset{Type: xdr.AssetTypeAssetTypeNative}
a... |
f7718bb5d4fc8e363ced53b28f622b6ab06c592e | 41b37dffb34bbfca7856e5e7070786b96c12e2a0 | devilkun/studygolang | /logic/comment.go | Go | go | 13,748 | permissive | // Copyright 2016 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author:polaris polaris@studygolang.com
package logic
import (
"fmt"
"html/template"
"math"
"net/url"
"regexp"
"stri... |
36469e734f51f54012d9257c7e5c894976d709af | 26f3b5e2dd54c3bd4bdb373febae49c16ba409a3 | gcsilva11/CodenameGod | /codenameGOD/main/game/arrow.go | Go | go | 531 | no_license | components {
id: "arrow"
component: "/main/game/arrow.script"
position {
x: 0.0
y: 0.0
z: 0.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
}
embedded_components {
id: "sprite"
type: "sprite"
data: "tile_set: \"/assets/items.atlas\"\n"
"default_animation: \"arrow_placehold\"... |
3b4f7dbe2dfbaf33eec4a9c30e2f6bf08a703cf5 | 230d5bb0c43c7d7f2ee8f46ffc553380e9faf4a3 | gabussieres/pinterest-clone | /resources/pin_test.go | Go | go | 4,518 | no_license | package resources
import (
"errors"
"pinterest-clone/config"
"pinterest-clone/models"
"reflect"
"testing"
"github.com/aws/aws-sdk-go/service/dynamodb"
)
var (
testPinID1 = "1"
testPinID2 = "2"
testPin1 = Pin("1")
testPin2 = Pin("2")
testPins = Pins{testPin1, testPin2}
)
type fakeDBClientPinError st... |
18c13fae558db58b44e7e18edab6b98b3dcdeac8 | 382b5d38ab9a568d46f4578f145c6fcd24c7be28 | darwin/lntop | /ui/views/header.go | Go | go | 1,287 | permissive | package views
import (
"fmt"
"regexp"
"github.com/edouardparis/lntop/ui/color"
"github.com/edouardparis/lntop/ui/models"
"github.com/jroimartin/gocui"
)
const (
HEADER = "myheader"
)
var versionReg = regexp.MustCompile(`(\d+\.)?(\d+\.)?(\*|\d+)`)
type Header struct {
Info *models.Info
}
func (h *Header) Se... |
ef5667664ef479e0b77e7dc8d1fa071f56c0165d | a1e31497a8b349bd3756ae15311afeb32ba635fd | JordonPhillips/aws-sdk-go-v2 | /aws/signer/v4/v4.go | Go | go | 16,144 | permissive | // Package v4 implements signing for AWS V4 signer
//
// Provides request signing for request that need to be signed with
// AWS V4 Signatures.
//
// Standalone Signer
//
// Generally using the signer outside of the SDK should not require any additional
// The signer does this by taking advantage of the URL.EscapedPat... |
92c3174ce9d3aa23afa0e1f42a91eed25bf115b4 | a01b42fb2c7652d238f1ef162779c654a980f95b | NodeFactoryIo/vedran | /internal/tunnel/tunnel.go | Go | go | 817 | permissive | package tunnel
import (
"fmt"
"github.com/NodeFactoryIo/vedran/internal/auth"
"github.com/NodeFactoryIo/vedran/pkg/http-tunnel/server"
log "github.com/sirupsen/logrus"
)
func StartHttpTunnelServer(serverPort string, portPool *server.AddrPool) {
logger := log.WithField("context", "http-tunnel")
s, err := server... |
2c2eaa05729cd6bc1e2424054836a44498b1da39 | ff87c9afcdca3b2963661d457bacc59a9db6fe37 | gobuffalo/docs | /old-site/actions/release-notes.go | Go | go | 872 | permissive | package actions
import (
"html/template"
"path/filepath"
"strings"
"github.com/gobuffalo/packd"
"github.com/google/go-cmp/cmp"
)
type releaseNotes struct {
box packd.Box
}
func (releaseNotes) Path(key, v string, ps ...string) string {
args := []string{
"en",
"docs",
"release-notes",
key,
strings.Re... |
d928534f77731e4d5ff2b4dc19164420b02daac3 | 092cbdb93771767fcd046510c4c334131eb635d3 | yanghongkjxy/tsuru | /auth/saml/saml_test.go | Go | go | 31,575 | permissive | // Copyright 2016 tsuru 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 saml
import (
"bytes"
"encoding/base64"
"io"
"os"
"time"
"github.com/tsuru/tsuru/auth"
"gopkg.in/check.v1"
)
func (s *S) TestSamlMetadata(c *ch... |
4e71dad3513982173b47ecc6928dbbccff76ad55 | 2f66c0437bb9d41aa660e59da5aa1ed8faa14b36 | sscqchain/go-xchain | /x/gov/execute.go | Go | go | 1,292 | permissive | package gov
import (
"fmt"
sdk "gitee.com/xchain/go-xchain/types"
)
func Execute(ctx sdk.Context, gk Keeper, p ProposalContent) (err error) {
switch p.GetProposalType() {
case ProposalTypeSoftwareUpgrade:
return SoftwareUpgradeProposalExecute(ctx, gk, p.(*SoftwareUpgradeProposal))
}
return nil
}
func Softwa... |
5e19f8d622cdc6cb6e6842fbe2e7cdff645c674c | 403c4d20ea204323e19180b2e94b984aabb964d1 | auvn/go-atlassian | /bitbucket/api/pr/methods.go | Go | go | 357 | no_license | package pr
import (
"context"
"github.com/auvn/go-atlassian/atlassian"
"github.com/auvn/go-atlassian/bitbucket/api"
)
func GetPage(ctx context.Context, g *atlassian.DefaultClient, path api.Path) (*api.PullRequests, error) {
var resp api.PullRequests
if err := g.Get(ctx, path.String(), &resp); err != nil {
ret... |
d9a2017947eb956636775d242c780850cf0f91fa | c8f6aea693af90dfdd79d4d78a4dc5c3a2638b09 | fedekunze/cosmos-sdk | /client/keys/root.go | Go | go | 1,192 | permissive | package keys
import (
"github.com/cosmos/cosmos-sdk/client"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
)
// Commands registers a sub-tree of commands to interact with
// local private key storage.
func Commands() *cobra.Command {
cmd := &cobra.Command{
Use: "keys",
Short: "Add or view local private k... |
21e39d89bd37cdb55ab6e5a2b616fee62fc7e33d | 2c8cf617f7651e0485101cdf1cf18e5c1b7eafbe | serjvanilla/fastjsonrpc | /repository_test.go | Go | go | 7,801 | permissive | package fastjsonrpc_test
import (
"testing"
"github.com/valyala/fasthttp"
. "github.com/serjvanilla/fastjsonrpc"
)
func TestRepositoryMethodPost(t *testing.T) {
r := NewRepository()
ctx := new(fasthttp.RequestCtx)
ctx.Request.Header.SetMethod(fasthttp.MethodGet)
r.RequestHandler()(ctx)
if ctx.Response.St... |
f05fddeba01d75d4ab8fed82c7e1c6cc1d34b73a | bb8284930897780dbc91b24d7f518008f336f6ea | Osamabilla/Dat320Assignments | /lab4/schedule/round_robin.go | Go | go | 514 | no_license | // +build !solution
package schedule
import (
"time"
)
type rrScheduler struct {
baseScheduler
//TODO(student) add missing fields, if necessary
}
// newRRScheduler returns a Round Robin scheduler with the time slice, quantum.
func newRRScheduler(quantum time.Duration) *rrScheduler {
//TODO(student) construct ne... |
19c802eb1ea72e4ad3c3199307ac159dfd664f28 | 1b7f6b085efed54e6d3031d88e13b44c8bebe812 | subfuzion/atomiq | /cli/command/stats/stats.go | Go | go | 10,544 | permissive | package stats
import (
"context"
"errors"
"fmt"
"strconv"
"strings"
"text/tabwriter"
"time"
"github.com/appcelerator/amp/api/rpc/stats"
"github.com/appcelerator/amp/cli"
"github.com/spf13/cobra"
"google.golang.org/grpc"
)
type statsOpts struct {
container bool
service bool
node bo... |
c440cd54d5640e315a83c26582a8a54e7e960b10 | 9152ddbff2d1632f5554610b9a1c069c92f2ddc5 | wp-jackliu/opentaobao | /model/cmns/PushRequest.go | Go | go | 1,500 | permissive | package cmns
// PushRequest 结构体
type PushRequest struct {
// 消息内容, 为json字符串,格式详见http://open.yunos.com/doc/detail?spm=a2c01.7698725.0002.40.ZNPFOJ&documentId=102975
Msg string `json:"msg,omitempty" xml:"msg,omitempty"`
// 业务应用appKey,top调用不需要传此参数
BizAppKey string `json:"biz_app_key,omitempty" xml:"biz_app_key,omitem... |
e8a9c450f345d9ab0790f1fc57e702057a7dca6c | aaaaed3a1f60c6c0c32bbfa8bc4ff69ccc569382 | snoopfab/grafana | /pkg/api/index.go | Go | go | 13,975 | permissive | package api
import (
"fmt"
"sort"
"strings"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/setting"
)
const (
// Themes
lightName = "light"
darkName = "dark"
)
... |
cd727192dc69be9258730ffc9122ff0adf68622a | 2296bd6115b80eaf27dd3f02fcd081a020aa9873 | WillCoates/FYP | /common/model/sensor_data.go | Go | go | 343 | no_license | package model
import "go.mongodb.org/mongo-driver/bson/primitive"
type SensorData struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
Sensor primitive.ObjectID `bson:"sensor,omitempty"`
MessageID string `bson:"msgid"`
Value string `bson:"value"`
Timestamp int64 ... |
79bfb68926108211a49dc2332432cf105a60becc | 41db48361e00e6d55ca0e0e21690d7c0d10ffb86 | libopenstorage/stork | /pkg/resourcecollector/job.go | Go | go | 872 | permissive | package resourcecollector
import (
batchv1 "k8s.io/api/batch/v1"
"k8s.io/apimachinery/pkg/runtime"
)
const (
controllerUIDLabel = "controller-uid"
)
func (r *ResourceCollector) prepareJobForCollection(
object runtime.Unstructured,
namespaces []string,
) error {
var job batchv1.Job
if err := runtime.DefaultUns... |
06698150354f9197223bef63fb5e96e5ff0b7d17 | e5d2bae2c5b7bd4b8746a4a1fd1fda897186489e | bygui86/kubernetes-tests | /kubernetes/databases/postgres/crunchydata-postgres-operator/pgo/cmd/auth.go | Go | go | 6,006 | permissive | package cmd
/*
Copyright 2019 Crunchy Data Solutions, 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 o... |
eb331b99956dabec32e6fcdce7a33172f412e186 | ce24ac838fd6c1ef0084c9611478665ae04ec13e | SciGno/webframework | /main.go | Go | go | 870 | no_license | package main
import (
"encoding/json"
"log"
"net/http"
// "github.com/julienschmidt/httprouter"
"github.com/scigno/webframework/httprouter"
)
// This is the main function
func main() {
s := httprouter.New()
s.HandleFuncGET("/user/profile/{profile_id}", UserStatus)
s.HandleFuncGET("/status/", APIStatus)
lo... |
9f382255f735cc2801e43ce4f09bc61edadf3031 | 2aeb9b8705a1186f8024a859bd42aed041e834bb | kjm0001/m3db | /src/m3ninx/index/segment/fs/encoding/docs/index.go | Go | go | 4,210 | permissive | // Copyright (c) 2018 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... |
c3d3e09082b954aad96eea2dbe9a691bb06274b5 | 37616b8beca474607f26cba0295a048652b761ce | xulingke/ginEssential | /response/response.go | Go | go | 522 | no_license | package response
import (
"github.com/gin-gonic/gin"
"net/http"
)
//返回http
/*{
code:2000,
data:xxx,
msg:dx,
}*/
func Response(ctx *gin.Context, httpStatus int, code int, data gin.H, msg string) {
ctx.JSON(httpStatus, gin.H{"code": code, "data": data, "msg": msg})
}
func Success(ctx *gin.Context, data gin.H, m... |
71ec1097ccf73c118c2497a591fd2b98cb46b548 | c129670e33cdb182e375b5d776f8db2d591f0d87 | z1421012325/pika | /server/models/grade.go | Go | go | 636 | no_license | package models
// 用户等级表
/*
create table `grade` (
`g_id` INT AUTO_INCREMENT PRIMARY KEY,
`_explain` VARCHAR(20) COMMENT '1,站主 2,管理员 3,上传人员 4,普通用户'
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO grade (_explain) VALUES ("站主");
INSERT INTO grade (_explain) VALUES ("管理员");
INSERT INTO grade (_explain) VALUES ("上传人员")... |
1619427c75ac2fba07ab47fd1ea4a41ab5836849 | 196353b88003602e36773626f93b074826ec1818 | continuum-irfan-shaikh/SharedFolder | /vendor/gitlab.connectwisedev.com/platform/platform-tasking-service/utils/migrate-partner-scripts/config.go | Go | go | 3,596 | no_license | package main
import (
"database/sql"
"fmt"
"strings"
"time"
"gitlab.connectwisedev.com/platform/platform-tasking-service/src/logger"
_ "github.com/denisenkom/go-mssqldb"
"github.com/gocql/gocql"
"log"
"os"
)
var (
// Config is a package variable, which is populated during init() execution and shared to wh... |
4d308b16e7ca25191db0b556613406e3c3b29b2f | 84fd128aeedb08357f319077d98c7995c0b98d85 | yuriwebdev/golang-test-task | /app.go | Go | go | 317 | no_license | package main
import (
"flag"
"fmt"
"log"
"os"
)
var BIND_ADDR = flag.String("port", ":8008", "bind addr")
func init() {
fmt.Println("Application initialized")
flag.Parse()
f, err := os.OpenFile("./log.log", os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0644)
if err != nil {
panic(err)
}
log.SetOutput(f)
}
|
a44d211ae7a044c5bdab98db99b88a0478b50b70 | aecb64404010c45e7bda7dc5467887bf130a1899 | cloudnativedaysjp/showks-github-repository-operator | /pkg/controller/github_repository/github_controller_suite_test.go | Go | go | 2,243 | no_license | /*
Copyright 2019 TAKAISHI Ryo.
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
d... |
61f14c1536bd4d3b8c45a55b95cfef34a09c886e | 5e89a03e461eabffa5dae56d0de91794d01dfad4 | night556/alibaba-cloud-sdk-go | /sdk/auth/roa_signature_composer_test.go | Go | go | 3,567 | permissive | package auth
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/signers"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
)
func mockDate(fn func() string) string {
return "mock date"
}
fu... |
c7a8b46632ca043e18e1815e586f20d898f583ad | d6f8501686ab1e3d30c2e437f22e16ea2531ab36 | AskoTJM/tiuku | /api/scripts/scripts.go | Go | go | 1,423 | no_license | package scripts
/*
// scripts.go
// Description: functions independent of database or http connections, mostly short snippets to make things easier.
*/
import (
"fmt"
"strconv"
)
// Turn uint64 to string
// W0rks
func Uint64ToString(newUint uint64) string {
//var u uint32 = newUint
//var s = strconv.FormatUint(ui... |
508ab843e2ee300b9d6653b29f73643634dcf714 | b5f84c03ed1dcfaed040a958c37b5c962b00c002 | k8cdk/cellery | /components/cli/pkg/runtime/namespace.go | Go | go | 1,275 | permissive | /*
* Copyright (c) 2019 WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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/lic... |
7ff356ca1f574f94c2bc2b9c9edd439edceaa9c6 | e95c9908f0e6ce7ce76d7d26ba39adbf1ef42da1 | malyg1n/sql-migrator | /internal/entity/migration_entity_test.go | Go | go | 303 | permissive | package entity_test
import (
"github.com/malyg1n/sql-migrator/internal/entity"
"github.com/stretchr/testify/assert"
"testing"
)
func TestNewMigrationEntity(t *testing.T) {
me := entity.NewMigrationEntity("some-migration-up", "some sql query", 1)
assert.IsType(t, &entity.MigrationEntity{}, me)
}
|
a44f9c72f46b60ba65813daaa4fe0ddbf4922ac5 | 279f80474aa2812159eafb5d5a5587d6eb7338e1 | tehwalris/go-freeipa | /freeipa/client.go | Go | go | 3,796 | permissive | /*
This package is UNMAINTANED!!!
See https://github.com/tehwalris/go-freeipa for details
Package freeipa provides a client for the FreeIPA API.
It provides access to almost all methods available through the API.
Every API method has generated go structs for request parameters and output.
This code is generated from... |
929ff5d1c3c25187a961f34c09fd189a6ccaa5e5 | f569dadc1791acf57ee78eaa22abfd6596e29888 | MisinformedDNA/pulumi-azure-native | /sdk/go/azure/storsimple/v20161001/manager.go | Go | go | 6,501 | 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 v20161001
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The StorSimple Manager
type Manager s... |
c366833890289d8e7a7aaf1e654398a17ebd4cfa | 5da6496cfc86cd10d612f5be76c3fb98bbf9b567 | amankapoor/goth | /providers/box/session.go | Go | go | 1,514 | no_license | package box
import (
"encoding/json"
"errors"
"strings"
"time"
"github.com/amankapoor/goth"
)
// Session stores data during the auth process with Box.
type Session struct {
AuthURL string
AccessToken string
RefreshToken string
ExpiresAt time.Time
}
var _ goth.Session = &Session{}
// GetAuthURL wi... |
57f1092084da7d733fb9ab115b9641568186fc47 | d9d005c243bf4bd54db6342f2b144b9f1c6314d6 | JaysonQY/kubernetes | /test/integration/auth_test.go | Go | go | 44,707 | permissive | // +build integration,!no-etcd
/*
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 applicab... |
0ad071c8b804898cec29997a1d627e7bc0ff1579 | e55a421e52efb998c07d55035a7b7adfda9cc2a6 | XanderDwyl/openfaas-lambda | /svc/common.go | Go | go | 2,581 | no_license | package svc
import (
"bytes"
"compress/gzip"
"compress/zlib"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
)
func LogItKibana(funcName, level, message string) {
LogIt(fmt.Sprintf("%s %s %s", funcName, level... |
f495fd2e6d1600f05459d2394564321467987108 | 2ac225904a82a23412bcc3849da45cfa3fe7d43d | willfaught/orm-and-rpc | /prototype/company/offer/repository.go | Go | go | 2,286 | permissive | // Generated
package offer
import "github.com/company/gossie/src/gossie"
var _ Repository = repository{}
type Repository interface { // Implementation unknown to all models
Load(id string) (Offer, bool)
LoadAll() []Offer
LoadRange(id string, limit int) ([]Offer, bool)
Store(m Offer)
}
func NewRepository(c goss... |
60b8bb0305e954fe062941a12e3c66150507fd04 | 8c632abf54a1d2cbef2d9e5ca13b00e8d8ae9782 | neat-soft/tsuru | /provision/kubernetes/node_test.go | Go | go | 11,945 | permissive | // Copyright 2016 tsuru 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 kubernetes
import (
"fmt"
"net/http"
"net/http/httptest"
"net/url"
"github.com/tsuru/config"
"github.com/tsuru/tsuru/app"
"github.com/tsuru/tsur... |
98f9d0907e8310bd6ee95005df0591f3f632de7c | 4502c47e354a7d92d7a7ff345e07a4b1d06e2bf7 | dustintownsend/origin | /Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/registry/registrytest/scheduler.go | Go | go | 962 | 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... |
d2a48906458e615bcd968f5c1377e90ce375457a | 4f1281adc2bdd326c3b47bddba473a78ed5a8a53 | fenglixa/kubernetes | /pkg/controller/volume/persistentvolume/pv_controller_test.go | Go | go | 11,427 | 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, ... |
739a15f2d1279dc0cebb9ae06accec13c7f342f3 | d5e981efec57cac6e198477ad6457f3964c96ec8 | th3c0d3br34ker/learn-golang | /go-netflix-api/main.go | Go | go | 324 | no_license | package main
import (
"fmt"
"log"
"net/http"
router "github.com/th3c0br34ker/go-netflix-api/router"
)
func main() {
fmt.Println("MongoDB API")
r := router.Router()
fmt.Println("Server is getting started...")
log.Fatal(http.ListenAndServe(":4000", r))
fmt.Println("Listening at port 4000 ...")
... |
7b8487ac518db090f4b8fdd95a6b235b36a02c15 | 1ff5b76048a685e2227cb30bbed0d1e090eaa872 | HaibiPeng/DevopsWithDockerPart3 | /3.6/example-backend/pgconnection/trypostgres.go | Go | go | 2,623 | no_license | package pgconnection
import (
"context"
"errors"
"fmt"
"os"
"server/common"
"time"
"github.com/go-pg/pg/v10"
"github.com/go-pg/pg/v10/orm"
)
var pgdb *pg.DB
var ctx = context.Background()
type Message struct {
ID int64 `json:"id"`
Body string `json:"body"`
}
// createSchema creates database schema for... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.