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
0f335b4efc19644d3f7cb2b09236d1c7f0bb66b7
514d201c4787186c02996841a684cb3ac093b2ce
teotikalki/core-1
/insonmnia/marketplace/server.go
Go
go
6,377
permissive
package marketplace import ( "crypto/ecdsa" "crypto/tls" "net" "sort" "sync" log "github.com/noxiouz/zapctx/ctxlog" "github.com/pborman/uuid" "github.com/pkg/errors" "github.com/sonm-io/core/insonmnia/structs" pb "github.com/sonm-io/core/proto" "github.com/sonm-io/core/util" "go.uber.org/zap" "golang.org...
0374de2fb7bdb3920ca2969eb735b886c8ce3a04
4ec8aa37332e47fce19a58dc538ceed3ad5ae47d
yuenandi/kubernetes
/test/e2e/framework/node/resource.go
Go
go
28,278
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, ...
b8d7ec058125de59811887dcf778b7031c30d95c
df887c2fd612b6ed6b76e06e8a8dc544b8b9fe93
openshift/installer
/terraform/providers/aws/vendor/github.com/hashicorp/terraform-plugin-go/tftypes/attribute_path_error.go
Go
go
1,019
permissive
// Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: MPL-2.0 package tftypes import ( "fmt" ) // AttributePathError represents an error associated with part of a // tftypes.Value, indicated by the Path property. type AttributePathError struct { Path *AttributePath err error } // Equal returns true if tw...
8165681a319a83fd517d835ba2f5aa3ff8a1706a
ef95f97bf367d36a404efce9c50e1d720f8a3dae
wukuan405/cug
/examples/adder2/app/controllers.go
Go
go
3,330
no_license
//************************************************************************// // API "adder": Application Controllers // // Generated with goagen v1.0.0, command line: // $ goagen // --design=github.com/kkeuning/cug/examples/adder2/design // --out=$(GOPATH)/src/github.com/kkeuning/cug/examples/adder2 // --version=v1.0.0...
91a193637f21e5ef29a45e75bd2cfb4aa0e87c6c
6643f9d08c6c1fce3a512e91e68cf419b0cfb781
SparkPost/gosparkpost
/suppression_list.go
Go
go
8,346
permissive
package gosparkpost import ( "context" "encoding/json" "fmt" "net/url" ) // SuppressionListsPathFormat https://developers.sparkpost.com/api/#/reference/suppression-list var SuppressionListsPathFormat = "/api/v%d/suppression-list" // SuppressionEntry stores a recipient’s opt-out preferences. It is a list of recip...
974599a7c087fea7c06a136269b9056a22db8c46
426d75f3424e11d950a9cb4ee83f4d6ceeda854b
shreyashpandey/toybox
/algo_prep/array_interleave.go
Go
go
468
permissive
package main import "fmt" func max(a, b int) int { if a >= b { return a } return b } func interleave(a []int, b []int) []int { var output []int out_size := max(len(a), len(b)) for i := 0; i < out_size; i++ { if len(a) > i { output = append(output, a[i]) } if len(b) > i { output = append(output, b...
bd4764191f1bde5e5dd5725c44e785a4976fdee2
af3322d53ea2d1799de701f0c4a1c655784502c4
KyberNetwork/wallet-cache
/node/node_test.go
Go
go
868
permissive
package node import ( "bytes" "io/ioutil" "log" "net/http" "testing" ) func TestRequest(t *testing.T) { bodyStr := `{"jsonrpc":"2.0","id":1018,"method":"eth_getTransactionCount","params":["0x3cf628d49ae46b49b210f0521fbd9f82b461a9e1","latest"]}` rbody := bytes.NewReader([]byte(bodyStr)) request, err := http....
1ca1d2d2da9d1a19d02d7236ec1f43bba4069922
6fed43ee66db9e231400ead66b88885a0b840187
subash68/API-New
/s4_Profile/models/lutMasters.go
Go
go
1,242
no_license
// Package models ... package models // LutCorporateType ... type LutCorporateType struct { CodeDescription string `json:"codeDescription"` Code string `json:"code"` CharCode string `json:"charCode,omitempty"` } // LutSkillsMaster ... type LutSkillsMaster struct { SkillID string `json:"skillID` ...
ebdc0d01961040cd049c1391f889e89260f9ca00
e393f54cc156ad717d3d9b5d0b54c4ee2f7c838a
getsentry/opentelemetry-collector-contrib
/exporter/loadbalancingexporter/resolver_static.go
Go
go
2,238
permissive
// Copyright The OpenTelemetry 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...
f3ad3a59000080947409daa9eb07b95f03bd5994
1546126c352e6ea0dbd67572e287f869ebb71f2f
qingwave/go-opentsdb
/opentsdb/query_last.go
Go
go
5,567
permissive
// Copyright 2015 opentsdb-goclient 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 requir...
82798ba14ab9ea983013cbed7ff4046e8b43ce73
656f17780af3e50d586527ff4b3380b4d41037dd
serbanmarti/fiber_rest_api
/server/handler/restricted.go
Go
go
371
no_license
package handler import ( "fmt" "github.com/form3tech-oss/jwt-go" "github.com/gofiber/fiber/v2" "github.com/serbanmarti/fiber_rest_api/internal" ) func (h *Handler) Restricted(c *fiber.Ctx) error { user := c.Locals("user").(*jwt.Token) claims := user.Claims.(*internal.JWTClaims) return HTTPSuccess(c, fiber.M...
d88f3518cec43843a3128bf6fbe78e89f43af012
cb0e22632e6366f0235ca39c2e26ea7b9ddbbaf5
rgolangh/machine-api-operator
/pkg/operator/status.go
Go
go
11,107
permissive
package operator import ( "context" "fmt" "reflect" "strings" "github.com/golang/glog" osconfigv1 "github.com/openshift/api/config/v1" "github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" "k8s.io/apimachinery/pkg/api/errors" m...
80351f49bfb96c42d29b876ceddde6dcc173cf2f
79302c0c89b0bbe7b122839072da6d0630f46491
Joeltbond/learn-go
/main.go
Go
go
1,350
no_license
package main import ( "encoding/json" "fmt" "github.com/gorilla/mux" "log" "net/http" ) type Article struct { Id string `json:"Id"` Title string `json:"Title"` Desc string `json:desc"` Content string `json:"content"` } var Articles []Article func homePage(w http.ResponseWriter, r *http.Request) {...
df42355ad45603f644cc5ac4e26b62432864cfae
fee6ba035bf66699ef5f480d1e438a8081b19082
coadler/amboy
/pool/mock_queue_test.go
Go
go
3,513
permissive
package pool import ( "context" "fmt" "sync" "github.com/deciduosity/amboy" "github.com/deciduosity/amboy/job" "github.com/google/uuid" "github.com/pkg/errors" ) type QueueTester struct { started bool pool amboy.Runner id string numComplete int toProcess chan amboy.Job storage ...
a86d2ef978b9990ae6afcc8e47a647779c0c7160
e351a7b1a8540cd1e8963cfe3f37379bc13b0be7
ravblk/my_go_test
/find/find_test.go
Go
go
519
no_license
package find import "testing" func TestFind_min_max(t *testing.T) { type teststruct struct { arr []int min int max int } testarr := []teststruct { {[]int{23,12,32,54,65,121},12,121}, {[]int{2,12,32,54,65,100},2,100}, } var tmpmin, tmpmax int for _,x := range testarr { tmpmin, tmpm...
eae31eb48101bb4777c68440798e17598a8cebad
383adbe5bb8568b654d5a135bc23fe9780af731f
RWTH-OS/unik
/pkg/providers/ukvm/get_instance.go
Go
go
244
permissive
package ukvm import ( "github.com/cf-unik/unik/pkg/providers/common" "github.com/cf-unik/unik/pkg/types" ) func (p *UkvmProvider) GetInstance(nameOrIdPrefix string) (*types.Instance, error) { return common.GetInstance(p, nameOrIdPrefix) }
c989feb604aaaa8c9b775674761c155f28c0eec5
f3abab4a1ca02b49d8efed205723f09175dc2712
beringresearch/macpine
/cmd/restart.go
Go
go
1,433
permissive
package cmd import ( "errors" "log" "time" "github.com/beringresearch/macpine/host" "github.com/beringresearch/macpine/qemu" "github.com/beringresearch/macpine/utils" "github.com/spf13/cobra" ) // stopCmd stops an Alpine instance var restartCmd = &cobra.Command{ Use: "restart <instance> [<instance>...]",...
e049ee6ce47c1b3e2cb0477760b3ad138f7979c1
ef81306c17424c94593b968fe934128251f4c1d5
Zaybc/bingyan-summer-camp-2020
/TobyZT/Source/account/controller/login.go
Go
go
1,187
no_license
/* This file contains handlers to handle login request */ package controller import ( "account/model" "net/http" "github.com/gin-gonic/gin" ) // Login reads json in the post request and verify it // If correct, sign a jwt and then return it with json func Login(c *gin.Context) { var form model.LoginForm err :=...
1de2c22fc7f685ad3c3c2567d41ff41b607c9f9c
13450ef2e5e9ae4e88be442da68144ca650c1489
streamnative/pulsarctl
/pkg/ctl/schemas/upload.go
Go
go
3,060
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...
7ac830213e3bddd07982ea79ceca69f0b30e7e15
208e8777cb0fa8e513f910a073a10e166e4659cc
luci/luci-go
/common/clock/testclock/context.go
Go
go
1,872
permissive
// Copyright 2015 The LUCI 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...
8e9c5d896def7b66857908de9f2cb41b933ac271
c9c031bd5be2b710ec8abf3523ceba396e3fbe77
balistof/influxdb
/cmd/influx/main.go
Go
go
14,098
permissive
package main import ( "encoding/csv" "encoding/json" "flag" "fmt" "io" "net/url" "os" "os/user" "path/filepath" "strconv" "strings" "text/tabwriter" "github.com/influxdb/influxdb/client" "github.com/peterh/liner" ) const ( default_host = "localhost" default_port = 8086 default_format = "column" ...
1aa287ec16275a3ec8a0c45bcb2e386f6aba870a
a061dee077e0ff67e61f2d2a7a453d7e57cfda27
jim-minter/rp
/vendor/github.com/libvirt/libvirt-go/domain_snapshot_wrapper.go
Go
go
5,650
permissive
/* * This file is part of the libvirt-go project * * 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, m...
1423131cae7e2c10b9a8f198c36db7d9fdb0aa76
696c04179b68d9fa88376a89bd93b44effb72abb
XiaoBoya/pkg
/client/context.go
Go
go
2,611
permissive
/* Copyright 2021 The Katanomi Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
038cd053fe4f00032dc69d084fcff0a3a4a0712e
6e653bcca082eb595c82499fd27efff46dca0fb3
362486122/mindoc
/main.go
Go
go
875
permissive
package main import ( "fmt" "log" "os" _ "github.com/astaxie/beego/session/memcache" _ "github.com/astaxie/beego/session/mysql" _ "github.com/astaxie/beego/session/redis" "github.com/kardianos/service" _ "github.com/mattn/go-sqlite3" "github.com/mindoc-org/mindoc/commands" "github.com/mindoc-org/mindoc/com...
ed054b8ecf62e80b8ce59181a853a8dcf0316886
8324db6b3f921e688f58103e6bdc9efb7b31cc9d
markstokan/cf-for-k8s
/tests/configs/rbac/rbac_test.go
Go
go
2,826
permissive
package rbac_test import ( "encoding/json" "fmt" "io" "io/ioutil" "log" "os" "os/exec" "path/filepath" "strings" "time" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gexec" ) var _ = Describe("RBac", func() { var ( args []string repoDir string outf...
b3205036e9f68effb2aa7b9e88a19b8e29f7a319
3a57623f90b11bd7b27593037cebe8977754ce90
benmj87/gogo-pop3gadget
/src/cmd/main.go
Go
go
1,224
no_license
package main import ( "github.com/benmj87/gogo-pop3gadget/src/client" "github.com/benmj87/gogo-pop3gadget/src/config" "flag" ) // entry point for testing/development func main() { pass := flag.String("Password", "", "Password to auth with") username := flag.String("Username", "", "Username to auth...
2b45363b7966cc7f033ed0310c549996282175f5
2f33c96e9f21132317b9e30e64b4ad5f920e9830
openebs/cstor-operators
/pkg/zcmd/zpool/labelclear/builder.go
Go
go
3,490
permissive
/* Copyright 2019 The OpenEBS 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, sof...
21f4ff5347e9ddf48f624262f286e12bceb7d921
5d4077ab5741908bf8e9dcec201e411f146af1df
ldez/grignotin
/goproxy/errors.go
Go
go
242
no_license
package goproxy import "fmt" // APIError represents an error from the GoProxy. type APIError struct { StatusCode int Message string } func (a *APIError) Error() string { return fmt.Sprintf("error: %d: %s", a.StatusCode, a.Message) }
155962030e886d80d33028a70c581dbec59071ae
cb0d984992a87b5a0277a77e9afb2e203dbc69bb
bpkgoud/pulumi-azure-native
/sdk/go/azure/compute/v20180601/virtualMachine.go
Go
go
7,671
permissive
package v20180601 import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) type VirtualMachine struct { pulumi.CustomResourceState AdditionalCapabilities AdditionalCapabilitiesResponsePtrOutput `pulumi:"additionalCapabilities"` AvailabilitySet SubResou...
965694746a0f78fab10ee33bfbd3352c620d86fc
2da18b947418145c45b1b4e3485b94abdd7be20c
rjmcguire/gitbase
/vendor/gopkg.in/src-d/go-mysql-server.v0/sql/parse/indexes_test.go
Go
go
4,776
permissive
package parse import ( "bufio" "strings" "testing" "gopkg.in/src-d/go-mysql-server.v0/sql/expression" "gopkg.in/src-d/go-mysql-server.v0/sql/plan" "github.com/stretchr/testify/require" errors "gopkg.in/src-d/go-errors.v1" "gopkg.in/src-d/go-mysql-server.v0/sql" ) func TestParseCreateIndex(t *testing.T) { t...
cb41c3a1a0d0dd1c3965ce98d33f8b3c59178432
1e33c07eac0af75e0c3d91b0c774f2fc96b24062
mihaipstef/ergast-go
/ergast/qualifying.go
Go
go
1,709
permissive
package ergast import ( "encoding/json" "github.com/mihaipstef/ergast-go/helpers/request" "github.com/mihaipstef/ergast-go/helpers/common" ) type QualifyingResult struct { common.Result Q1 common.LapDuration `json:"Q1,string,omitempty"` Q2 common.LapDuration `json:"Q2,string,omitempty"` ...
95c0cf0a83ff4f803a1ef46dcb52b0fb6a2ef79e
baab43c3cb0abd22a89fef87d6cfe6fbe5e8fb78
SumoLogic/java-auto-instrumentation-operator
/pkg/controller/javaautoinstrumentationoperator/javaautoinstrumentationoperator_controller.go
Go
go
13,990
permissive
package javaautoinstrumentationoperator import ( "context" "github.com/go-logr/logr" "strings" "time" appv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-r...
34aff7c60135f21cc6a090c1543dfa18fdd29f9d
0e29ae6fa6a22f1de561c877839e0ceff060954d
MDLlife/MDL
/src/visor/blockchain_test.go
Go
go
17,133
no_license
package visor import ( "errors" "testing" "github.com/stretchr/testify/require" "github.com/MDLlife/MDL/src/cipher" "github.com/MDLlife/MDL/src/coin" "github.com/MDLlife/MDL/src/testutil" "github.com/MDLlife/MDL/src/visor/blockdb" "github.com/MDLlife/MDL/src/visor/dbutil" ) var ( genPublic, genSecret = cip...
5ce782b9c34342df8f892c980fb1988b156369fe
8dfd17e1dde9dea4c9a5d090fca4908d1e0f03ab
mrdulin/codewars-go-solutions
/6-kyu/Find the odd int.go
Go
go
378
no_license
/* Given an array of integers, find the one that appears an odd number of times. There will always be only one integer that appears an odd number of times. */ package kata func FindOdd(seq []int) int { var m = make(map[int]int) for _, v := range seq { m[v] += 1 } var r int for k, v := range m { if v...
5bc40e1122220d69f629d679372b1701ebe24546
e0a81599a8ff6be1d4b8339f2abf25198fd15068
dschanoeh/hover-ddns
/publicip/ipify.go
Go
go
1,770
permissive
package publicip import ( "errors" "io" "net" "net/http" "strconv" "time" "go.uber.org/zap" ) const ( url = "https://api.ipify.org?format=text" urlV6 = "https://api6.ipify.org?format=text" numOfRetries = 3 timeout = 1000 ) // IpifyLookupProvider is a public IP lookup provider using t...
3377774f7a164089022407baa14e4f09acd1ebea
4be7ac3f2f034275fbb46293216dd1612a0835a9
jzu/avalanchego
/snow/engine/avalanche/transitive.go
Go
go
20,284
permissive
// (c) 2019-2020, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package avalanche import ( "fmt" "time" "github.com/ava-labs/avalanchego/ids" "github.com/ava-labs/avalanchego/network" "github.com/ava-labs/avalanchego/snow/choices" "github.com/ava-labs/avalanchego/snow/consens...
93fa5e6b0747b733c9dd5b364e418c98123b8347
a18f3b5b9a13f9adaf424639d33f63eb492521cc
intelsdi-x/snap
/mgmt/rest/v1/fixtures/mock_tribe_manager.go
Go
go
9,826
permissive
// +build legacy small medium large /* http://www.apache.org/licenses/LICENSE-2.0.txt Copyright 2016 Intel 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/li...
2a5e0963f3accfd93e1896e523c9d91b04b22fc8
fe33beea7a339c1230c8182d211adfa980c58a35
cloudfoundry/bosh-cli
/cmd/config_test.go
Go
go
5,221
permissive
package cmd_test import ( "errors" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/cloudfoundry/bosh-cli/v7/cmd" . "github.com/cloudfoundry/bosh-cli/v7/cmd/opts" boshdir "github.com/cloudfoundry/bosh-cli/v7/director" fakedir "github.com/cloudfoundry/bosh-cli/v7/director/directorfakes" ...
dbb7d37bf2ae98177124bfc0bcb53502caa221a2
1a8174740075e63c91075c0a978b249d5f59ff2f
skupperproject/skupper
/test/utils/skupper/cli/unexpose.go
Go
go
3,437
permissive
package cli import ( "context" "fmt" "log" "strings" "github.com/skupperproject/skupper/api/types" clientpodman "github.com/skupperproject/skupper/client/podman" "github.com/skupperproject/skupper/pkg/domain/podman" utils2 "github.com/skupperproject/skupper/pkg/utils" "github.com/skupperproject/skupper/test/...
078cf1b784479176a44d093db880c9c2c2a4a461
376a5ab932fbd998ad1241a7c7b60b368e7ca0ba
MiniTeamX/GoProject
/src/api_service/routers/commentsRouter_controllers.go
Go
go
8,201
no_license
package routers import ( "github.com/astaxie/beego" "github.com/astaxie/beego/context/param" ) func init() { beego.GlobalControllerRouter["api_service/controllers:CommodityController"] = append(beego.GlobalControllerRouter["api_service/controllers:CommodityController"], beego.ControllerComments{ Method: "Get...
3beba60f83cc1a4704b6c5aa640827e24191151e
16202bc7a118c4c1bb44f7d6ff9560b1fca42f50
bluestealth/awsiamplugin
/pkg/config/config.go
Go
go
4,237
permissive
/* * Copyright 2021. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing,...
c5b84558d43edac69c5b02ba06201eb17f636a74
89e1c294fb1e6106c53cdf489e382d52aa6e6c73
Dynactionize/pgparser
/parser/parse.go
Go
go
11,291
permissive
// Copyright 2012, Google Inc. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in licenses/BSD-vitess.txt. // Portions of this file are additionally subject to the following // license and copyright. // // Copyright 2015 The Cockroach Authors. // // Use of this s...
5153d2fb192f1c3742fafd70780763f3e45a4152
73f7dfe1cac1944d4ab24521948da8b99bb4f678
Toecuta/traefik
/provider/kubernetes/kubernetes_test.go
Go
go
48,443
permissive
package kubernetes import ( "encoding/json" "errors" "fmt" "reflect" "testing" "github.com/containous/traefik/types" "github.com/davecgh/go-spew/spew" "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/apis/extensions/v1beta1" "k8s.io/client-go/pkg/util/intstr" ) func TestLoadIngresses(t *testing.T) { in...
123a873ab5501211878cb0032f2e7fed1a43ce34
9fe2f86034016505d715c10b01108b55bfa260f3
stevenpeh/greenpack
/testdata/struct_reuse_test.go
Go
go
1,148
permissive
package testdata import ( //"fmt" "testing" cv "github.com/smartystreets/goconvey/convey" "github.com/glycerine/greenpack/msgp" ) func Test010StructReuseDoesNotAllocat(t *testing.T) { cv.Convey("re-using a struct and unmarshalling a nil entry should not re-allocate the member fields", t, func() { v := S2{} ...
6700cedf3e4d2f3ae63702539d3e74ad35434ce3
b04668f862bc8bd2e13b565b2ea2d7a784db93f1
fulldecent/libpod
/cmd/podman/system/events.go
Go
go
3,440
permissive
package system import ( "context" "fmt" "os" "github.com/containers/common/pkg/completion" "github.com/containers/common/pkg/report" "github.com/containers/podman/v4/cmd/podman/common" "github.com/containers/podman/v4/cmd/podman/registry" "github.com/containers/podman/v4/cmd/podman/validate" "github.com/cont...
fb73dd981c9cdbd18853a554b669e3758c893d87
427863cb030dd9e0b53f478759003a27940bfe39
FloatingGhost/goth
/providers/onedrive/onedrive.go
Go
go
4,429
permissive
// Package onedrive implements the OAuth2 protocol for authenticating users through onedrive. // This package can be used as a reference implementation of an OAuth2 provider for Goth. package onedrive import ( "bytes" "encoding/json" "io" "io/ioutil" "net/http" "net/url" "fmt" "github.com/floatingghost/goth"...
af567c71017d3773d6909c60b40dd4a6806d2037
665fffa825a5a943d58a6de77cceb946d84e5f94
arjunrn/clrs
/greedyalgorithms/recursive_activity.go
Go
go
1,425
no_license
package greedyalgorithms import "fmt" func getInputs() ([]int, []int, int) { var numActivities int fmt.Printf("Enter number of activities: ") fmt.Scanf("%d", &numActivities) s := make([]int, numActivities+1) f := make([]int, numActivities+1) s[0] = 0 f[0] = 0 fmt.Printf("Enter start and end times\n") var sta...
af724c822ca947d35da98204a5aca9a96e430646
b9faa3e92237b9a5698aa6037f21c427a7c0fb7d
nshttpd/kube-tools
/cmd/kubetool/actions/configmaps.go
Go
go
2,403
permissive
package actions import ( "github.com/nshttpd/kube-tools/configmap" "github.com/spf13/cobra" ) func init() { RootCmd.AddCommand(cmRootCmd) cmRootCmd.AddCommand(cmGetCmd) cmRootCmd.AddCommand(cmCreateCmd) cmRootCmd.AddCommand(cmDeleteCmd) cmRootCmd.AddCommand(cmUpdateCmd) cmGetCmd.Flags().StringVar(&keyName, "n...
1ca834dbd576fef666ba096b4e513cc89e7357a3
2bf9c1f9109d99a69cb19ca8440fb4d17548c3a7
jeremyshisong/highlego-api
/controllers/admin/usertasks.go
Go
go
4,416
no_license
package controllers import ( "encoding/json" "errors" "github.com/shawncode/highlego-api/models" "strconv" "strings" "github.com/astaxie/beego" ) // oprations for Usertasks type UsertasksController struct { beego.Controller } func (c *UsertasksController) URLMapping() { c.Mapping("Post", c.Post) c.Mapping(...
3344c7a270bdfb1b6d8e335b2a61588cf7726633
8446a23047e52209131f35e6288ac44d3587d05e
barnendu/GO
/024-security/ep024.11-security-token/ex3/bank/main.go
Go
go
612
no_license
package main import ( "encoding/json" "fmt" "io" "net/http" "os" "github.com/sirupsen/logrus" "github.com/urfave/cli/v2" ) var ( accountsDb *AccountsDB ) func main() { app := newApp() accountsDb = &AccountsDB{} accountsDb.init() err := app.Run(os.Args) if err != nil { logrus.Error(err) } } func n...
d1e04afdde85989ca159bb336d5630e9acbfa880
4c3d8ada396d549d1845f99cdd23d008560db02a
jordan83/simhospital
/pkg/hl7/data_types_test.go
Go
go
4,460
permissive
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
86a46c16116a2113d7f8ab19a440501fd42d5aee
adbfc12a5ae7afc47128298349557f0e3382ae52
wfxiang08/overseer
/proc_master.go
Go
go
8,186
permissive
package overseer import ( "encoding/hex" "fmt" cy_utils "github.com/wfxiang08/cyutils/utils" log "github.com/wfxiang08/cyutils/utils/rolling_log" "net" "os" "os/exec" "os/signal" "strconv" "sync" "syscall" "time" "github.com/kardianos/osext" "strings" ) //a overseer master process type master struct { ...
d481ed29857eb40bd3097b0762f2d087e6a5cb3c
400a4b235dd4023a21d074b4e5a2492500c8e7d6
fedetorre/go-rancher
/generator/generator.go
Go
go
5,820
permissive
package main import ( "encoding/json" "io/ioutil" "log" "os" "path" "regexp" "strings" "text/template" "github.com/fedetorre/go-rancher/client" ) const ( CLIENT_OUTPUT_DIR = "../output" ) var ( blackListTypes map[string]bool noConversionTypes map[string]bool underscoreRegexp *regexp.Regexp = regexp...
7d0c54d22b3d9c9bb4751d865655b7fa352b32fc
e1c9c9cbb23da251f1aba18922eb7348dc796caa
C-Dao/linux-bing-wallpaper
/bing-wallpaper.go
Go
go
14,478
no_license
// Author: Marguerite Su <i@marguerite.su> // License: GPL-3.0 // Description: Download Bing Wallpaper of the Day and set it as your Linux Desktop. // URL: https://github.com/marguerite/linux-bing-wallpaper package main import ( "errors" "flag" "fmt" "io" "io/ioutil" "net/http" "os" "os/exec" "os/signal" "p...
8316712b30830694d28ef2c602c38e4dfb556261
00aef891f51ca74427cf7f64c172f875ee190284
PullDakar/vkBot
/main.go
Go
go
812
no_license
package main import ( "io/ioutil" "log" "net/http" "vkBot/cache" "vkBot/cache/domain" ) func messageRouterHandler(w http.ResponseWriter, r *http.Request) { b, readErr := ioutil.ReadAll(r.Body) if readErr != nil { log.Panic("Error while reading response: ", readErr) } msg := &domain.Message{} unmarshalErr...
bdc716050ed0341858b5aab730a22a5c3db97512
0381c4300242a232040be966070d6d677a97636f
kedacore/keda
/vendor/github.com/DataDog/datadog-api-client-go/api/v1/datadog/model_synthetics_assertion_json_path_target_target.go
Go
go
5,947
permissive
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. package datadog import ( "encoding/json" ) // SyntheticsAssertionJSONPathTargetTa...
1d4b0fc4bf45905e420abc02efdb14ba1ae9b415
b3f414b767f69dcc6f58391fd90038f535f4e30f
fayizk1/elastic-log-pusher
/syslog_processor.go
Go
go
7,238
no_license
package main import ( "log" "time" "bytes" "errors" "unicode" "strings" "strconv" "regexp" "math/rand" "encoding/json" ) type Rule struct { Keys []string Keywords string } type SyslogProcessor struct { recieverPipe chan Packet outputPipe chan []byte rules map[string]Rule closeCh chan struct{} } cons...
c0f8de1ac90b90f9af16b7cf60e1246fb2512226
f169b3f84a5a76ab6aa536e64f3bae558ff10398
clickyab/crab
/modules/financial/controllers/set_default.go
Go
go
1,043
no_license
package controllers import ( "context" "net/http" "strconv" "clickyab.com/crab/modules/financial/errors" "clickyab.com/crab/modules/financial/orm" "github.com/clickyab/services/xlog" "github.com/rs/xmux" ) // setGatewayDefault to financial, to set a gateway to default // @Rest { // url = /gateways/:id // ...
1d13f76672e0cea3697d163b8b9ada531ef1ec86
ec751ec3b8c42d1947e302f857aa18c93fbf77ff
hesterhawk/dexter
/src/bootstrap/init.go
Go
go
532
no_license
package bootstrap import ( "io/ioutil" "strings" "helper" "os" ) var config helper.Config func Init() { /* Load main configuration */ config = helper.LoadConfig() /* Clean Bin directory */ CleanDirFromHtml(config.AppPath + "/bin") } func Config() helper.Config { return config } func CleanDirFromH...
d0e70ce73cdb21dc022b25fdd4d9dc44d1ea464b
89643ffed6d5909be3dd6d853fdebad724e92744
sgtest/monorepo-test-3
/kubernetes-10/examples/https-nginx/make_secret.go
Go
go
2,067
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, ...
df8bbeef5057f73f27e26ec89cf6669905321dc2
dc7ac40db73d342a1380f47f9c76a58c14e37d2d
si3nloong/sqlike
/examples/find.go
Go
go
11,056
permissive
package examples import ( "context" "encoding/json" "sort" "strconv" "testing" "time" "cloud.google.com/go/civil" "github.com/google/uuid" "github.com/si3nloong/sqlike/sql/expr" "github.com/si3nloong/sqlike/sqlike" "github.com/si3nloong/sqlike/sqlike/actions" "github.com/si3nloong/sqlike/sqlike/options" ...
f04d3589aee7b4f2d2690d43161f6fc47dd63d12
70be78ec82439aa6c9756ac509c765188e349b39
kensipe/goreleaser
/internal/pipe/archive/archive.go
Go
go
7,456
permissive
// Package archive implements the pipe interface with the intent of // archiving and compressing the binaries, readme, and other artifacts. It // also provides an Archive interface which represents an archiving format. package archive import ( "fmt" "os" "path/filepath" "reflect" "strings" "sync" "github.com/a...
033e589c013ddc4d409b37edc80b872746b4e556
6c05ca428165ba50454c3e6e94e78cd05dc44a52
Sirmorrison/godcr-gio
/ui/page/components/votebar_widget.go
Go
go
8,293
permissive
package components import ( "fmt" "image" "image/color" "strconv" "gioui.org/layout" "gioui.org/op/clip" "gioui.org/op/paint" "gioui.org/text" "gioui.org/unit" "github.com/planetdecred/dcrlibwallet" "github.com/planetdecred/godcr/app" "github.com/planetdecred/godcr/ui/decredmaterial" "github.com/planetd...
8fbb970d0da50e8b93d0d4b3dd6860597e5525e7
a299893136b40b124b57e4f069c3283f1cbee436
micruzz82/snap
/core/cdata/node_test.go
Go
go
2,847
permissive
// +build legacy /* http://www.apache.org/licenses/LICENSE-2.0.txt Copyright 2015 Intel 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...
053d1779de5824e9f112e1b5b9599d2101ffdb6f
df627245ce2f54db2da767ee857d2cdebe5ef555
kubernetes/autoscaler
/cluster-autoscaler/cloudprovider/oci/vendor-internal/github.com/oracle/oci-go-sdk/v65/core/update_launch_options.go
Go
go
9,147
permissive
// Copyright (c) 2016, 2018, 2023, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
a41ca0c0d5670c13c55a9de5e44a82b6f864e308
1d0c1d5ae8dedd51142e55e95726b70328738296
theantichris/go-win-tracker
/server_test.go
Go
go
4,595
no_license
package poker_test import ( "github.com/gorilla/websocket" poker "github.com/theantichris/go-win-tracker" "net/http" "net/http/httptest" "strings" "testing" "time" ) var dummyGame = &GameSpy{} func TestGETPlayers(t *testing.T) { store := StubPlayerStore{ map[string]int{ "Pepper": 20, "Floyd": 10, ...
0ee253fd1bba54d65042e576055901c3b5e87d2c
dee26018b2810f25459fc999c261bfb989a6af3c
adam-hanna/lotus
/cli/wallet_test.go
Go
go
9,755
permissive
// stm: #unit package cli import ( "context" "encoding/hex" "encoding/json" "fmt" "testing" "github.com/golang/mock/gomock" "github.com/ipfs/go-cid" "github.com/multiformats/go-multihash" "github.com/stretchr/testify/assert" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-ty...
f530717b993e05134960d754fcc31ea5e5c3e6da
35e6d2abfad91f0e4dd3c5cd0ac278c8233c695f
xiak/sofa-mosn
/pkg/proxy/downstream.go
Go
go
26,848
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 ...
2799162a8eaa9673e4036c2634aa0e84431e58c4
84aa787670cac06112cb540340187ad61ebcfa2c
stsully/oci-go-sdk
/dataintegration/flow_port.go
Go
go
2,683
permissive
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
3c840d5d20f2a5c84800ca4333708a4af70eced2
8821b2da757d98870926c2cf186e57b43a0f3ec0
narenrana/cnm-retail
/cnm-users/repository/users-repository.go
Go
go
1,184
no_license
package repository import ( core "shopping-cart/cnm-core" e "shopping-cart/cnm-users/entities" ) type UsersRepository interface { List() ([]e.UserDetails,error) FindBy(u e.UserDetails) (e.UserDetails, error) Add(u e.UserDetails) (e.UserDetails, error) Delete(u e.UserDetails) (e.UserDetails, error) } type us...
fedee40e12980f8cc6d77e3a7aae30602585ff62
5b785c67b5b69d9f0e8d6976b7435be888001af6
samarthdd/go-k8s-process
/rebuildexec/gwcli.go
Go
go
11,427
permissive
package rebuildexec import ( "archive/zip" "bytes" "fmt" "io/ioutil" "log" "math/rand" "net/http" "os" "os/exec" "path/filepath" "strings" "sync" "time" "github.com/go-ini/ini" "github.com/k8-proxy/go-k8s-process/events" zlog "github.com/rs/zerolog/log" ) const ( APP = "glasswallCLI" CON...
4a2ce947b039b56cccade71b65c63860aadde049
ddd149d8d9f1c23b17d67f5f8b9793cca23e84e3
Sparksfire/lotus
/metrics/metrics.go
Go
go
24,007
permissive
package metrics import ( "context" "time" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "go.opencensus.io/tag" rpcmetrics "github.com/filecoin-project/go-jsonrpc/metrics" "github.com/filecoin-project/lotus/blockstore" ) // Distribution var defaultMillisecondsDistribution = view.Distribution(0.01, 0...
affc4e1230d5e1456b62197bef5af9b4dedc53e8
c5905d1bf51495c930f4617fd774a7d5111bf172
ProjectZeroDays/wecty
/cmd/wecty/commands/generate/converter.go
Go
go
4,911
permissive
package generate import ( "fmt" "io" "log" "regexp" "strings" "golang.org/x/net/html" ) var prop = regexp.MustCompile(`{{([a-zA-Z0-9().]+)}}`) func replaceValue(s string) (string, bool) { props := prop.FindStringSubmatch(s) if len(props) > 1 { return props[1], true } return s, false } // Converter ... ...
f294a693992cbc7850f20c3fd9a6ad742b26571f
82db137e031c1428fbd727d3cd0f4cc986c45b43
fossabot/omgo
/kit/mt19937/mt19937_test.go
Go
go
226
permissive
package mt19937 import ( "testing" ) func TestNextInt32(t *testing.T) { expect := []int32{-1937831252} ctx := NewContext(0) got := ctx.NextInt32() if got != expect[0] { t.Error("expect:", expect[0], "got:", got) } }
27e62ff6939c6eacc0741afddef496d5c44775f6
0ffc25d1d9da7f67f1aa064d7b6fd9c501397c4f
am29/stack-assembly
/tests/feature_test.go
Go
go
14,058
permissive
// +build acceptance package tests import ( "bytes" "context" "encoding/json" "errors" "flag" "fmt" "io/ioutil" "math/rand" "os" "os/exec" "path/filepath" "regexp" "strconv" "strings" "sync" "testing" "text/template" "time" expect "github.com/Netflix/go-expect" "github.com/aws/aws-sdk-go/aws" "g...
55316f93d0b74a84786d4e92eec79f5145cf3ed8
6e2e9958f26ee899db75e39011541efeaff09ab1
aintsashqa/go-simple-blog
/internal/app/app.go
Go
go
3,053
no_license
package app import ( "context" "os" "os/signal" "syscall" "github.com/aintsashqa/go-simple-blog/internal/config" "github.com/aintsashqa/go-simple-blog/internal/delivery/http" "github.com/aintsashqa/go-simple-blog/internal/repository" "github.com/aintsashqa/go-simple-blog/internal/serializer" "github.com/aint...
ff39b2db4285927378f8485b3c957015e5824ac0
59a89c5bf91c408bec31ed5764c0d14f84198d85
golangbr/golangbr.org
/format.go
Go
go
10,794
permissive
// 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. // This file implements FormatSelections and FormatText. // FormatText is used to HTML-format Go and non-Go source // text with line numbers and highlighted sec...
705ecb4b37c748d0ca2759e2fda15ac8bca1560b
926ffa511c91e877e7b410d78a701300b2147e37
Argeniss-Software/rolaguard_engine
/analyzers/rolaguard_bruteforce_analyzer/lorawanwrapper/utils/lorawanWrapper.go
Go
go
21,498
permissive
//lorawanWrapper.go package main import "C" import ( "bytes" "fmt" "os" "time" "unsafe" . "github.com/matiassequeira/lorawan" log "github.com/sirupsen/logrus" ) //export marshalJsonToPHYPayload func marshalJsonToPHYPayload(jsonPointer *C.char, keyPointer *C.char, nwkskeyPointer *C.char) *C.char { var jsonS...
913cfcbf83ab0c26abf145b403f6e8ae14688ebe
ed6a31a89f65dead12a7292e8e500088b9693b15
john-kheir/core0
/base/builtin/bash.go
Go
go
203
permissive
package builtin import "github.com/g8os/core0/base/pm" func init() { pm.RegisterCmd("bash", "sh", "", []string{ "-c", "T=`mktemp` && cat > $T && sh $T; EXIT=$?; rm -rf $T; exit $EXIT", }, nil) }
77474ce566e2bdc7db6bec2911876fbb4e163b92
1d9d25f0e75d685a8ed1a0d1fa6f9425757e4569
hardikdr/gardener
/pkg/controller/shoot/shoot_utils.go
Go
go
2,036
permissive
// Copyright 2018 The Gardener 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...
e8536b00ed3f7e5c4f64afca488c814212b9fde8
cdb1f759e17352a7d7b75df6635fffe0cc886b34
andrew-d/aiacert
/main.go
Go
go
2,544
no_license
package main import ( "bytes" "crypto/tls" "crypto/x509" "encoding/pem" "io" "io/ioutil" "log" "net" "net/http" "os" "time" ) func main() { log.SetFlags(log.LstdFlags | log.Lmicroseconds | log.LUTC) log.Printf("started") defer log.Printf("finished") roots, err := loadSystemRoots() if err != nil { l...
a9145c7842388226bc0d5a3db2bbde8c7acf8fb1
5feb60943903e4f648d75387f44c05165d51488c
uber/kraken
/lib/backend/shadowbackend/client.go
Go
go
6,661
permissive
// Copyright (c) 2016-2020 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
16dbceed0898db06147c38c4c2f30834ebae36ff
be7b3cf44180fd35b823a591cbef93d9babccd35
roboticeyes/gorexos
/coreapi/locationgraph.go
Go
go
5,239
permissive
package coreapi import ( "encoding/json" "fmt" "io" "strings" "github.com/breiting/tree" "github.com/roboticeyes/gorexos" ) // LocationGraph contains everything for getting information about the location graph in REXos type LocationGraph struct { ProjectUrn string ProjectType string Tree *tree.No...
781c454e6cf0e94729eb8e9a0d378d89112f2fcf
6478637cd94c3b0856f23f863502a3bbd3f2fe5e
makiuchi-d/gozxing
/multi/qrcode/detector/multi_detector_test.go
Go
go
2,039
permissive
package detector import ( "testing" "github.com/makiuchi-d/gozxing" ) func TestMultiDetector_DetectMulti(t *testing.T) { hints := make(map[gozxing.DecodeHintType]interface{}) img, _ := gozxing.NewBitMatrix(10, 10) det := NewMultiDetector(img) _, e := det.DetectMulti(hints) if _, ok := e.(gozxing.NotFoundExce...
499c838db2f44b161c8e63c4d522c7ea6928a6df
385fc0b72b0631d55d6fd65ac5847d31ea15d66a
niedbalski/files-sdk-go
/as2key.go
Go
go
1,739
permissive
package files_sdk import ( "encoding/json" "time" lib "github.com/Files-com/files-sdk-go/lib" ) type As2Key struct { Id int64 `json:"id,omitempty"` As2PartnershipName string `json:"as2_partnership_name,omitempty"` CreatedAt time.Time `json:"created_at,omitempty"` Fingerprint ...
b80349086a8a709d7ddbc4159ecfbd09c4c914e1
8067136629270ba1ad6425a05a31bf6450eb91c3
katoozi/go-practices
/cross_compilation/main.go
Go
go
498
no_license
package main import ( "fmt" "runtime" ) func main() { fmt.Print("You are using ", runtime.Compiler) fmt.Println(" on a", runtime.GOARCH, "machine") fmt.Println("with Go version", runtime.Version()) // complie the application // GOARCH: amd64, arm, 386 // GOOS: linux, windows, darwin(for macos) // linux: GOO...
52c76d5913b1ce811840a74730c15def1921c283
99b7789a4183342c1e1d1b0eeb683e48f9b199fa
sachin147/Gophering
/hello/compostion2.go
Go
go
325
no_license
package main import "fmt" type User struct { Id int Name, Location string } func (u *User) Greeting() string { return fmt.Sprintf("Hi %s from %s ", u.Name, u.Location) } type Player struct { User GameId int } func main() { p := Player{} p.Id = 42 p.Name = "matt" p.Location = "LA" fmt.Println(p.Greeting(...
261f1957ac91ae6baa17cfa4ffd1e1d12c2bc3ec
faa1e461063d90884e4783381a8f4edb85e828e8
mikespook/possum
/view/view.go
Go
go
364
permissive
package view import "net/http" const ( ContentTypeJSON = "application/json" ContentTypeHTML = "text/html" ContentTypePlain = "text/plain" ContentTypeBinary = "application/octet-stream" CharSetUTF8 = "utf-8" ) // View is an interface to render response with a specific format. type View interface { Render(...
02d316168e2c1bf342f65777e2f5c8cf23ca7f1c
148440b808a9928ba5594ce6b4695fcd37807cc1
scramble-suit/keysig
/keylogger/keylogger_linux.go
Go
go
274
no_license
package keylogger import ( "github.com/rikonor/keysig/keylogger/keyboard" "github.com/rikonor/keysig/keylogger/linuxkeylogger" ) func NewKeylogger(outputChannel *chan keyboard.ButtonEvent) *linuxkeylogger.Keylogger { return linuxkeylogger.NewKeylogger(outputChannel) }
160bbd6df3a1cd5de8d5239b1d7dcac5079bd457
f60c7c5c01bdba846b707a56df674c2c6314284b
ngld/knossos
/packages/libknossos/pkg/platform/voices_windows.go
Go
go
555
permissive
package platform /* #include <stdlib.h> struct voice_list { unsigned long count; char** names; }; struct voice_list get_voices(); #cgo LDFLAGS: -lole32 -lsapi */ import "C" import ( "context" "unsafe" ) func GetVoices(ctx context.Context) ([]string, error) { list := C.get_voices() result := make([]string,...
e466336fd1ce327ff9a014593ba083a88bf645d5
341dbcbc80a23396838426de348eb4b20d5e3ac1
kevinwhzou/bazelisk
/bazelisk.go
Go
go
24,183
permissive
// Copyright 2019 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
f59660d4d0756de8a8f63902b6f69097a62bb8ff
d8b7d1317200e836ed438deb9a3597c772d9bfa8
0x5010/go-leetcode
/0922_sort_array_by_parity_ii/sort_array_by_parity_ii.go
Go
go
230
no_license
package leetcode0922 func sortArrayByParityII(A []int) []int { n := len(A) for i, j := 0, 1; i < n; i += 2 { for j < n && A[j]%2 == 1 { j += 2 } if A[i]%2 == 1 { A[i], A[j] = A[j], A[i] j += 2 } } return A }
ae24fa0f7e12f5141ec774d305de46249867164e
cca3c5cad5a11297abfdae23a205a9ed815fdd82
kwokhunglee/micro
/util/_http/http_test.go
Go
go
1,373
no_license
package http import ( "io/ioutil" "net" "net/http" "strconv" "testing" "github.com/kwokhunglee/micro/registry" "github.com/kwokhunglee/micro/registry/mock" ) func TestRoundTripper(t *testing.T) { m := mock.NewRegistry() rt := NewRoundTripper( WithRegistry(m), ) http.HandleFunc("/", func(w http.Respons...
9247352308b0fb5cc1b2c29ba981d69ece410bb6
e434af56cb1caf5cdb0c42b8cf38b8536e758455
goodking-bq/go-star-net
/core/client.go
Go
go
1,106
no_license
package core import ( "fmt" "log" "net" "sync" ) type Connect struct { Host string Port string } func (c Connect) String() string { return c.Host + ":" + c.Port } type ClientConfig struct { Connections []Connect `json:"connections" yaml:"connections"` } type Client struct { connections sync.Map //链接 } fu...
bde695d6d6d4caed552a6f56972f874782d08991
0eb285bcae3ecfb87ca05f638d81b1127315f3cb
thatique/awan
/auth/user/user.go
Go
go
1,727
no_license
package user // Info is information about an user type Info interface { // GetUsername returns the name that uniquely identifies this user among all // other active users. This can be an email GetUsername() string // GetUID returns a unique value for a particular user that will change if // the user is removed f...
67634a68ed00887de31cfc99a65ebb37363c1a23
8ebd1e75899d7e1eccec786ae5e42a575d99db06
uileyar/samples
/booking/app/models/booking.go
Go
go
2,682
no_license
package models import ( "fmt" "regexp" "time" "github.com/go-gorp/gorp" "github.com/revel/revel" ) type Booking struct { BookingId int UserId int HotelId int CheckInStr string CheckOutStr string CardNumber string `db:", size:16"` NameOnCard string `db:", size:50"` CardExpMonth int ...
cfeaf379bddfefa5c46694312e2a61229914d18a
0e2fb561f71236234c04a9f78beaee1baaa6771f
webdevops/azure-devops-exporter
/azure-devops-client/query.go
Go
go
777
permissive
package AzureDevopsClient import ( "encoding/json" "fmt" "net/url" ) type Query struct { Path string `json:"path"` } type WorkItemInfoList struct { List []WorkItemInfo `json:"workItems"` } type WorkItemInfo struct { Id int `json:"id"` Url string `json:"url"` } func (c *AzureDevopsClient) QueryWorkItems(...
b3fd7283c7d5bf114c9fd1b83bc83738d80efdc1
fb5e5980e81f87abc03e655e0f93391e8c80d150
SeldonIO/seldon-operator
/vendor/golang.org/x/tools/internal/lsp/cache/view.go
Go
go
7,149
permissive
// Copyright 2018 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 cache import ( "context" "go/token" "go/types" "os" "sync" "golang.org/x/tools/go/packages" "golang.org/x/tools/internal/lsp/source" "golang.o...
0f6dbef58363364c8f806f1ba84eab6afe00a663
82f0e3c344c9089c28ad8d342f50c80aec1349f2
bnchain/bnchain
/vendor/github.com/33cn/chain33/system/dapp/commands/version.go
Go
go
730
permissive
// Copyright Fuzamei Corp. 2018 All Rights Reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package commands 系统级dapp相关命令包 package commands import ( "github.com/bnchain/bnchain/rpc/jsonclient" "github.com/bnchain/bnchain/types" "github.com/spf13/co...
f1f009aa612fb4c6be0f3129cf358f676a77920b
b6d44c5ec33f263847ed4c46d778cdf9cf8a0c64
pioneer-hash/apisix-ingress-controller
/pkg/kube/translation/ingress_test.go
Go
go
22,238
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 not...