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 |
|---|---|---|---|---|---|---|---|---|
923b26c7353c365454db0c45f36d53f9182f02cd | fb229ff9b46c71a5ba07bcd424b83fe1f75a1097 | ttreptow/kustomize-controller | /controllers/kustomization_gc.go | Go | go | 3,698 | permissive | package controllers
import (
"context"
"fmt"
"time"
"github.com/go-logr/logr"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/client"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1alpha1"
)
type KustomizeGarbageColl... |
451bd8d4c8b9b1660b09d3001f8d2ef4f06ecd6f | 4ee8426cea91e0a13b0ebd0fe5b1ee5cb73beeaa | tangwenwen/Rss | /Rss/Golang_code/handle/movieHandle/movie.go | Go | go | 2,437 | no_license | package movieHandle
import (
"RSs/dao/userDao"
"RSs/models/movieModel"
"RSs/plugins/etcd"
"RSs/types"
usersType "RSs/types/users"
"encoding/json"
"github.com/emicklei/go-restful"
"strconv"
)
type Movie struct {
}
func (e *Movie) GetAllMovieList(req *restful.Request, rsp *restful.Response) {
defer func() {
... |
01e6355a35235aed39754d04007390a415dcc92a | f6e314021bb69c16cd665ba4e94820622f33569e | QiJune/kubedl | /controllers/xgboost/xgboostjob_controller.go | Go | go | 7,303 | permissive | /*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is ... |
13c0723c109bd4c7b0c9751c0fd09a66e13bce5d | 491d5b3617f5ca9e6100367b69981b105e49b9f9 | uxff/thrifthive | /example/example1.go | Go | go | 3,093 | no_license | /*
connect thrift, use odbc protocol
*/
package main
import (
"flag"
"fmt"
"math/rand"
"time"
"log"
//gohive "github.com/uxff/thrifthive/gohive" // for thrift
//gohive "github.com/weigj/go-odbc" // for odbc
pool "github.com/silenceper/pool"
gohive "github.com/uxff/go-odbc"
//pool "gop... |
f1aff562beec1f4c83dd4689107b67dbbbc1e5c6 | 9654d1e69825c3e08278ab736e014e702b89247c | N-Vitas/metafora-bot-service | /config/main.go | Go | go | 539 | no_license | package config
import (
"encoding/json"
"os"
)
// Conf Структура конфигурации сервиса
type Conf struct {
DBUSER string `json:"dbuser"`
DBPASS string `json:"dbpass"`
DBHOST string `json:"dbhost"`
DBPORT int64 `json:"dbport"`
DBNAME string `json:"dbname"`
}
// New получение конфигурации
func New() (*Conf, erro... |
11a7499923e4fce1181ddc93d0f5fd88d147c1b8 | 5ed83a1524d0eaf1f4a7ca50ef06b2cce114faad | alindenberg/adventOfCode | /day16.go | Go | go | 1,843 | no_license | package main
import (
"fmt"
"math"
"strconv"
)
func main() {
input := "597198117423867120723225095505739674216475653326673671843889973352923498529541133438047871026046640962884401354722843083733262458775939561992255160712108827286142928711317651104169998174601409558563388301180609884970973243349625433892889795350... |
5218483d7ba9e0adbba054f560f8851b5c269ba5 | 36c62b62f9e5c14d3288cfa69d60d3bb3c72d5af | tiaanl/evolve-go | /column.go | Go | go | 1,983 | permissive | package evolve
type ColumnType int
const (
ColumnTypeString ColumnType = iota
ColumnTypeInteger
ColumnTypeFloat
ColumnTypeDateTime
)
type Column struct {
Name string
Type ColumnType
Size int
AllowNull bool
IsPrimary bool
AutoIncrement bool
}
func (c *Column) WithName(nam... |
dd71fdfa12a097e16aac660915e57cb99636e36b | b4e4381ac815460c2d68677d259808572306ab0e | PIERRONMarc/HETIC_Library | /app/services/apiHelper.go | Go | go | 691 | no_license | package services
import (
"encoding/json"
"hetic-library/services/elasticsearch"
"io/ioutil"
"net/http"
)
func HttpResponseToJson(response *http.Response) (map[string]interface{}, error) {
defer response.Body.Close()
bodyBytes, _ := ioutil.ReadAll(response.Body)
var jsonResponse map[string]interface{}
err :=... |
77ebb238104705464420ca331548b9367d3f34a0 | adf1357be88a62415f838ea80aa4948d12f46bde | daeira/walker | /graph.go | Go | go | 1,918 | no_license | package walker
import (
"errors"
"fmt"
"regexp"
)
type Dependency struct {
DirRegexp *regexp.Regexp
DepRegexp *regexp.Regexp
Dirs []string
Deps []string
}
func (d *Dependency) match(directory string) {
if len(directory) == 0 {
return
}
if d.DirRegexp.Match([]byte(directory)) {
d.Dirs = append... |
77d38b7c65a869b5702002860fedce4d1f4af6e0 | 97a36c548aec9bdb8327f84145852db26f600ae2 | Digital-Native-Business-Flow/backend | /server/config.go | Go | go | 907 | no_license | package server
import (
"backend/internal"
"strings"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/fiber/v2/middleware/recover"
)
func configureFiber(app *fiber.App) {
// Configure panic recovery
app.Use(recover.New())
// Configure logging
app.Use(func(c *f... |
d99fa2522a680b2243680f435cef6dee0662d107 | 686b779fff7d8592a23de2ef54192acf85d074fc | DucThanh1997/Gin-API-JWT | /models/Student.go | Go | go | 896 | no_license | package Models
import (
"Gin-API-JWT/Config"
"fmt"
_ "github.com/go-sql-driver/mysql"
)
func GetAllStudent(b *[]Student) (err error) {
if err = Config.DB.Find(b).Error; err != nil {
return err
}
return nil
}
func AddNewStudent(b *Student) (err error) {
if err = Config.DB.Create(b).Error; err != nil {
retu... |
59cd052fe5acfd0c0f6391bcbec471bf8db32da3 | ac939f2f6148199d1a7f385d4efb623473fe6c67 | fanky5g/jobsghana | /web/server/api/handlers/resume_search.go | Go | go | 1,879 | permissive | package handlers
import (
"encoding/json"
"net/http"
"time"
"github.com/fanky5g/xxxinafrica/web/server/auth"
"github.com/labstack/echo"
)
// FindResume searches resumes based on user query sent
func (h *Handlers) FindResume(c echo.Context) error {
start := time.Now()
query := c.QueryParam("query")
location :... |
cb19a4a21c5ee83731d0f2c0269a3aea9efdbe36 | b69cb44955af6b342a7e42dffdc8ac7f7698893d | ObserverYu/rod | /lib/examples/disable-window-alert/main.go | Go | go | 852 | permissive | package main
import (
"fmt"
"net/http"
"github.com/go-rod/rod"
"github.com/go-rod/rod/lib/utils"
)
func main() {
go serve()
browser := rod.New().MustConnect()
defer browser.MustClose()
// Creating a Page Object
page := browser.MustPage("")
// Evaluates given script in every frame upon creation
// Disab... |
ef863f3ee94b452f17ac487d0e7233de0e85becd | d42b6949d786f4e0200e22b35cf76cc294dc1c26 | maxence-charriere/go-app | /pkg/app/js.go | Go | go | 7,874 | permissive | package app
import (
"net/url"
)
const (
// isClientSide = runtime.GOARCH == "wasm" && runtime.GOOS == "js"
)
// Type represents the JavaScript type of a Value.
type Type int
// Constants that enumerates the JavaScript types.
const (
TypeUndefined Type = iota
TypeNull
TypeBoolean
TypeNumber
TypeString
TypeSy... |
6b0ab59dcb8209d01c946e1a601f7bf038b1a40f | c4d49d93ab27b67cfdb840e2804455703c241ed7 | housinganywhere/graphql | /executor_resolve_test.go | Go | go | 7,181 | permissive | package graphql_test
import (
"encoding/json"
"github.com/housinganywhere/graphql"
"github.com/housinganywhere/graphql/testutil"
"reflect"
"testing"
)
func testSchema(t *testing.T, testField *graphql.Field) graphql.Schema {
schema, err := graphql.NewSchema(graphql.SchemaConfig{
Query: graphql.NewObject(graphq... |
13a19e569503a52caab4fff97a13213bacb4a60e | 4102717cc87a0922d563a9f1d5425414845e57c9 | moshe0076/istio | /pilot/pkg/proxy/envoy/v2/cds.go | Go | go | 6,311 | permissive | // Copyright 2018 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
9220415c9b8da39b9b00e24f3a735724cab1c7cb | 9256471b2dcfe6198bf93df4908a979334eabf38 | paruru48/google-api-go-client | /webfonts/v1/webfonts-gen.go | Go | go | 11,781 | permissive | // Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package webfonts provides access to the Google Fonts Developer API.
//
// For product documentation, see: https://developers.google.com/fonts/do... |
73cd35a3baf562c7af4d2df39e8b73e6a3d2b759 | a8a75e19715cb2a68bbe93ccb4525f1054708328 | raflisb/go-blog-api | /internal/app/service/account.go | Go | go | 5,179 | permissive | package service
import (
"context"
"database/sql"
"time"
"github.com/anonychun/go-blog-api/internal/app/model"
"github.com/anonychun/go-blog-api/internal/app/repository"
"github.com/anonychun/go-blog-api/internal/constant"
"github.com/anonychun/go-blog-api/internal/logger"
"github.com/anonychun/go-blog-api/in... |
b2e4a1321743ca3e03316641491d3673a2636a90 | 56fee5a4fe066052f38f6a870d79c9080fded9d6 | azylinski/boskos | /ranch/ranch.go | Go | go | 15,200 | 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, ... |
708b761f706ceefa2ee617394e1fcf0488e9cfd1 | 65fb48da4a3ee2496624b9399832d7ffc6688b94 | 0xflotus/beam | /src/github.com/ebay/beam/tools/grpcbench/main.go | Go | go | 5,155 | permissive | // Copyright 2019 eBay Inc.
// Primary authors: Simon Fell, Diego Ongaro,
// Raymond Kroeker, and Sathish Kandasamy.
//
// 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
// ht... |
60bfdfc7c2a1272cd09dce62a0e4a8cd39206886 | 8c3d9c282b48b2f846ca59e4c9ec389aab07444f | xuanjiang1985/concurrent | /main.go | Go | go | 3,360 | no_license | package main
import (
"context"
"github.com/andlabs/ui"
_ "github.com/andlabs/ui/winmanifest"
"net/http"
"regexp"
"strconv"
"strings"
"time"
)
var mainwin *ui.Window
var msgEntry *ui.MultilineEntry
func myUi() ui.Control {
vbox := ui.NewVerticalBox()
vbox.SetPadded(true)
hbox := ui.NewHorizontalBox()
... |
b25ee0bbe42e796ea771914031a973c6c5d13266 | 7a665e2e7b050bde31f17e2fe87b9a7a49e82dd6 | PierreRochard/loop | /loopdb/loopin.go | Go | go | 4,922 | permissive | package loopdb
import (
"bytes"
"encoding/binary"
"fmt"
"time"
"github.com/coreos/bbolt"
"github.com/lightninglabs/loop/labels"
"github.com/lightningnetwork/lnd/routing/route"
)
// LoopInContract contains the data that is serialized to persistent storage for
// pending loop in swaps.
type LoopInContract struc... |
876d713e07c7dbd957cc72d5685a46acc17deafc | 9427efe24da03e71e9dd49c610b067baecc1726c | vladiskuz/magma | /symphony/graph/ent/surveytemplatequestion_delete.go | Go | go | 2,506 | permissive | // Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated (@generated) by entc, DO NOT EDIT.
package ent
import (
"context"
"github.com/facebookincubator/ent/dialect/sql"
"github.com/facebo... |
ef7314f3b6346fe76feb55531a510b4da77b96a4 | 1db46996d85f7e2aff3ea6ace13ef52c18475e40 | musobarlab/gorengan | /api/graphql/loader.go | Go | go | 1,061 | permissive | package schema
import (
"errors"
"io/ioutil"
"strings"
)
// LoadGraphQLSchema will read graphql schema from file
func LoadGraphQLSchema(version string) (string, error) {
switch version {
case "v1":
return loadV1Schema()
}
return "", errors.New("error loading graphql schema")
}
func loadV1Schema() (string, ... |
294347212264202a1aa658f81026924766ab2883 | d8b9bc6f12af71d588bdb7e32e6f98484018f8b5 | chainopen/MatrixChainCode | /params/enstrust/entrust.go | Go | go | 2,352 | permissive | // Copyright (c) 2018 The MATRIX Authors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php
package entrust
import (
"errors"
"fmt"
"sync"
"github.com/MatrixAINetwork/go-matrix/accounts"
"github.com/MatrixAINetwork/go-matrix/b... |
cfebdfda80b6decb92f85890d22bdd1e83725e75 | e3f8576f62481eef6b6ee9225ce503416133d993 | gitter-badger/vox-3 | /request.go | Go | go | 1,776 | permissive | package vox
import (
"net/http"
)
// A Request object contains all the information from current HTTP client.
//
// Request embedded the current request's raw *http.Request as it's field, so you
// can using all the fields and method of http.Request. see http://golang.org/pkg/net/http/#Request.
type Request struct {
... |
5dc60cb53091b12cb0bb848c501c29d514a8a6d9 | d1663269eaefd93d15ad6597e3b97b594cfc0433 | chclaus/dt | /cmd/html/html.go | Go | go | 2,348 | permissive | // Copyright © 2018 Christian Claus <ch.claus@me.com>
//
// 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, modif... |
67147783b6da227bf94d44e352c7b8f477a4e41f | 55837db22fefd6133b3bb40c5cbddc851025849b | ValchanOficial/GolangAlura | /GolangWeb/db/db.go | Go | go | 434 | permissive | package db
import (
"database/sql"
"log"
_ "github.com/lib/pq"
)
//Conecta : conecta com o Banco De Dados
func Conecta() *sql.DB {
conn := "user=postgres dbname=alura_loja password=root host=localhost sslmode=disable"
db, err := sql.Open("postgres", conn)
checkErr(err)
log.Println("[Database] - ... |
2d0ea2da64cfb431840225f721b7a2f71f1d51da | 084f50fcfc8dcd2ad32393adc5a12d573cf1b03e | a-andreyev/canopus | /request_test.go | Go | go | 661 | permissive | package canopus
import (
"github.com/stretchr/testify/assert"
"net"
"testing"
)
func TestRequest(t *testing.T) {
var req CoapRequest
assert.NotNil(t, NewRequest(MessageConfirmable, Get, 12345))
msg := NewMessage(MessageConfirmable, Get, 12345)
req = NewRequestFromMessage(msg)
assert.NotNil(t, req)
assert.... |
28f2dd7dbc6b8b1d2d89c21f271a3e9bded82c2e | d3b7d43db0fb14fba5022a3c9b364c9155e47529 | cdvoisin/gval | /parse.go | Go | go | 7,168 | permissive | package gval
import (
"context"
"fmt"
"reflect"
"strconv"
"text/scanner"
)
//ParseExpression scans an expression into an Evaluable.
func (p *Parser) ParseExpression(c context.Context) (eval Evaluable, err error) {
stack := stageStack{}
for {
eval, err = p.ParseNextExpression(c)
if err != nil {
return ni... |
9ae6d7bb3ba09e8dced86ff6dd7e220c3aa7b2a7 | c1854249206445dfb7f772231b8edbc4f55cfac4 | qiang0723/inkchain | /core/chaincode/shim/chaincode.go | Go | go | 35,595 | permissive | /*
Copyright IBM Corp. 2016 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 wri... |
eb9a67db4370353076bc80c6a0453fe2b54f1831 | 7eec322a766fd494632b9abe1509f8eab9dd7ffc | mieciu/cloud-sdk-go | /pkg/api/http_transport_test.go | Go | go | 2,641 | 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 ... |
5bafa20a16778631275a18b0d5aefd3adf499b99 | c548c62ca74fc62c00df54346e752976d8dc6187 | mochen302/studygo | /src/main/PointerValueTest.go | Go | go | 266 | no_license | package main
import "fmt"
type B struct {
thing int
}
func (b *B) change() { b.thing = 1 }
func (b B) write() string { return fmt.Sprint(b) }
func main() {
var b1 B
b1.change()
fmt.Println(b1.write())
b2 := new(B)
b2.change()
fmt.Println(b1.write())
}
|
1479fac34a45eee048469416ce75d54b6397664a | 3e906d4d628e191f20695b149eb355a54d70c0f7 | spiffe/spire | /pkg/server/bundle/client/updater.go | Go | go | 4,875 | permissive | package client
import (
"context"
"errors"
"fmt"
"sync"
"github.com/spiffe/go-spiffe/v2/bundle/spiffebundle"
"github.com/spiffe/go-spiffe/v2/spiffeid"
"github.com/spiffe/spire/pkg/common/bundleutil"
"github.com/spiffe/spire/pkg/server/datastore"
"github.com/zeebo/errs"
)
type BundleUpdaterConfig struct {
T... |
0737c735a74f5ba2da78c3c9a779871fd71de0b6 | 5f4d7715cf7326fcbfe1f16286b85c289029f648 | isabella232/dubbo-go | /config/config_loader_options_test.go | Go | go | 1,841 | 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 ... |
06f4f8f7b3c2316c2001cc6b0a53e4ef129e8056 | a85ba40a04ff6af58d2a7cc719cae54f1dfb2dc4 | openshift/openshift-azure | /vendor/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/validation/validation.go | Go | go | 19,340 | permissive | /*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
7e968b771f56352351a562568c7c5a7053452762 | 595121d6011deb4eb3a68cf7a59a2a5be53620b3 | davidnewhall/motifini | /main.go | Go | go | 239 | permissive | package main
import (
"errors"
"log"
"net/http"
"github.com/davidnewhall/motifini/pkg/motifini"
)
func main() {
if err := motifini.Start(); err != nil &&
!errors.Is(err, http.ErrServerClosed) {
log.Fatalln("[ERROR]", err)
}
}
|
fee20218246c01662df32c190b7b37754c02d10e | 0197d45158d00093b4fca0a10235c9502f479fe5 | AcalephStorage/ceph-metrics | /workspace/src/ceph-metrics/http_api.go | Go | go | 721 | permissive | package main
import (
"fmt"
"net/http"
"github.com/Sirupsen/logrus"
)
// http api should possible run on all instances but redirects it to the leader
func startHttpServer(bindAddress string) {
http.HandleFunc("/ceph/", cephHealth)
logrus.Infoln("Http Check Server started.")
http.ListenAndServe(bindAddress, n... |
a64a9173445e3322fb8fd53a0536e8b4dbbb5493 | dc0d12a2b632def5f49e614c094489dd6f8ab36d | cnaize/cadvisor | /manager/manager.go | Go | go | 26,366 | permissive | // Copyright 2014 Google 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... |
50a1520b1956e3d5531d09a77c2d65553906f712 | 70a598f253d201ebed97c70244f8162b66423d1b | allyson2106/oci-cloud-controller-manager | /pkg/csi/driver/controller.go | Go | go | 33,266 | permissive | package driver
import (
"context"
"fmt"
"strconv"
"strings"
"time"
"github.com/container-storage-interface/spec/lib/go/csi"
"github.com/oracle/oci-go-sdk/v31/core"
"go.uber.org/zap"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
kubeAPI "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/p... |
c75c784d4f88d735e996a0b1de44be4673d316ff | 0ae6b96204314f8a43e878a4015e698675619005 | DavidYangfei/tsuru | /provision/docker/cmd.go | Go | go | 24,764 | permissive | // Copyright 2016 tsuru authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package docker
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
"sort"
"strconv"
"strings"
"time"
"github.com/tsuru/gnuflag"
"github.com/tsuru... |
1f2861d4b3df3df2e680f29b45f6ddc34f607749 | 82752c2304a14dc7aa30c25ee376894ebbbc05dc | Thiiamas/GoStar | /.history/src/main_20201116224842.go | Go | go | 4,552 | no_license | package main
import (
"fmt"
"Thiiamas/Utils"
"math/rand"
"time"
)
func main() {
size := 5
board := createBoard(size,"rand")
goal := findGoal(size)
board.Draw()
fmt.Println("//////////////////")
sons := findSonStates(board)
utils.Draw(sons)
if false {
fmt.Println("Board :")
board.Draw()
fmt.Println(... |
72fbac26f4f66d16657e349a978e9fa2c766b922 | 05958981568c78ac8d662b3a95faed15f4a674e0 | ankitbansal82/abot | /shared/task/iterate.go | Go | go | 2,215 | permissive | package task
import (
"encoding/json"
"fmt"
"github.com/itsabot/abot/shared/datatypes"
"github.com/itsabot/abot/shared/language"
)
// OptsIterate holds the options for an iterable task.
type OptsIterate struct {
// IterableMemKey is the key in memory where the iterable items exist.
// The iterable memory must ... |
e9479de0d3996f40d86be121d1573a3413154352 | 046c98cfa17725fdae8342b4d3828ec398a5f40d | boolinking/go-learn | /src/article5/q3/demo.go | Go | go | 268 | no_license | package main
import . "fmt" // fmt包中的公开的程序实体 视为当前包的程序实体
import . "article5/q3/lib"
// var Name int 编译错误
func main() {
var Name = ""
Printf("name is %s .\n",Name)
}
func hello() {
Printf("name is %s .\n",Name)
} |
a2865313fa425d6190ae484cb09d57ea70139472 | bc8394d77307513bc54eb45e60a214c941bebb0a | ialidzhikov/gardener-extension-provider-gcp | /pkg/apis/gcp/validation/secret_test.go | Go | go | 2,910 | permissive | // Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
12aaa0f8c69cbe722d4439ef83b588234a79aa63 | 64b39c6e540f67ad00b459ce8a6b0cd47341a992 | zc2638/mock | /cmd/app/root.go | Go | go | 2,265 | permissive | /*
Copyright © 2020 zc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribute... |
3170c69c8036a061711e686377d82f494520aa44 | 94ec6878d69fd9d0007235acab5837d0ffce3a1a | pendo-io/aws-sdk-go | /aws/request/request_context_test.go | Go | go | 1,068 | permissive | package request_test
import (
"fmt"
"strings"
"testing"
"github.com/pendo-io/aws-sdk-go/aws/corehandlers"
"github.com/pendo-io/aws-sdk-go/aws/request"
"github.com/pendo-io/aws-sdk-go/awstesting"
)
func TestRequest_SetContext(t *testing.T) {
svc := awstesting.NewClient()
svc.Handlers.Clear()
svc.Handlers.Sen... |
1507c9e44f964666c534f0e4607e31d9b7701157 | 630719537cf188bb344d4a9eb3cf3f7eabbb82d4 | qsdj/tengo | /compiler/compiler_error_report_test.go | Go | go | 965 | permissive | package compiler_test
import "testing"
func TestCompilerErrorReport(t *testing.T) {
expectError(t, `import("user1")`, "Compile Error: module file read error: open user1.tengo: no such file or directory\n\tat test:1:1")
expectError(t, `a = 1`, "Compile Error: unresolved reference 'a'\n\tat test:1:1")
expectError(t... |
b30543a87f527bf7756229ff69b47a394271ed9b | 4a7313eff900f54b3e057d7fd0bd2b8c3f5cc979 | VladimirTambovtsev/Golang-Bootcamp | /Web Dev/Servers/Cookies/main.go | Go | go | 1,075 | no_license | package main
import (
"fmt"
"html/template"
"net/http"
)
var tpl *template.Template
func init() {
tpl = template.Must(template.ParseGlob("templates/*"))
}
func main() {
http.HandleFunc("/", index)
http.HandleFunc("/products", products)
http.HandleFunc("/contacts", contacts)
http.ListenAndServe(":8080", nil)... |
5a998c72d939c6e8e81376f5c4101343b7331107 | 48848c2a512a2839002da828785369b6b3b2f483 | djbarber/ipfs-hack | /Godeps/_workspace/src/github.com/golang/protobuf/proto/text_test.go | Go | go | 11,371 | permissive | // Go support for Protocol Buffers - Google's data interchange format
//
// Copyright 2010 The Go Authors. All rights reserved.
// https://github.com/golang/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met... |
dea887b6f7b99ccecd4e2224ff54afcbca428bd4 | 3b3d6c11bb7e0cfc2033ab34679e9413d08ff161 | phsiao/tulipindicators-go | /indicators/linreg.go | Go | go | 1,067 | permissive | package indicators
//#include "../tulipindicators/indicators/linreg.c"
import "C"
import "fmt"
// LINREG function wraps `linreg' function that provides "Linear Regression"
//
// Reference: https://tulipindicators.org/linreg
func LINREG(real []float64, period int) (linreg []float64, err error) {
input_length := len(r... |
bea4cb968917d30395ba09f8cd5a9b22ae192f19 | b2f5d9cd52e8e81383137acb07a672de79f0b149 | sewh/goatscrape | /plugins/parse.go | Go | go | 910 | permissive | package plugins
import (
"net/http"
"strings"
"github.com/PuerkitoBio/goquery"
)
// ExtractAllLinks simply extracts all the <a href="<urL>"> </a> in a page
// provided that they aren't silly like a hash. It also expands relative
// links automagically.
func ExtractAllLinks(resp *http.Response) []string {
var lin... |
700b92d3025a814351a878efa73d3c37490128ca | d87833f45192bff5d4383de0d6d3ca378680dd2b | koobonil/Boss2D | /Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/go/op/scope.go | Go | go | 3,900 | permissive | /*
Copyright 2016 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
adb79a98fd5f33dd36efc38f6768c45b264eea67 | 34313ee444c0ae87945957d51b59be2dfe2f78e7 | zhaojizhuang/eventing | /cmd/webhook/main.go | Go | go | 15,355 | permissive | /*
Copyright 2018 The Knative 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, soft... |
2d25a6ca5bcd2c9326b7f5d0d377a0db016a2046 | ea2c342f2d30218a40dd8c8b651f1ff64231c19e | rpcxio/etcd | /etcdserver/config.go | Go | go | 10,443 | permissive | // Copyright 2015 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... |
4c0fb422e7882de0e217e86069685736602324eb | 51af5a02519be78ec0c867a298c7f384122022a3 | karlem/kube-aws | /cmd/calculator.go | Go | go | 1,687 | permissive | package cmd
import (
"fmt"
"github.com/kubernetes-incubator/kube-aws/core/root"
"github.com/spf13/cobra"
"strings"
)
//TODO this is a first step to calculate the stack cost
//this command could scrap aws to print the total cost, rather just showing the link
var (
cmdCalculator = &cobra.Command{
Use: ... |
3f5cb4d2094b5d126a0cb9dd4e76de8bbf5e8ee7 | 5c300fe4d7267cecbdbeb94373fdf4000243c2f4 | gxgeek/Go-000 | /Week03/main.go | Go | go | 1,861 | no_license | package main
import (
"context"
"fmt"
"golang.org/x/sync/errgroup"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer func() {
log.Println("global defer")
cancel()
}()
g, _ := errgroup.WithContext(ctx)
// server
g.Go(fun... |
86a5ce207d72f837faaa253b772ca96b628bb91d | 2071ee63c0100cbb0f2b79aa16abb5b0771bd121 | SergeiMikhailovskii/GoLearn | /30_days_of_coding/Day1.go | Go | go | 893 | no_license | package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {
var _ = strconv.Itoa // Ignore this comment. You can still use the package "strconv".
var i uint64 = 4
var d float64 = 4.0
var s string = "HackerRank "
scanner := bufio.NewScanner(os.Stdin)
scanner.Scan()
localI, _ := strconv.Atoi(scanner... |
940408023ed3d9dba72ae65120e6620809a68802 | 1c034ed9e3d3965764f35fce3c25e0b31220b3b8 | chinaares/bcbc | /cmd/bcbc.go | Go | go | 418 | permissive | package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
)
// BCBCVERSION bcbc version
const BCBCVERSION = "0.0.6"
var bcbc = &cobra.Command{
Use: "bcbc",
Short: "bcbc is a command for searching China's bankcard info",
Long: "\nbcbc is a command for searching China's bankcard info",
}
// Execute bcbc comm... |
cba49358bfd8856667778b5b98ba2f6cb0457944 | bfaa35d066731fa9c5f22c6c6f46665a2ec58a67 | mingalevme/feedbacker | /pkg/dispatcher/null.go | Go | go | 483 | no_license | package dispatcher
import "github.com/mingalevme/feedbacker/pkg/log"
type NullDriver struct {
logger log.Logger
}
func NewNullDriver(logger log.Logger) *NullDriver {
return &NullDriver{
logger: logger,
}
}
func (s *NullDriver) Name() string {
return "null"
}
func (s *NullDriver) Enqueue(t Task) error {
retu... |
afe2c939e358ef3c971ff3c73c17aa8fcf815113 | 09434844ea049335946c40505f05c17ac481bcec | zhaoweikid/tidb | /ddl/ddl.go | Go | go | 19,169 | permissive | // Copyright 2013 The ql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSES/QL-LICENSE file.
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complia... |
fb74b5dc4e70080567195a283d6602425cf5dc2f | 8130a97a85c7dc4a46048a723c9746bb22c1fe34 | abhilashdk2016/bookstore_users_api | /app/url_mapping.go | Go | go | 444 | no_license | package app
import (
"github.com/abhilashdk2016/bookstore_users_api/controllers/users"
)
func mapUrls() {
router.GET("/users/:user_id", users.GetUser)
router.GET("/internal/users/search", users.Search)
router.POST("/users", users.CreateUser)
router.PUT("/users/:user_id", users.UpdateUser)
router.PATCH("/users/:... |
d5921e71f42323a51e1b2a82e6ddc672b8f44ff7 | 18da08a50344eb48f8a46172714d9dcfcbe6f42a | levinholsety/common-go | /dbutil/query.go | Go | go | 3,308 | no_license | package dbutil
import (
"database/sql"
"errors"
"reflect"
"strings"
)
var (
errInvalidType = errors.New("invalid type")
errStructNotAppropriate = errors.New("struct should have 'tbl' tag and at least one 'col' or 'exp' tag")
)
// NewQuery creates a query from specified struct type.
// The struct shoul... |
7f5d455161202c50dc263803a556c27bc0740c2e | 4e796031ba0336eeb2e1451311ca6a94549a89a2 | jin06/binlogo | /app/pipeline/output/options.go | Go | go | 736 | permissive | package output
import (
"github.com/jin06/binlogo/pkg/store/model/pipeline"
)
// Options for configure output
type Options struct {
Output *pipeline.Output
PipelineName string
MysqlMode pipeline.Mode
}
// Option is a function for configure Options
type Option func(options *Options)
// OptionOutput sets... |
63fd01239423de85e58c102fbd3e15c5a7f3391e | ef0e210925c1809619de57501a5b50887c22ca01 | aembrito/spire | /cmd/spire-agent/cli/api/watch.go | Go | go | 1,923 | permissive | package api
import (
"flag"
"fmt"
"log"
"net"
"os"
"os/signal"
"syscall"
"time"
"github.com/spiffe/spire/api/workload"
)
type WatchConfig struct {
socketPath string
}
type WatchCLI struct {
config *WatchConfig
stopChan chan struct{}
}
func (WatchCLI) Synopsis() string {
return "Attaches to the Worklo... |
b24012090172ec6188e83efaac6eb57df90e9025 | 047624309b2e03d03b301d59494650e312e92c69 | hnnsngl/terraform-provider-keycloak | /provider/resource_keycloak_user_template_importer_identity_provider_mapper.go | Go | go | 2,287 | permissive | package provider
import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/mrparkers/terraform-provider-keycloak/keycloak"
)
func resourceKeycloakUserTemplateImporterIdentityProviderMapper() *schema.Resource {
mapperSchema := map[string]*schema.Schema{
"template": {
Type: s... |
677a115d7814100a5f3f77e3ed74a33f27eab9a7 | b54c16b9bf16b3ef77ed5c038c8548f2a191952c | fandan-nyc/all-interpretors | /monkey/lexer/lexer_test.go | Go | go | 2,989 | no_license | package lexer
import (
"github.com/fandan-nyc/all-interpretors/monkey/token"
"testing"
)
func TestNextToken(t *testing.T) {
input := `=+(){},;-!/*<>`
tests := []struct {
expectedType token.TokenType
expectedLiteral string
}{
{token.ASSIGN, "="},
{token.PLUS, "+"},
{token.LPAREN, "("},
{token.RPAR... |
892c1aa5c8688724ba4b9fe508533b6df734b5d0 | f28501dda1df024df73c495c126c32876de6b6ad | nassor/aerospike-client-go | /client_object_test.go | Go | go | 27,182 | permissive | // +build !as_performance
// Copyright 2013-2017 Aerospike, 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... |
a012086bf95a9f23fb910be575b119d3bd3e7214 | 95b9f5cc0d6c0c20fe3e603c4500793735a1d6f9 | ress997/trivy | /pkg/fanal/image/token/azure/azure.go | Go | go | 818 | permissive | package azure
import (
"context"
"strings"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy/pkg/fanal/types"
)
type Registry struct {
domain string
}
const azureURL = "azurecr.io"
func (r *Registry) CheckOptions(domain string, _ types.DockerOption) error {
if !strings.HasSuffix(domain, azureURL) {
re... |
adb9e7639f7bb72aa0be898d1d6654349d9bc283 | 61d062895151c0801137aecb03c2cfd09c4d7476 | etsangsplk/split-synchronizer | /splitio/producer/initialization.go | Go | go | 6,114 | permissive | package producer
import (
"fmt"
"os"
"strconv"
"sync"
"time"
"github.com/splitio/split-synchronizer/conf"
"github.com/splitio/split-synchronizer/log"
"github.com/splitio/split-synchronizer/splitio"
"github.com/splitio/split-synchronizer/splitio/fetcher"
"github.com/splitio/split-synchronizer/splitio/recorde... |
77b9cab94972b5e3de1c791750280a172ad36de5 | c0e0777dc83454eefe281ef3d6330b7a7795bfec | dennis-tra/protoactor-go | /router/router.go | Go | go | 328 | permissive | package router
import "github.com/AsynkronIT/protoactor-go/actor"
// router root context
var rootContext = actor.EmptyRootContext
// A type that satisfies router.Interface can be used as a router
type RouterState interface {
RouteMessage(message interface{})
SetRoutees(routees *actor.PIDSet)
GetRoutees() *actor.P... |
a4bf993e9f3ccf26bead0b14aa3a4a32ab5c14e3 | ee76c7d02eeabdaa65494de6ec1db7a04904f263 | chandrashritii/meshery | /mesheryctl/internal/cli/root/system/start.go | Go | go | 7,752 | permissive | // Copyright 2020 Layer5, 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 in... |
d9eb69d8eb8d1c3883b9cf69981945dd9c9f3d81 | f0899de4958a98f61d41bd292cf24cbace74a821 | citrix/terraform-provider-citrixadc | /vendor/github.com/citrix/adc-nitro-go/resource/config/router/routerdynamicrouting.go | Go | go | 999 | permissive | /*
* Copyright (c) 2021 Citrix Systems, 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 ... |
61de4cbb86908bf5c18759bbee6f96aa8eef6bb3 | 9e05ad10d387c73659d418a609c736e3c04eb092 | Nosferatu123/Euler | /20.go | Go | go | 428 | no_license | //Factorial digit sum
package main
import (
"fmt"
"math/big"
)
func main() {
n := big.NewInt(1)
j := big.NewInt(0)
for i := 1; i <= 100; i++ {
j.Add(j, big.NewInt(1))
n.Mul(n, j)
}
fmt.Println(n)
sum := big.NewInt(0)
ten := big.NewInt(10)
zero := big.NewInt(0)
for n.Cmp(zero) > 0 {... |
bed938c4e008374e2a911f3947cd41488042b27e | 43690630bee7979861bfec366967a0e8e0e3b55f | wade-welles/pdfcpu | /pkg/pdfcpu/xreftable.go | Go | go | 43,862 | permissive | /*
Copyright 2018 The pdfcpu 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, softwar... |
eabfc6101856c8b5a8d20fd3f6ef353b61c4967b | 7a5b4fcba335ed42423430abd2c8a6522a2a831d | johnnadratowski/batch | /app/controller/not_found.go | Go | go | 429 | permissive | package controller
import (
"fmt"
"net/http"
"github.com/gocraft/web"
"github.com/johnnadratowski/batch/app/context"
)
// Not found is the catch-all endpoint for when no endpoint is found
func NotFound(c *context.Context, rw web.ResponseWriter, req *web.Request) {
if req.Method == "OPTIONS" {
rw.WriteHeader(... |
3a4edb1d26cdb5cc9018f44876cdceb2d9f7633a | 378a45e922ac6e0e1066b31f587d0577e4e00a1d | Kopano-dev/kcc-go | /tls.go | Go | go | 1,203 | permissive | /*
* Copyright 2019 Kopano and its licensors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or a... |
ed2018c43baf768c12dc258493c8656ae5342a01 | e844b64af1622e079e1b7ec97589a26119414031 | kprabhatgit/golang-tutorial-public | /go-talks/2019-04-TESLA/resources/src/15_waitgroup/main.go | Go | go | 479 | no_license | package main
import (
"sync"
"time"
"fmt"
)
func main() {
var myWaitGroup sync.WaitGroup
myWaitGroup.Add(2)
go func() {
fmt.Println("Start goroutine 1")
fmt.Println("End goroutine 1")
myWaitGroup.Done()
}()
go func() {
fmt.Println("Start goroutine 2")
time.Sleep(time.Second * 5)
fmt.Println("End gor... |
06411341eac6483b0184d27a4a5bff387ba1ef1c | 9d02a49e232858c06f15b924e92db7ee9a84dbb9 | ncoheart/Go | /GoIota/main.go | Go | go | 744 | no_license | package main
import "fmt"
type Weapon int
const (
Arrow Weapon = iota
Shuriken
SniperRifle
Rifle
Blower
)
// 声明芯片类型
type ChipType int
const (
None ChipType = iota
CPU // 中央处理器
GPU // 图形处理器
)
func (c ChipType) String() string {
switch c {
case None:
return "None"
case CPU:
return... |
87ac01cc20b0b17ea64cc35d687603cc904d1c31 | 561198a80a8434b2d08e8f2797ea0bc4daea8272 | georgysavva/driver-app | /driver-location/cmd/driver-location-server/main.go | Go | go | 2,791 | no_license | package main
import (
"context"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
"github.com/go-redis/redis/v8"
"github.com/nsqio/go-nsq"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/georgysavva/driver-app/driver-location/pkg/config"
"github.com/georgysavva/driver-app/driver-location/p... |
146fdbe4e29093ad1a03a856b046c4f6f985e45a | f24956c83de42382749c671da2bf61a184c66cc5 | syqh826/dragonboat | /internal/logdb/kv/pebble/kv_pebble.go | Go | go | 6,547 | permissive | // Copyright 2017-2019 Lei Ni (nilei81@gmail.com) and other Dragonboat 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
//
// ... |
cbc07cead1e7cf9c757d0deddb83960694203107 | 56718a63198830a9feaf078788168a50256fc462 | MarioSkill/TFM | /configuration/configuration.go | Go | go | 1,085 | no_license | package configuration
var Root = "/TFM/mesos-framework"
var AppClusterPath = "/home/mvasile/bin/"
var Mediciones = "mediciones"
var ClusetConf = Root + "/assets/cluster-conf"
var TestConf = ClusetConf + "/tests"
var LoafBalancerServers = ClusetConf + "/lb_servers"
var Apps = ClusetConf + "/bin"
var FrameworksConf = C... |
646cc8d41e208222e18ceefa29df59a6eba93f6e | e5df72d8a659714ed20e7c478b7944ae3f00e1f1 | bodii/test-code | /go/leetcode_go/0088.Merge_Sorted_Array/Solution01/main.go | Go | go | 1,164 | no_license | package main
import (
"fmt"
"sort"
)
func merge(nums1 []int, m int, nums2 []int, n int) {
nums1 = nums1[:m]
nums1 = append(nums1, nums2[:n]...)
sort.Ints(nums1)
}
func test01() {
nums1, m := []int{1, 2, 3, 0, 0, 0}, 3
nums2, n := []int{2, 5, 6}, 3
successResult := []int{1, 2, 2, 3, 5, 6}
fmt.Println("test01... |
9d8cc683ee36985eda0d980802b7df9ce267521f | 921200c7f59d039e479ec0b8a99be0c3a9d8bc56 | abcum/syncr | /gcs/gcs.go | Go | go | 7,219 | permissive | // Copyright © 2016 Abcum 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 agreed to in ... |
e3fa55e8f2faad872762b399cd6c9231dae0d956 | 1a7d0be94a9e2bfc2e8db44a24a3af4dc966d750 | roverinjava/webhdfs | /fstoken.go | Go | go | 1,845 | permissive | package webhdfs
import "fmt"
import "net/http"
func (fs *FileSystem) GetDelegationToken(renewer string) (Token, error) {
params := map[string]string{"op": OP_GETDELEGATIONTOKEN, "renewer": renewer}
u, err := buildRequestUrl(fs.Config, nil, ¶ms)
if err != nil {
return Token{}, err
}
req, _ := http.NewRequ... |
75f3bb57e5278fd61be5a8acdde273ebee01e861 | 75fe9f0476afc05b2466194d9750f6a27c818b56 | pwFoo/lxd | /lxd/storage/drivers/driver_lvm.go | Go | go | 18,959 | permissive | package drivers
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"github.com/pkg/errors"
"github.com/lxc/lxd/lxd/operations"
"github.com/lxc/lxd/lxd/revert"
"github.com/lxc/lxd/shared"
"github.com/lxc/lxd/shared/api"
log "github.com/lxc/lxd/shared/log15"
"github.com/lxc/lxd/shared/units... |
028b0e508653f21175512f99a6374962859fc40d | af4730c7c17da3c6d70d34c8e306da6a690ac222 | morrell/pulumi-azure-native | /sdk/go/azure/network/v20190201/routeFilter.go | Go | go | 10,163 | permissive | // *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20190201
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Route Filter Resource.
type RouteFilt... |
73ebd12ffc172f203358b6dd35ff567664a73eaa | 978f734cd2cb29c5517a6b2c3f8006c9974ea88e | mastery001/go-work | /src/exercise-maps.go | Go | go | 342 | no_license | package main
import (
"golang.org/x/tour/wc"
"strings"
// "fmt"
)
func WordCount(s string) map[string]int {
var m = make(map[string]int)
fields := strings.Fields(s)
for _, value := range fields {
v := m[value]
if v != 0 {
m[value] = m[value] + 1
}else {
m[value] = 1
}
}
return m
}
func main() {... |
b09d69bed3e33bbd9b79f7db7aebdc5fdadb4474 | 77ae2115111d56a97aa196b0fd56748bed9bc60d | rgobbo/gext | /raw.go | Go | go | 744 | permissive | package gext
import "golang.org/x/net/html"
type raw struct {
componentBase
classes []string
containPlainText bool
textValue string
attr []html.Attribute
}
func (r *raw) Render() string {
// var buffer bytes.Buffer
// buffer.WriteString(r.textValue)
// for _, c1 := range r.GetChil... |
ff47cb36f0053be449847233214cfc6f9ad29c9c | 61e3c12a14430ff1a1381fd2aaea8c5e6461190c | lucaskeen/gsnova | /common/channel/config.go | Go | go | 6,644 | no_license | package channel
import (
"encoding/json"
"net/url"
"path/filepath"
"runtime"
"strings"
"github.com/yinqiwen/gsnova/common/helper"
"github.com/yinqiwen/gsnova/common/logger"
"github.com/yinqiwen/gsnova/common/mux"
"github.com/yinqiwen/pmux"
)
type FeatureSet struct {
AutoExpire bool
Pingable bool
}
type... |
a697c39a92f655f1ac8c00c86b06f828e965e33a | eaa637b543b0a7228851400edfa5cb840ddd1e14 | faide/geodns | /Godeps/_workspace/src/github.com/miekg/dns/privaterr_test.go | Go | go | 3,665 | permissive | package dns_test
import (
"strings"
"testing"
"github.com/abh/geodns/Godeps/_workspace/src/github.com/miekg/dns"
)
const TypeISBN uint16 = 0x0F01
// A crazy new RR type :)
type ISBN struct {
x string // rdata with 10 or 13 numbers, dashes or spaces allowed
}
func NewISBN() dns.PrivateRdata { return &ISBN{""} }... |
f55d3a874902467871cf3e9a47da3c5348540d9b | b993af11395947124387320b32b6838381e14d13 | chyun/go-work | /src/jvmgo/ch06.bak/instructions/references/putstatic.go | Go | go | 1,216 | no_license | package references
import "jvmgo/ch06/instructions/base"
import "jvmgo/ch06/rtda"
import "jvmgo/ch06/rtda/heap"
type PUT_STATIC struct {
base.Index16Instruction
}
func (self *PUT_STATIC) Execute(frame *rtda.Frame) {
currentMethod := frame.Method()
currentClass := currentMethod.Class()
cp := currentClass.ConstantP... |
b02088787cd55343341ab98489a1aece504bf032 | 39d8460baf88d1bcc43609481043d6f650e7ab34 | morrell/pulumi-azure-native | /sdk/go/azure/containerregistry/v20170601preview/getWebhookCallbackConfig.go | Go | go | 1,361 | permissive | // *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20170601preview
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The configuration of service URI and custom headers for the webhook.
func GetW... |
39c7cc385dcfcb52dea1a8719d0736d355ae7bef | d8719db3c021a9c6841d0a8598349f36aee5527b | rebider/Fgame | /game/welfare/handler/first_charge.go | Go | go | 5,244 | permissive | package handler
import (
"fgame/fgame/common/codec"
uipb "fgame/fgame/common/codec/pb/ui"
"fgame/fgame/common/dispatch"
"fgame/fgame/common/lang"
commonlog "fgame/fgame/common/log"
"fgame/fgame/core/session"
coreutils "fgame/fgame/core/utils"
chatlogic "fgame/fgame/game/chat/logic"
chattypes "fgame/fgame/game... |
faa1ac5a9367221dec1e81f53adb0f73d0ab7000 | 4cf3e4d0ea0ffb7760858d7a2d6355635b7e7c54 | yhw8930/goLearn | /crawler/engine/simple.go | Go | go | 477 | no_license | package engine
import (
"log"
)
type SimpleEngine struct {
}
func (e SimpleEngine) Run(seeds ...Request) {
var requests []Request
for _, r := range seeds {
requests = append(requests, r)
}
for len(requests) > 0 {
r := requests[0]
requests = requests[1:]
parseResult, err := worker(r)
if err != nil {
... |
08e7b9ff422635c192c756bd2aecd7cdb02904ad | 842a1fd80c93e655199c33a8bf0ac075aeb9503b | nalind/docker | /daemon/apparmor_default.go | Go | go | 1,726 | permissive | //go:build linux
// +build linux
package daemon // import "github.com/docker/docker/daemon"
import (
"fmt"
"os"
"sync"
"github.com/containerd/containerd/pkg/apparmor"
aaprofile "github.com/docker/docker/profiles/apparmor"
"github.com/sirupsen/logrus"
)
// Define constants for native driver
const (
unconfined... |
89be837e3b8cf0d7b45ae3c96c3f55da45a1a595 | fbddb0b369f4d9ba6795679187ac5778c7619068 | zoli/sublime | /textmate/language/testdata/main.go | Go | go | 11,369 | permissive | package main
import (
"code.google.com/p/log4go"
"fmt"
"io/ioutil"
"lime/3rdparty/libs/termbox-go"
"lime/backend"
"lime/backend/loaders"
"lime/backend/primitives"
"lime/backend/sublime"
"lime/backend/textmate"
"strings"
"time"
)
var (
lut = map[termbox.Key]backend.KeyPress{
termbox.KeyCtrlA: backen... |
dd7a9c3462f4a186fab14c40fa9eae0d21e7a0b9 | ad6678070a772e3589493fdd32b7e8e4830531f3 | 191576565/FundsTransferPricing | /ftpProject/logs/dbwriter.go | Go | go | 683 | no_license | package logs
import (
"database/sql"
"time"
)
type DBWriter struct {
db *sql.DB
stmt *sql.Stmt
content chan []byte
}
func NewDBWriter(db *sql.DB) (*DBWriter, error) {
_, err := db.Exec("CREATE TABLE IF NOT EXISTS log (id int, content text, created datetime)")
if err != nil {
return nil, err
}
stmt... |
7e163d1aca8349ef6f86c5c20bcf907a13d76c53 | 8b7d58763a0da047be500f55d74c847f40169ad6 | vroudge/orchestra-suncode | /LegacyHandler/api/schema.go | Go | go | 619 | no_license | package api
import (
"net/http"
"time"
"github.com/crepehat/OrchestraCPE/device"
)
type HeartBeat struct {
DeviceId string `json:"id"` // gives this
Command device.Command `json:"command,omitempty"` // receives this
State device.State `json:"state,omitempty"` // gives this
}
var... |
e31fe1d4a6857e23f5f4d95883048ddf37fac574 | ada4042f148e8f09dfa94f43abe23de0687bfb81 | wp-jackliu/opentaobao | /model/btrip/AlitripBtripSupplychainTrainIndustrySearchAPIRequest.go | Go | go | 1,493 | permissive | package btrip
import (
"net/url"
"github.com/bububa/opentaobao/model"
)
// AlitripBtripSupplychainTrainIndustrySearchAPIRequest 火车票行业搜索接口 API请求
// alitrip.btrip.supplychain.train.industry.search
//
// 【商旅】火车票行业搜索接口
type AlitripBtripSupplychainTrainIndustrySearchAPIRequest struct {
model.Params
// 入参
_rq *TrainS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.