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 |
|---|---|---|---|---|---|---|---|---|
678922c4788585c94b261ca031f792b939373a6a | c74a4976d379493d8d08ded78029298f3357ff90 | cloudfoundry-attic/cli-acceptance-tests | /vendor/github.com/cloudfoundry/cli/cf/manifest/manifest_disk_repository.go | Go | go | 2,560 | permissive | package manifest
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"github.com/cloudfoundry/cli/cf/errors"
. "github.com/cloudfoundry/cli/cf/i18n"
"github.com/cloudfoundry/cli/generic"
"gopkg.in/yaml.v2"
)
//go:generate counterfeiter . ManifestRepository
type ManifestRepository interface {
ReadManifest... |
cfcde24ebf68449502aa252819a1aa431c7c4965 | 292c4f9c9c740db3e5f82a35493effa3e3d3b6ac | xhenner/golang-support | /rpack/rpack.go | Go | go | 4,988 | no_license | package rpack
import (
"bytes"
"compress/gzip"
"crypto/md5"
"encoding/base64"
"fmt"
"io/ioutil"
"math/rand"
"mime"
"net/http"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
"time"
)
type RPACK struct {
Compressed bool
Default bool
Modified int64
Mime string
Content string
raw ... |
d46deda9ada78d2d605629de0082ade8fd32b265 | 2fd706d6adf91793310f2ab7491983272d5941e3 | next-stack/kops | /cmd/kops/create_secret_weavepassword.go | Go | go | 4,425 | permissive | /*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
59d4b89a4df23264c2ce44e9de4dcb2269041a3e | 88807ce5247ef8fedd0f73d3fb6912ffb421a7d1 | ndcampbell/conformitygopher | /aws/resourceMap.go | Go | go | 446 | no_license | package aws
import (
"github.com/ndcampbell/conformitygopher/configs"
"github.com/aws/aws-sdk-go/aws/session"
)
/*
map of AWS gather functions. Maps to a string that would be found in
JSON configs. As long as all gathers have the same function interface, this is
easy to maintain and loop over
*/
var ResourceMap =... |
09bf89fdc84b11972faf0e134c852c113a7aa10e | daef792dc1b67adbe10acc000fd851936df0bad1 | benosman/terraform-provisioner-ansible | /vendor/google.golang.org/grpc/balancer/xds/orca/orca_test.go | Go | go | 2,065 | permissive | /*
* Copyright 2019 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed t... |
bfc60aa8859049ed906283edc727b2b25926ba73 | 36d01d1710d52e7083e71c53b9124c619f4805bb | jackluo2012/go-zero-bookstore | /jwt/internal/logic/jwtlogic.go | Go | go | 1,309 | no_license | package logic
import (
"context"
"time"
"bookstore/jwt/internal/svc"
"bookstore/jwt/internal/types"
"github.com/dgrijalva/jwt-go"
"github.com/tal-tech/go-zero/core/logx"
)
type JwtLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewJwtLogic(ctx context.Context, svcCtx *s... |
2fb05ebc956e44f6806d85e8fe18f40012390cfe | 333d72dce2da44b8ca8f98c979a2393a57f0852b | fabiant7t/ingress-nginx | /internal/ingress/controller/template/template_test.go | Go | go | 21,422 | permissive | /*
Copyright 2015 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, ... |
8c3a772e222fd198c00135213cf113f385567c4e | 8696c1ef28d32b54482ddaf94bb3e9992bb1df0a | Sharma-Hrishabh/babble | /src/hashgraph/hashgraph_dyn_test.go | Go | go | 24,004 | permissive | package hashgraph
import (
"fmt"
"reflect"
"testing"
"github.com/mosaicnetworks/babble/src/common"
"github.com/mosaicnetworks/babble/src/crypto/keys"
"github.com/mosaicnetworks/babble/src/peers"
)
/*
We introduce a new participant at Round 2, and remove another participant at
round 5.
Round 7
P: [1,2,3] ... |
ebf2150245822e4a0ae07595031c332619853263 | 6619c1a20901e8393c0de703f80a205127865fec | cesarwbr/video-maker | /robots/image.go | Go | go | 2,608 | permissive | package robots
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"strconv"
"video-maker/types"
"google.golang.org/api/customsearch/v1"
"google.golang.org/api/googleapi/transport"
)
// ImageRobot create a new robot
func ImageRobot() {
content := Load()
fetchImagesOfAllSentences(content)
download... |
06fcfdb9e5bcf6bd99db6fa6eb485257f123820a | d42ecbe5d35c36fbfcc08f46bed4a31ae7c79cd7 | ihippik/etcd | /clientv3/integration/watch_fragment_test.go | Go | go | 3,762 | permissive | // Copyright 2018 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... |
55019b4f21a3e6ef909f880334080d3488ad215b | 417323ca827c0806c0d5f492be947f498635fc26 | cpusoft/rpstir2 | /src/rpstir2-parsevalidate-db/syncrrdpnotifydb.go | Go | go | 2,293 | permissive | package parsevalidatedb
import (
"time"
"github.com/cpusoft/goutil/belogs"
"github.com/cpusoft/goutil/xormdb"
model "rpstir2-model"
)
func saveToSyncRrdpNotifyDb(distributedResult *model.DistributedResult) error {
start := time.Now()
belogs.Debug("saveToSyncRrdpNotifyDb(): distributedResult:", distributedResul... |
d90cd4c326187770d6cf7fcace5e62885104d3ee | 7edfe44700b76ba61eb9b06bbc1595130acc017e | bogdanovich/cadence | /common/persistence/sql/storage/mysql/domain.go | Go | go | 5,190 | permissive | // Copyright (c) 2017 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... |
f64082f470b14cb15207e3c74886710972373df0 | edfebcc5a196281403ab41a2f79fe2140351607b | mojzesh/mage | /mage/testdata/list/command.go | Go | go | 505 | permissive | // +build mage
// This is a comment on the package which should get turned into output with the
// list of targets.
package main
import (
"fmt"
"log"
"github.com/mojzesh/mage/mg"
)
var Default = SomePig
// this should not be a target because it returns a string
func ReturnsString() string {
fmt.Println("more s... |
304c723c77e9262cbbd14c945aac15654f0451b6 | c4e98de9444dc14a6651b1d83856569d76a43b66 | FrankReh/go-clang | /clang/completionresult.go | Go | go | 1,367 | permissive | package clang
// #include "go-clang.h"
import "C"
import (
"reflect"
"unsafe"
"github.com/frankreh/go-clang/clang/cursorkind"
)
// A single result of code completion.
type CompletionResult struct {
c C.CXCompletionResult
}
/*
Sort the code-completion results in case-insensitive alphabetical order.
Parameter ... |
63337e63509541a6b58b0344ee1c0538a2015d18 | 6517d3ce6f67a55c8e93a03a5ff35de934270cf3 | polyglotm/coding-dojo | /coding-challange/leetcode/easy/~2022-02-28/1768-merge-strings-alternately/1768-merge-strings-alternately.go | Go | go | 676 | no_license | /*
1768-merge-strings-alternately
leetcode/easy/1768. Merge Strings Alternately
Difficulty: easy
URL: https://leetcode.com/problems/merge-strings-alternately/
*/
package main
import "fmt"
func mergeAlternately(word1 string, word2 string) string {
result := ""
min := func(a, b int) int {
if a < b {
return a
... |
082776743e7df9aa22a80ada7071c03c692cf76c | 5be4287a5d6d9c4392acc6d0b21e65ff754c11a1 | henriotrem/golang | /topic/map-reduce/master/master.go | Go | go | 3,266 | no_license | package main
import (
"fmt"
"log"
"net"
"net/http"
"net/rpc"
"os"
"strconv"
"sync"
"time"
"github.com/henriotrem/topic/map-reduce/models"
)
func main() {
if len(os.Args) < 2 {
fmt.Fprintf(os.Stderr, "Usage: mrmaster inputfiles...\n")
os.Exit(1)
}
m := MakeMaster(os.Args[1:], 10)
for !m.Done() {
... |
b874fa559cdd7971e9147a35a4830ffddc41555b | 76c8459870bfb964e1010b61547202d35ba4e5ef | rizalgowandy/cli | /pkg/logging/papertrail/list.go | Go | go | 2,501 | permissive | package papertrail
import (
"fmt"
"io"
"github.com/fastly/cli/pkg/common"
"github.com/fastly/cli/pkg/compute/manifest"
"github.com/fastly/cli/pkg/config"
"github.com/fastly/cli/pkg/errors"
"github.com/fastly/cli/pkg/text"
"github.com/fastly/go-fastly/v3/fastly"
)
// ListCommand calls the Fastly API to list P... |
9fc6ce6013ed955b2f472a3610f0e987d9fe9d45 | 98db0dde75bd89a15581b431be361b58c095bc0f | Esya/oasishub-indexer | /usecase/block/get_block_times_http_handler.go | Go | go | 1,226 | permissive | package block
import (
"github.com/figment-networks/oasishub-indexer/client"
"github.com/figment-networks/oasishub-indexer/store"
"github.com/figment-networks/oasishub-indexer/types"
"github.com/figment-networks/oasishub-indexer/usecase/http"
"github.com/gin-gonic/gin"
"github.com/pkg/errors"
)
var (
_ types.H... |
7b524fcf68bc5ef738f3c85e98e1da0f16aecdf9 | c4ab9f1babe0a3437e833e58c0d935d7113f7877 | radekg/terraform-state-ansible-module | /vendor/github.com/lusis/go-artifactory/src/artifactory.v491/users.go | Go | go | 3,012 | permissive | package artifactory
import (
"bytes"
"encoding/json"
"errors"
)
type User struct {
Name string `json:"name"`
Uri string `json:"uri"`
}
type UserDetails struct {
Name string `json:"name,omitempty"`
Email string `json:"email"`
Password string `json:... |
a0dade5d55bd7f79b26a3864986eb3178f108d85 | 3790618909155276ce6da673374fc736ff58e3e3 | dugwill/gots | /scte35/doc.go | Go | go | 21,584 | permissive | /*
MIT License
Copyright 2016 Comcast Cable Communications Management, LLC
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, cop... |
a583a237b130d9854f009a74d3b6e020bfdb0624 | 4639f57ce77158860447c1c77bc5b70ba074bc1b | vicety/ID2207-Project | /backend/main.go | Go | go | 635 | no_license | package main
import (
"fmt"
"github.com/gin-gonic/gin"
"kth.se/id2207-project/config"
"kth.se/id2207-project/handler"
"kth.se/id2207-project/model"
)
const (
Port = 8080
)
func main() {
if err := config.InitDB(); err != nil {
fmt.Printf("Failed to init db, err: %v\n", err)
return
}
if err := model.Init... |
4c0ebfe3665eb6cc37b94ed9e1e260e7b05ac2bf | 62c01b795f2f85cb323ca9c8cd5a883a0fc1fcf4 | sylzd/soar | /advisor/explainer.go | Go | go | 7,763 | permissive | /*
* Copyright 2018 Xiaomi, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to... |
feb0f8c68fa40552d1013b4cc7883c1783d25b9a | 35fcbdc6071d36674c69e84becb9597a6794a7d7 | ROCHAIA01/lorawan-stack | /pkg/fetch/fetch_test.go | Go | go | 1,059 | permissive | // Copyright © 2019 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... |
fc428c370b4a98d73c4c70afc0b83a7659ff4db8 | bec11c0cfe9e87f399b7c898487aa50e150cc19e | danbrakeley/dog | /level_test.go | Go | go | 439 | permissive | package dog
import "testing"
func Test_LevelStrings(t *testing.T) {
usedLevels := make(map[string]int)
for l := levelMin; l < levelMax; l++ {
str := l.String()
if len(str) == 0 {
t.Errorf("Level %d requires a non-empty string", int(l))
}
usedBy, inUse := usedLevels[str]
if inUse {
t.Errorf("Level %... |
9c6a3ef9835c7b25e4d0a3ff944b62586b1bda29 | 86d5791ea032f39c5ae23aeb21a158f30d95a7f8 | fernandoocampo/katas | /fight/kata.go | Go | go | 236 | no_license | package fight
import "math"
func Combat(health, damage float64) float64 {
if (health - damage) < 0 {
return .0
}
return (health - damage)
}
func CombatTwo(health, damage float64) float64 {
return math.Max(health-damage, 0.0)
}
|
b2cfc5991123f255f6fdba8447ff65a9bcc4a394 | 18b64a99e945e94ee50677493d6d39da7c67cc47 | albertito/remoteu2f | /remoteu2f-proxy/server.go | Go | go | 8,275 | permissive | package main
// Embed the html and js files we need.
//go:generate go run tools/embed.go to_embed/*.html to_embed/*.js to_embed/*.css
import (
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"mime"
"net"
"net/http"
"path/filepath"
"strings"
"sync"
"text/template"
"time"
"github.com/golang/glog"
"github.com/... |
f4bbf26366c83200b2e8260e7ec807246d9e1337 | 8d9bf7f4bca4fd11f958f5d897fc86cd6e5bb247 | JaxChan25/CVTElottery | /api/address.go | Go | go | 486 | permissive | package api
import (
"singo/service"
"github.com/gin-gonic/gin"
)
// AddressPost 新增地址
func AddressPost(c *gin.Context) {
service := service.AddressPostService{}
if err := c.ShouldBind(&service); err == nil {
res := service.Post()
c.JSON(200, res)
} else {
c.JSON(200, ErrorResponse(err))
}
}
// ShowA... |
93bb2dc9d928910c5658ada8c3cf2e0c86e2976d | 4e45ef5c3df413b865a8a6ef7d41a452d8938c99 | hdelazeri/MLP-2021-1-Desafio-4 | /go/main.go | Go | go | 2,560 | no_license | package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"runtime"
"strings"
"sync"
"github.com/thatisuday/commando"
)
type SafeBuffer struct {
sync.Mutex
buffer *bufio.Reader
}
func (b *SafeBuffer) Read() (string, error) {
b.Lock()
defer b.Unlock()
var (
isPrefix bool = true
err error = nil
l... |
2844928c78cf3822a968b7014eb711d4a2ea7f76 | 3f2c4676041615e8921cca7f84b2fa1bb8ed7e17 | Pix4D/cogito | /github/commitstatus.go | Go | go | 11,388 | permissive | // Package github implements the GitHub APIs used by Cogito (Commit status API).
//
// See the README and CONTRIBUTING files for additional information, caveats about GitHub
// API and imposed limits, and reference to official documentation.
package github
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"... |
99e8a4317798651ce8d1a85ea04c65fccd82e58c | dadb6e898600192a95ab5b7828ad6c52833f31d9 | push-platform/courier-handlers | /add-channel-script/new_channel/main/new_channel.go | Go | go | 3,744 | no_license | package main
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"os"
)
const filePath = "cmd/courier/main.go"
func fileToPath(filePath string) ([]string, error) {
file, err := os.Open(filePath)
if err != nil {
return nil, err
}
defer file.Close()
return linesFromReader(file)
}
func linesFromReader(reader ... |
985e9c9c29f08ca4d92f8443ef8cc6de48b11f5a | a374d9ed0da3f577f9514d2f66996450c902ca6c | skywalkerlee/ohmyqueue | /server/clientrpcserver.go | Go | go | 901 | no_license | package server
import (
"golang.org/x/net/context"
"time"
"strconv"
log "github.com/astaxie/beego/logs"
"github.com/ohmq/ohmyqueue/broker"
"github.com/ohmq/ohmyqueue/clientrpc"
"github.com/ohmq/ohmyqueue/config"
)
type RpcServer struct {
Broker *broker.Broker
}
func (rpcserver *RpcServer) PutMsg(ctx conte... |
cc6b4d2f18fe46fdd2b1939f9c621d1c9f38348d | c8e8f4643cfb182480efa01901b4c547ce18c9b4 | yuvalherziger/gravity | /vendor/github.com/gravitational/teleport/lib/services/tunnelconn.go | Go | go | 6,665 | permissive | package services
import (
"encoding/json"
"fmt"
"runtime/debug"
"strings"
"time"
"github.com/gravitational/teleport/lib/defaults"
"github.com/gravitational/teleport/lib/utils"
"github.com/gravitational/trace"
"github.com/jonboulle/clockwork"
)
// TunnelConnection is SSH reverse tunnel connection
// establi... |
a9409b981528b8480847689b26900243378c7154 | cabc743748b9b365dd75616eebd53d9c2029ba24 | sadpdtchr/config-parser | /tests/configs/parser_test.go | Go | go | 2,046 | permissive | /*
Copyright 2019 HAProxy Technologies
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, sof... |
4e5882d543e1e57b46ffd55b88b44ab6e9c132ae | 42bf7deee8b8864cec322bdfea9bf3483847a3e1 | cookieY/go-mysql | /failover/server.go | Go | go | 3,461 | permissive | package failover
import (
"fmt"
"github.com/cookieY/go-mysql/client"
. "github.com/cookieY/go-mysql/mysql"
)
type User struct {
Name string
Password string
}
type Server struct {
Addr string
User User
ReplUser User
conn *client.Conn
}
func NewServer(addr string, user User, replUser User) *Server... |
2c909efc5f49248838be38cd6dfbbb804874ee6b | a46d6e6dc1fa90ba68b72addc7e460e93d50d6b8 | zhenghaibo1008/service-center | /server/interceptor/interceptors.go | Go | go | 2,171 | no_license | //Copyright 2017 Huawei Technologies Co., Ltd
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agr... |
05fd762af7c2fcfc904790c313df3961f192aeb7 | 9584a25cb79df7103c7fbe605c96982e167b41e2 | critical-thinking/origin | /pkg/cmd/server/start/kubernetes/kubernetes.go | Go | go | 1,740 | permissive | package kubernetes
import (
"fmt"
"io"
"net/http"
"os"
"runtime"
"github.com/golang/glog"
"github.com/spf13/cobra"
"github.com/openshift/origin/pkg/cmd/cli/cmd"
cmdutil "github.com/openshift/origin/pkg/cmd/util"
)
const kubernetesLong = `
Start Kubernetes server components
The primary Kubernetes server co... |
e3aadbba5c88921ce8dde51dc01eb663712a90f1 | 2414ab84d84eec235df391cdde3998f8e03e2740 | alladdinkumar/LeetCoding-Challenge-MAY- | /Golang Solutions/Count Square Submatrices with All Ones.go | Go | go | 1,152 | no_license | func subsqaure(mat [][]int, k int) int{
n:=len(mat)
m:=len(mat[0])
cnt:=0
var stripSum [][]int
var i,j int
for i=0;i<n;i++{
var temp []int
for j=0;j<m;j++{
temp=append(temp,0)
}
stripSum=append(stripSum,temp)
}
for j=0; j<m; j++{
sum... |
e24f7564950d8cdbdc3adf22120b504140052c95 | 7b5c00ebbff081efe2a7cbd6f9b4767b82bffda9 | zhujq/free5gc-stage-3 | /src/smf/PDUSession/api_individual_sm_context.go | Go | go | 2,374 | permissive | /*
* Nsmf_PDUSession
*
* SMF PDU Session Service
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package PDUSession
import (
"github.com/gin-gonic/gin"
"free5gc/lib/http_wrapper"
"free5gc/lib/openapi"
"free5gc/lib/openapi/models"
"free5gc/src/smf/logger"
"free... |
809ec8bcf978f365931d0a26f423ed98ddd18155 | 20eec99c87d79ee98456bd2af65aa244b2e88031 | kvkang/golearn | /src/carlji.com/experiments/gocover/go1.10.2/pkg/version/version.go | Go | go | 689 | no_license | // Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package version implements the ``go version'' command.
package version
import (
"fmt"
"runtime"
"carlji.com/experiments/gocover/go1.10.2/pkg/base"
)
va... |
cb2077f0b0dd2af637030342a4cbccf87f6c7d75 | e5f3128416f74c834aecae68c6cb1c8cc5442ed2 | 33cn/plugin | /plugin/dapp/guess/commands/game_test.go | Go | go | 20,978 | permissive | package commands
import (
"context"
"encoding/binary"
"encoding/hex"
"errors"
"flag"
"fmt"
"io/ioutil"
"math/rand"
"os"
"testing"
"time"
"github.com/33cn/chain33/blockchain"
"github.com/33cn/chain33/common/address"
"github.com/33cn/chain33/common/crypto"
"github.com/33cn/chain33/common/limits"
"github... |
306928f6d9b92855ca7aa1e555c637fa7954f802 | e3f97845d4b7a181d9437f19fe36bd06d0f06f10 | cjtoolkit/form | /functions.go | Go | go | 3,208 | permissive | package form
import (
"fmt"
"mime/multipart"
"sort"
"strconv"
text "text/template"
)
// Get One File from Value
func GetOneFile(values ValuesInterface, name string) (fh *multipart.FileHeader) {
if values, ok := values.(ValuesFileInterface); ok {
fh = values.GetOneFile(name)
}
return
}
// Get All File from ... |
469c4e3f04535ebf7e497961d348894adf268969 | 5bb6f92b22f614337074fc8ca047a45f0ec137cb | kubernetes/kubernetes | /staging/src/k8s.io/api/events/v1beta1/types.go | Go | go | 6,204 | 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, ... |
316e9211d54b4103622ef0bb5ab0c79afeb03b02 | 2276da800c152ecce7a2dbaa6d073f6e34a94b86 | jessesanford/pixie | /src/cloud/auth/controllers/login_test.go | Go | go | 53,139 | permissive | /*
* Copyright 2018- The Pixie 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 ag... |
00d43321a865e8ae098873cd45c187cfbbfefd58 | 654df1cf986a558f1023a2d8f9dd0ef335ce3d23 | vuong177/irismod | /modules/service/simulation/decoder.go | Go | go | 1,836 | permissive | package simulation
import (
"bytes"
"fmt"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/irisnet/irismod/modules/service/types"
)
// NewDecodeStore unmarshals the KVPair's Value to the corresponding service type
func NewDecodeStore(cdc codec.Marshaler) func(kvA, kvB kv... |
906c8733f6f66fbd017c4e4d57d21d46b571fe92 | 47842169a640a0bd8935e743d308d126d9c1f915 | jangocheng/go-elasticsearch | /esapi/api.ingest.delete_pipeline.go | Go | go | 5,672 | permissive | // Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
69c2bf09e62c9141132e0b3ef094541d9e122f88 | 17e6bc9a91de3f532273f7c2d2867fdf0badbfd9 | oslet/agent | /http/admin.go | Go | go | 356 | permissive | package http
import (
"net/http"
"github.com/oslet/agent/g"
"github.com/toolkits/file"
)
func configAdminRoutes() {
http.HandleFunc("/workdir", func(w http.ResponseWriter, r *http.Request) {
RenderDataJson(w, file.SelfDir())
})
http.HandleFunc("/ips", func(w http.ResponseWriter, r *http.Request) {
Render... |
274fb7a8b3ce99c7006768b15a3d42818c486545 | 33d0d9cc10b8ad2437234502bbcf9385e3109e94 | kubernetes/klog | /integration_tests/klog_test.go | Go | go | 11,697 | permissive | package integration_tests_test
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"regexp"
"runtime"
"strings"
"testing"
)
const (
infoLog = "this is a info log line"
warningLog = "this is a warning log line"
errorLog = "this is a error log line"
fatalLog = "this is a fatal l... |
8f8b381a771daa591a716fe57e097c8e0a9a634b | 9fc348babaa5cdf2adf1c0d6a24b9a4babbb0e79 | hprateek43/kubernetes | /test/e2e/common/storage/projected_configmap.go | Go | go | 24,379 | 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, ... |
1c2a0e41c5ad42428d2f37364a7d76567bb07601 | 995194d342431ff4a56e7d2ea7f9a417fce2f5f2 | openshift-kni/baremetal-deploy | /features/vendor/github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1/register.go | Go | go | 1,488 | permissive | package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
)
var (
// GroupName is the group name of this api
GroupName = "machineconfiguration.openshift.io"
// GroupVersion is the version of this api group
GroupVersion = schema... |
99579d98d1e1219e2549e461187f5d17754f2497 | 360c4df3167430fcab4252d13e60ed131a55663f | vanmik/adc | /group_test.go | Go | go | 5,320 | permissive | package adc
import (
"testing"
"github.com/stretchr/testify/require"
)
func Test_Group_GetStringAttribute(t *testing.T) {
u := &Group{
Attributes: map[string]interface{}{
"one": "string",
"two": 2,
"three": []byte("bytedata"),
},
}
require.NotEmpty(t, u.GetStringAttribute("one"))
require.Equal... |
f24984d6084ecd275830c8c3ef6998d8cb100f99 | c8beb2ec0857a1cae7912af2e9951c0c933a4dc8 | tflovorn/polecalc | /bracket.go | Go | go | 2,555 | permissive | package polecalc
import "errors"
var ErrorNoBracket string = "cannot find bracket"
// (should probably set these constants through a configuration method)
// Number of steps to take in the first attempt to find a bracket.
const InitialBracketNumber uint = 32
// If using more steps than this to find a bracket, stop.... |
ab96c4a68e9478cb80107576e1d4557601267718 | 0ada9ebc2419a3b7dee1190528898b2a0448f232 | luno/jettison | /grpc/interceptors.go | Go | go | 4,215 | permissive | package grpc
import (
"context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/luno/jettison/errors"
"github.com/luno/jettison/j"
"github.com/luno/jettison/models"
"github.com/luno/jettison/trace"
)
// UnaryClientInterceptor returns an interceptor that in... |
f81abc831014d1efca55e6fd45707d5f1aa9d7a2 | 349b80dbc972a19f496d2fe9a0b902e543dbb254 | thalleslmF/plugin-architecture-go | /plugins/read_write/read_write_impl.go | Go | go | 1,917 | permissive | package main
import (
"bufio"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-plugin"
"io/ioutil"
"log"
"os"
shared2 "plugin-hashcorp/newApp/plugins/read_write/shared"
"strings"
)
type ReaderFile struct {
logger hclog.Logger
}
type WriterFile struct {
logger hclog.Logger
}
func (*ReaderFile) Read(k... |
532fb3bb38f90c3d95ca986c2ed5d9aa7b7de5ab | 2ff226713c8697ec9d00e9b54a4c951f70ac3136 | fordindin/ipmi-hipchat-bot.go | /config.go | Go | go | 584 | no_license | package main
import (
"gopkg.in/yaml.v2"
"io/ioutil"
"log"
)
func handleError(err error, filepath string, fatal bool) {
if err != nil {
log.Println("Error reading configuration file", filepath)
if fatal {
log.Fatal("error:", err)
} else {
log.Println("error:", err)
log.Println("Continuing with buil... |
7b3d00399fd678d60de8e6d3389ce8d2761fb516 | d79a2d6bc663610ad3f78f3c2bf5a2446e7448eb | nikitalier/tenderMonitoring | /pkg/service/keywordServ.go | Go | go | 820 | no_license | package service
import (
"time"
"github.com/nikitalier/tenderMonitoring/pkg/models"
)
const (
dateFormat = "02.01.2006"
)
//GetAllKeyWords ...
func (s *Service) GetAllKeyWords() (keywords []models.Keyword) {
keywords = s.repository.GetAllKeyWords()
for i := 0; i < len(keywords); i++ {
keywords[i].AddDateStri... |
332da24d7902c0837ff7550efeba255a3396d508 | 32311315fc8bc35109213691dc38f78db35f1294 | mgjeong/kubernetes | /cmd/kube-proxy/app/server_others_test.go | Go | go | 25,442 | permissive | //go:build !windows
// +build !windows
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by ... |
ac33a1cb0ad8430e8e55cba8bd778924ab0af9d5 | f9cbc864e715068b38d41697926c89cb13667db6 | H2pl4U/GoStudy | /concurrent/worker_pool/worker_pool.go | Go | go | 687 | no_license | package main
import (
"fmt"
"time"
)
func worker(id int, jobs <-chan int, results chan<- int) {
for j := range jobs {
fmt.Printf("worker:%d start job:%d\n", id, j)
time.Sleep(time.Second)
fmt.Printf("worker:%d end job:%d\n", id, j)
results <- j * 2
}
}
//通常会使用可以指定启动的goroutine数量–worker pool模式,控制goroutine的... |
d8b6d82e1665553fb4c2f3ba5572aa6b0dab8aeb | 53723485bfbff8aca88e1df609c11b28ea926f79 | smothiki/workflow-e2e | /tests/builds_test.go | Go | go | 5,297 | permissive | package tests
import (
"fmt"
"net/http"
"strconv"
"strings"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/onsi/gomega/gbytes"
. "github.com/onsi/gomega/gexec"
)
// createBuild invokes deis builds:create <image> -a <app>
// with provided <image> on provided <app>
// and validates that no... |
11f981bdfd87d37f4d073990f3c795ac5f0e21ed | 0163ee224c1dcf8fe3bf1ffc99eaaa8225b53abd | pinguo-yangbing/pgo2 | /client/memcache/conn.go | Go | go | 8,327 | permissive | package memcache
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"net"
"strconv"
"strings"
"time"
)
func newConn(addr string, nc net.Conn, pool *Pool) *Conn {
r := bufio.NewReader(nc)
w := bufio.NewWriter(nc)
return &Conn{
addr: addr,
nc: nc,
rw: bufio.NewReadWriter(r, w),
pool: pool,
}
}
type... |
93222a8b5406076915803329beba6fdefead0573 | 93ddb9280d4af8010772d1e53b82372c58bfa015 | getvenga/blessclient | /vendor/github.com/chanzuckerberg/go-misc/aws/sts.go | Go | go | 5,840 | permissive | package aws
import (
"context"
"encoding/json"
"io/ioutil"
"os"
"path"
"sync"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/client"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/service/sts"
"github.com/... |
f6104d1c86bb6b7e203f713787198fb29f62f2d9 | a0d0f7fedb6dc2fec803f01e7dfee83d28a48cf4 | MinhTranCA/syzkaller | /pkg/compiler/check.go | Go | go | 27,883 | permissive | // Copyright 2017 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// Package compiler generates sys descriptions of syscalls, types and resources
// from textual descriptions.
package compiler
import (
"fmt"
"strings"
... |
0a6c5baa6202a304daf22cb879e59c4dbe955d7a | ef093dd656620fed51b97c20bd8379f626e53bff | petershen0307/OnlineJudge | /leetCode/go/1171/q1171_test.go | Go | go | 1,023 | no_license | package q1171
import (
"reflect"
"testing"
)
func Test_removeZeroSumSublists(t *testing.T) {
type args struct {
head *ListNode
}
tests := []struct {
name string
args args
want *ListNode
}{
{
name: "-1 1 0 1",
args: args{head: &ListNode{Val: -1, Next: &ListNode{Val: 1, Next: &ListNode{Val: 0, Nex... |
6fe8cfb2a00f425664e09e30c3408e3b0008c648 | fea8f7414f49d91d62c00b2f0c640a5472265f62 | yizhiyan/moby | /runconfig/hostconfig_windows_test.go | Go | go | 418 | permissive | // +build windows
package runconfig // import "github.com/helmutkemper/moby/runconfig"
import (
"testing"
"github.com/helmutkemper/moby/api/types/container"
)
func TestValidatePrivileged(t *testing.T) {
expected := "Windows does not support privileged mode"
err := validatePrivileged(&container.HostConfig{Privil... |
823d0ba4fcc5346e9c8c3bb471e3b60da80ef856 | 439730834054fa599538be5fd7e072949c65ef7e | kobaji/easycla | /cla-backend-go/events/mockrepo.go | Go | go | 4,729 | permissive | // Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT
package events
import (
"context"
"time"
"github.com/communitybridge/easycla/cla-backend-go/gen/models"
eventOps "github.com/communitybridge/easycla/cla-backend-go/gen/restapi/operations/events"
"github.co... |
4a6deb6d5bb60e1739d85393220e5b6b3451e5ee | a39a000410dce1a77865e6ad395adf3d0f958bea | totoval/configer | /cmd/main/main.go | Go | go | 498 | permissive | package main
import (
"fmt"
"github.com/totoval/configer/pkg"
"github.com/totoval/configer/pkg/facade"
)
var config facade.Configer
func main() {
// use driver then config
c := &pkg.Config{}
if err := c.Use(pkg.DriverViper).Config(map[string]interface{}{
"path": "configs",
"filename": ".env",
"ex... |
11b9cfeb394d1b71f89a4a2fa79f53edf15247da | bf4ae912661965f77a1fccf9ef533b57cbbe1991 | O3Labs/neo-go | /pkg/core/bench_test.go | Go | go | 602 | permissive | package core
import (
"testing"
"github.com/nspcc-dev/neo-go/pkg/config/netmode"
"github.com/nspcc-dev/neo-go/pkg/vm/opcode"
"github.com/nspcc-dev/neo-go/pkg/wallet"
"github.com/stretchr/testify/require"
)
func BenchmarkVerifyWitness(t *testing.B) {
bc := newTestChain(t)
acc, err := wallet.NewAccount()
requi... |
e95c42224b309e7539f69d614f0fe048ae0df8b8 | 599acb22deadce6ca6fec3b6d51351ddb061d3b6 | jakdept/dandler | /thumbnail.go | Go | go | 5,110 | permissive | package dandler
import (
"fmt"
"image"
"log"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"time"
_ "image/gif" // imported to allow gif decoding natively
_ "image/jpeg" // imported to allow jpeg decoding
_ "image/png" // imported to allow png decoding
"image/jpeg"
"image/png"
"github.com/nfnt/r... |
ea4d7aa7ae76fda48e6b00d0936b0d35252b0d73 | 7c84ab1824287a3bfcf8742b16cde29652a0cc52 | tiandaochouqin820/Go-000 | /Week04/shorturl/api/internal/logic/shortenlogic.go | Go | go | 785 | no_license | package logic
import (
"context"
"shorturl/api/internal/svc"
"shorturl/api/internal/types"
"shorturl/rpc/transform/transformer"
"github.com/tal-tech/go-zero/core/logx"
)
type ShortenLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewShortenLogic(ctx context.Context, svcC... |
3c8b3986a3a7842ab9b78e084328b59371402c23 | 3f9674360e5d878b8204cc7712e28b3011142a4a | zhjh1209/revel_mgo_blog | /app/controllers/wcomment.go | Go | go | 1,208 | no_license | package controllers
import (
"strings"
"time"
"github.com/zhjh1209/revel_mgo_blog/app/models"
"github.com/revel/revel"
)
type WComment struct {
App
}
func (c WComment) Docomment(id string, rcnt int, comment *models.Comment) revel.Result {
if len(id) == 0 {
return c.Redirect(App.Index)
}
dao, err := model... |
d654ae02a5d066eb08e164589008851441409b57 | a805278a2bbdde5f5dd3bf1d5856f235588e575f | charleschrist21/golang-crud-with-upload | /helper/connection.go | Go | go | 1,234 | no_license | package helper
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
// ConnectDB : this is helper function connect mongoDB
// if you want to export your function. You must to start upercase function name.
// Otherwise you w... |
ad75d4ad96e5b26f9351dd1ac96102f786ffadec | 6847aa4d4fc7ac2d718449b1a16e6deaf4a8826d | codenotary/immudb | /pkg/client/client.go | Go | go | 75,668 | permissive | /*
Copyright 2022 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... |
15787ded1de9cbb9ac153fc573438bf33bc1647c | f8905d54df706298f7bdb83df344fbc03302811a | tarunganwani/rest-hello | /model-handler-app/main.go | Go | go | 240 | no_license | package main
import (
"log"
"github.com/tarunganwani/rest/model-handler-app/app"
)
func main() {
appObj := app.App{Address: ":8080"}
err := appObj.InitApplication()
if err != nil {
log.Fatalln(err)
}
log.Fatalln(appObj.Run())
}
|
5fd00725c30fd44336ece511d6a01aab8958ec9b | 882e1f938582b24743db58344f9c5ec8db9eb149 | lzhphantom/LintCode | /Algorithm/035/reverseLinkedList_test.go | Go | go | 1,145 | no_license | package _35
import (
"reflect"
"testing"
)
func TestReverse(t *testing.T) {
tests := []struct {
ln *ListNode
want *ListNode
}{
{&ListNode{
4,
&ListNode{
3,
&ListNode{
2,
&ListNode{
1,
nil,
},
},
},
},
&ListNode{
1,
&ListNode{
2,
&ListN... |
4987d0c19617e9a5dd7ff43a7fc482b76ee68ca0 | cee2fa512ec2377004ba8d213214d7a92c89e32a | bpkgoud/pulumi-azure-native | /sdk/go/azure/containerregistry/v20190601preview/pulumiEnums.go | Go | go | 74,424 | permissive |
package v20190601preview
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Architecture string
const (
ArchitectureAmd64 = Architecture("amd64")
ArchitectureX86 = Architecture("x86")
Architecture_386 = Architecture("386")
ArchitectureArm = Architecture("arm")
Architectu... |
11599f97e6db680d2ddbda2a33f28f4914a53f04 | 6e29a073212c841b0c305419e6597ad9786fe879 | ivanberry/crawlab | /backend/model/node.go | Go | go | 6,352 | permissive | package model
import (
"crawlab/constants"
"crawlab/database"
"crawlab/services/register"
"errors"
"github.com/apex/log"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
"github.com/spf13/viper"
"runtime/debug"
"time"
)
type Node struct {
Id bson.ObjectId `json:"_id" bson:"_id"`
Name ... |
feda9b174bec429d7217c870d3bacbeb40880285 | 0aa986f19c683cdbf41712a0d449ffd681d98dc1 | AmmarFahmy/origin | /vendor/k8s.io/utils/net/port_test.go | Go | go | 2,425 | permissive | /*
Copyright 2020 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, ... |
3793b353033c360e3703a383f1995e4dd87a01d9 | 4ac90b768e4529cf421c007bb154f03a4c83d2ae | exmonitor/firefly | /vendor/github.com/exmonitor/exclient/database.go | Go | go | 1,308 | permissive | package exclient
import (
"github.com/pkg/errors"
"github.com/exmonitor/exclient/database"
"github.com/exmonitor/exclient/database/dummydb"
"github.com/exmonitor/exclient/database/multi"
"github.com/exmonitor/exlogger"
"time"
)
type DBConfig struct {
DBDriver string
// elastic search
ElasticConnection strin... |
4027c6b64ee7f2afab5fdd06bf02919e08e82996 | 2033c6a52a0b13620c893d15110b9c673d51839d | jhaip/lovelace | /new-backend/go-server/subscriber.go | Go | go | 14,036 | no_license | package main
import (
"sort"
"strconv"
"strings"
"go.uber.org/zap"
)
/*
A subscriber is a goroutine that receives every claim and retract
and sends notifications
*/
type NodeValue struct {
terms []Term
}
type Node struct {
variableCache map[string][]NodeValue
}
type SubscriptionUpdateOptions struct {
sourc... |
22e2412f96b0bcac96552e598b2860ec809d3c4a | 47822f984721db3799b15d2d0710af039f7952c0 | icloudland/btcdx | /database/ffldb/export_test.go | Go | go | 946 | permissive | // Copyright (c) 2015-2016 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
/*
This test file is part of the ffldb package rather than than the ffldb_test
package so it can bridge access to the internals to properly test cases which
are either n... |
42ea1597aa66e66306aeaa6f405b10e944f71d8e | 44e34098437c807cae7762f4b4bca4fc4b57a184 | HcashOrg/hcAutonomy | /hcAutonomywww/cmd/hcAutonomywwwcli/commands/manageuser.go | Go | go | 2,048 | permissive | package commands
import (
"fmt"
"strconv"
"github.com/HcashOrg/hcAutonomy/hcAutonomywww/api/v1"
)
type ManageUserCmd struct {
Args struct {
UserID string `positional-arg-name:"userid" description:"User ID"`
Action string `positional-arg-name:"action" description:"(Admin) edit user action"`
Reason string `p... |
0f63c58610a717d77b5c95103024b107c9126ae1 | 463cd242424c115134db9f10725b8946e6c352d2 | mgoulish/mercury | /src/router_network/router_network.go | Go | go | 31,048 | no_license | package router_network
import ( "bufio"
"errors"
"fmt"
"os"
"os/exec"
"strings"
"math/rand"
"strconv"
"sync"
"time"
"client"
"router"
"utils"
)
var fp = fmt.Fprintf
var module_name = "router_n... |
d86ca2c916402306978fc9841dfd1f8536ee61e5 | 95c50023f3d5b2e645eeacbd4e3738a8c2ff6c8b | kubeflow/arena | /pkg/operators/tf-operator/apis/tensorflow/v1beta2/util_test.go | Go | go | 1,080 | permissive | // Copyright 2018 The Kubeflow Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... |
017b7add58515b4484ee911374a7e8b3cacec669 | 8b94dcaaabbbd2d945b93436e07207f1458075e0 | halfmatthalfcat/timescale-prometheus | /pkg/pgmodel/labels.go | Go | go | 5,077 | permissive | // This file and its contents are licensed under the Apache License 2.0.
// Please see the included NOTICE for copyright information and
// LICENSE for a copy of the license.
package pgmodel
import (
"encoding/binary"
"errors"
"fmt"
"math"
"sort"
"strings"
"sync"
"github.com/prometheus/prometheus/pkg/labels"... |
44f9d3f3934e0d1cb12d4e59c99fbaa3e44e5549 | a47aaa4316e5d83b151e34c507f1544347aabb7e | yuyangd/pingaling-go-client | /cmd/apply.go | Go | go | 1,782 | permissive | // Copyright © 2018 The Pingaling 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 ... |
474eec7700412bd5d3eb6d168c7cb7d3250ad877 | 683de711fb91cfb4b635ef906220e80338fe7f80 | crypt0cloud/core | /setup.go | Go | go | 2,179 | no_license | package core
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/onlyangel/apihandlers"
crypto "github.com/crypt0cloud/crypto_go"
)
func setup_hanlers() {
http.HandleFunc("/api/setup/configure_endpoint", apihandlers.RecoverApi(setup_configureEndPointName))
http.HandleFunc("/api/setup/set_initial_nod... |
e3794ee6f3762c00782ff59fb1fa825087202009 | a9785f5869da25665a6d6bdcb9a2dab290e04337 | andrewsomething/rexray | /libstorage/api/server/router/volume/volume.go | Go | go | 5,534 | permissive | package volume
import (
"net/http"
gofig "github.com/akutz/gofig/types"
"github.com/thecodeteam/rexray/libstorage/api/registry"
"github.com/thecodeteam/rexray/libstorage/api/server/handlers"
"github.com/thecodeteam/rexray/libstorage/api/server/httputils"
"github.com/thecodeteam/rexray/libstorage/api/types"
"g... |
5e7cfd3583771f2e3a7885f7ece657d80cafeabc | dece6e35586a692163bced61c20b1134ce7b1b96 | droplet-js/go-flower | /drivers/qlang/github.com/denverdino/aliyungo/dns/dns.go | Go | go | 4,702 | permissive | package dns
import (
"github.com/denverdino/aliyungo/dns"
qlang "qlang.io/spec"
)
// Exports is the export table of this module.
//
var Exports = map[string]interface{}{
"_name": "github.com/denverdino/aliyungo/dns",
"AAAARecord": dns.AAAARecord,
"ARecord": dns.ARecord,
"CNAMERecord":... |
85c1dad8e26ed051e6b4d7ea35823092c4ea3a60 | 64b413ad5ef76e35633bc5f4135b0a3ad63de698 | ishustava/buildpackapplifecycle | /launcher/main.go | Go | go | 3,089 | permissive | package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"runtime"
"strconv"
"code.cloudfoundry.org/buildpackapplifecycle/credhub"
"code.cloudfoundry.org/buildpackapplifecycle/databaseuri"
"code.cloudfoundry.org/buildpackapplifecycle/platformoptions"
yaml "gopkg.in/yaml.v2"
)... |
42c2af35c28bc9f11d16d4e37fb9afa129c3ed8c | feaf386487fe82c45285cd4e37be111f031f8d9d | serbi/nasa_apod_collector | /internal/app/api/api.go | Go | go | 928 | permissive | package api
import (
"bytes"
"encoding/json"
"io"
"net/http"
"github.com/serbi/nasa_apod_collector/internal/pkg/logger"
"github.com/serbi/nasa_apod_collector/internal/pkg/models"
"github.com/serbi/nasa_apod_collector/internal/pkg/settings"
)
const ComponentApi = "Component API"
func WriteJSONResponse(w http.... |
e6ef5fc8e92225c7b80d4da25f3e0ade697aacf3 | f7f39c2739960f58b37b9114932b04b93c8e315d | nkenen/BlockChain | /boltblockchain/ProofOfWork.go | Go | go | 1,446 | no_license | // ProofOfWork.go
package main
import (
"bytes"
"crypto/sha256"
"encoding/binary"
"fmt"
"log"
"math"
"math/big"
)
const targetBits = 24
var maxNonce = math.MaxInt64
type ProofOfWork struct {
block *Block
target *big.Int
}
func NewProofOfWork(b *Block) *ProofOfWork {
target := big.NewInt(1)
target.Lsh(t... |
7e2e0b6feb50dbc6cdc276349a0080cb851f53e7 | cb978f87251f020e18d1dde7fd957a54e8775b29 | rzs840707/skia-buildbot | /ct/go/frontend/frontend.go | Go | go | 5,699 | permissive | // Functions and variables helping with communication with CT frontend.
package frontend
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"strings"
"github.com/skia-dev/glog"
"go.skia.org/infra/ct/go/ctfe/pending_tasks"
"go.skia.org/infra/ct/go/ctfe/task_common"
ctfeutil "... |
ea18f817542174a7cb7af9bc1b923de0286d832c | 15f286d940f0d730e60a301bd648fd88b2408164 | neocortical/got | /blob/blob.go | Go | go | 200 | no_license | package blob
type Blob struct {
data []byte
}
func New(data []byte) Blob {
return Blob{data}
}
func (b Blob) Type() string {
return "blob"
}
func (b Blob) Serialize() []byte {
return b.data
}
|
24ebcbc80f5603c87cb78dcd4203a9afdf66ae5d | b84b7340e2d8ff2268d80ab0be44114e51c78643 | franck-fourel/platform | /auth/service/service/service_test.go | Go | go | 3,961 | permissive | package service_test
// import (
// . "github.com/onsi/ginkgo"
// . "github.com/onsi/gomega"
// . "github.com/onsi/gomega/ghttp"
// "net/http"
// "github.com/tidepool-org/platform/auth/service/service"
// "github.com/tidepool-org/platform/config"
// "github.com/tidepool-org/platform/config/env"
// "github.co... |
66f6b0b10b7625d33b08fb2e68cf787255cbb694 | e5c66947a4c68f215e2692242e1025dd9880c9e7 | tsubaoza0901/principle-and-architecture-for-application | /original-code/main.go | Go | go | 1,659 | no_license | package main
import (
"log"
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
// User ...
type User struct {
ID uint `json:"id" gorm:"id"`
Name string `json:"name" gorm:"name"`
Age int `json:"age" gorm:"age"`
}
// InitDB ...
func Ini... |
edf36366f5745b3377157f6516146b6bf967aae1 | 57124192036b7ed1a9430b94934e330c5287ad75 | Rondo09/jvmgo | /rtda/operand_stack.go | Go | go | 1,694 | no_license | package rtda
import "math"
type OperandStack struct {
size int
slots []Slot
}
func newOperandStack(maxStack uint) *OperandStack {
if maxStack > 0 {
return &OperandStack{
slots: make([]Slot, maxStack),
}
}
return nil
}
func (self *OperandStack) PushInt(val int32) {
self.slots[self.size].num = val
self... |
e22d296b83323173627452eb8beb10a564ec96dc | b35f2ec634a4c272982943d682c56f0b77e2c139 | getchill-app/http | /server/vault.go | Go | go | 9,582 | permissive | package server
import (
"context"
"encoding/json"
"io/ioutil"
"net/http"
"github.com/getchill-app/http/api"
wsapi "github.com/getchill-app/ws/api"
"github.com/keys-pub/keys"
"github.com/keys-pub/keys/dstore"
"github.com/keys-pub/keys/dstore/events"
"github.com/keys-pub/keys/tsutil"
"github.com/labstack/ech... |
b455acd384af28e7dfb380e1d5775d6ca916edbf | 546b50a0492b0f242c4139f434df3813896fed05 | martincyprus/waltonchain-gwtc | /node/node.go | Go | go | 19,603 | permissive | // Copyright 2015 The go-wtc Authors
// This file is part of the go-wtc library.
//
// The go-wtc library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at you... |
d905554bf7d68d8a8e7b828b0228463142008b3a | d79c1d8bf25a404f9d9dc2b1ee31413c5d30dd12 | meacial/evergreen | /scheduler/duration_based_host_allocator.go | Go | go | 20,867 | permissive | package scheduler
import (
"fmt"
"math"
"sort"
"time"
"github.com/evergreen-ci/evergreen"
"github.com/evergreen-ci/evergreen/cloud/providers"
"github.com/evergreen-ci/evergreen/cloud/providers/static"
"github.com/evergreen-ci/evergreen/model"
"github.com/evergreen-ci/evergreen/model/distro"
"github.com/ever... |
4ae9bde5f29afce7510e7a28f00348bd152a81ac | d3924ee6c5a7b5074464bda53bff11c8728ca647 | m1093782566/kubernetes | /pkg/controller/replication/replication_controller_utils.go | Go | go | 3,998 | permissive | /*
Copyright 2015 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, ... |
8416e5b8a1d630843287416a92f346f3fb403127 | 5a8b6cff4d592d44b49e8e1533458361ff8ebf91 | rubik-ai/cost-model | /pkg/cloud/csvprovider.go | Go | go | 10,624 | permissive | package cloud
import (
"encoding/csv"
"fmt"
"io"
"os"
"regexp"
"strconv"
"strings"
"sync"
"time"
"github.com/kubecost/cost-model/pkg/env"
"github.com/kubecost/cost-model/pkg/util"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.