text
stringlengths
11
6.3k
embedding
listlengths
768
768
func detectGoPackageForProject(projectFile string) (string, error) { var goPkg string projectDir := filepath.Dir(projectFile) if err := filepath.Walk(projectDir, func(protoFile string, info os.FileInfo, err error) error { // already set if goPkg != "" { return nil } if !strings.HasSuffix(protoFile, ".prot...
[ 0.33890026807785034, -0.016921069473028183, 0.8212646245956421, 0.1626608818769455, 0.21889296174049377, 0.23448097705841064, 0.1412288248538971, -0.1430421769618988, -0.7737232446670532, 0.4865230321884155, 0.3493833541870117, -0.3175307512283325, -0.5887952446937561, 0.6279798746109009, ...
func NewQueueManager(name string, clusters []string, aliasQueues []AliasQueue, remoteQueues []RemoteQueue, clusterQueues []ClusterQueue, ) *QueueManager { this := QueueManager{} this.Name = name this.Clusters = clusters this.AliasQueues = aliasQueues this.RemoteQueues = remoteQueues this.ClusterQueues = clusterQu...
[ -0.3267722427845001, -0.9674072265625, 0.4978991746902466, -0.6866825222969055, -0.20668165385723114, -0.1689014583826065, -1.331803560256958, -0.023207658901810646, 0.5008798837661743, 0.1812879890203476, -0.7106329202651978, 0.37847790122032166, -0.13039086759090424, 1.4233715534210205, ...
func NewQueueManagerWithDefaults() *QueueManager { this := QueueManager{} return &this }
[ -0.4501911401748657, -0.5164682865142822, -0.016295745968818665, 0.26893872022628784, 0.4867601990699768, -0.9880926012992859, -1.3092403411865234, -0.769955575466156, 0.6591994762420654, -1.0082403421401978, -0.8720371723175049, -1.0555191040039062, -0.5024347305297852, 1.6800291538238525...
func (o *QueueManager) GetName() string { if o == nil { var ret string return ret } return o.Name }
[ 0.2783944010734558, -0.4653491973876953, 0.07367941737174988, 0.3524421155452728, -0.2706078290939331, -0.14447839558124542, 0.46778374910354614, -0.4549126923084259, 0.19268442690372467, 0.20512324571609497, -0.24332362413406372, -0.9114316701889038, -0.07411373406648636, 0.72692352533340...
func (o *QueueManager) GetNameOk() (*string, bool) { if o == nil { return nil, false } return &o.Name, true }
[ -0.06180238723754883, -0.1152486801147461, 0.7517033815383911, 0.22422705590724945, -0.6773747205734253, 0.5031868815422058, 0.04231294244527817, -0.442088782787323, -0.32960960268974304, 1.1810302734375, -1.5875226259231567, -0.8380942940711975, 0.30232009291648865, 0.5984615683555603, ...
func (o *QueueManager) SetName(v string) { o.Name = v }
[ -0.06401383876800537, -0.608516275882721, 0.031669050455093384, -0.17581892013549805, -1.1921958923339844, -0.23478369414806366, -0.5268489718437195, -0.475983589887619, 0.051118120551109314, 0.7813145518302917, -1.1876726150512695, -0.02378077432513237, 0.07162251323461533, 0.999849200248...
func (o *QueueManager) GetClusters() []string { if o == nil { var ret []string return ret } return o.Clusters }
[ -0.013011036440730095, 0.17286595702171326, 0.13941864669322968, 0.8525431156158447, 0.5821910500526428, 0.17180776596069336, 0.5408411622047424, -1.1775822639465332, 1.2082362174987793, -0.48590192198753357, 0.4208449125289917, -0.3377595543861389, -0.8340001702308655, 0.25026997923851013...
func (o *QueueManager) GetClustersOk() (*[]string, bool) { if o == nil { return nil, false } return &o.Clusters, true }
[ -0.3407321274280548, 0.43987908959388733, 0.28302431106567383, 0.6448001861572266, -0.23482391238212585, -0.15155042707920074, 0.9290333986282349, -0.38941386342048645, -0.14202608168125153, 0.7272371053695679, -1.0119786262512207, -0.8653504252433777, -0.47515028715133667, 0.2443217933177...
func (o *QueueManager) SetClusters(v []string) { o.Clusters = v }
[ -0.35853952169418335, 0.12296758592128754, -0.08707837015390396, 0.1853027045726776, -0.051385678350925446, 0.32632842659950256, 0.02679133228957653, -1.1720556020736694, 0.3224264085292816, 0.23002229630947113, -0.22711113095283508, 0.09273386001586914, -1.0973548889160156, 0.573125839233...
func (o *QueueManager) GetAliasQueues() []AliasQueue { if o == nil { var ret []AliasQueue return ret } return o.AliasQueues }
[ 1.031572699546814, -1.2376437187194824, 0.5159135460853577, 0.5704042911529541, 0.216475710272789, 0.8114396333694458, -0.16581901907920837, 0.5874223113059998, 0.49837175011634827, 0.04552581161260605, 0.20500487089157104, -0.156958669424057, -0.23396286368370056, 1.5062204599380493, 0....
func (o *QueueManager) GetAliasQueuesOk() (*[]AliasQueue, bool) { if o == nil { return nil, false } return &o.AliasQueues, true }
[ 0.3174998462200165, -1.141539216041565, 0.32761892676353455, -0.09985054284334183, -0.43492263555526733, 0.4578562080860138, 0.08670713007450104, 0.1154901310801506, -0.14358124136924744, 1.0867294073104858, -0.8186934590339661, -1.042433261871338, 0.8512003421783447, 0.7666493058204651, ...
func (o *QueueManager) SetAliasQueues(v []AliasQueue) { o.AliasQueues = v }
[ 0.2639486491680145, -1.250320553779602, 0.19162698090076447, -0.11469986289739609, -0.34679752588272095, 0.7015591859817505, -0.30842915177345276, 0.06785077601671219, 0.1256706267595291, 0.8842712640762329, -0.23299415409564972, -0.10200185328722, -0.09571540355682373, 1.8979580402374268,...
func (o *QueueManager) GetRemoteQueues() []RemoteQueue { if o == nil { var ret []RemoteQueue return ret } return o.RemoteQueues }
[ 0.4272240996360779, -0.8099872469902039, 0.619327187538147, 0.006507657468318939, 0.22935311496257782, 1.1854323148727417, -0.7841218709945679, -0.20615342259407043, 0.6221603155136108, -0.18925803899765015, -1.3677529096603394, 0.39169758558273315, -1.2421469688415527, 0.843585193157196, ...
func (o *QueueManager) GetRemoteQueuesOk() (*[]RemoteQueue, bool) { if o == nil { return nil, false } return &o.RemoteQueues, true }
[ 0.06770095974206924, -0.8782721757888794, 0.4927523732185364, -0.20976467430591583, -0.3603824973106384, 0.8319476246833801, -0.360978364944458, -0.1692817509174347, 0.07947865128517151, 1.1081209182739258, -2.427185535430908, -0.6855928301811218, -0.3462786376476288, 0.47990724444389343, ...
func (o *QueueManager) SetRemoteQueues(v []RemoteQueue) { o.RemoteQueues = v }
[ -0.187820702791214, -1.1015186309814453, 0.44346556067466736, -0.6646062731742859, -0.4182944595813751, 1.157737374305725, -1.0743870735168457, -0.5743409991264343, 0.15426751971244812, 0.5171011686325073, -1.4952510595321655, 0.5174928307533264, -0.9532224535942078, 1.041318655014038, 0...
func (o *QueueManager) GetClusterQueues() []ClusterQueue { if o == nil { var ret []ClusterQueue return ret } return o.ClusterQueues }
[ 0.7591736316680908, -0.6376345157623291, 0.3344469964504242, 0.9661734104156494, 0.3307777941226959, 0.004714021924883127, -0.07757432013750076, -0.19438961148262024, 0.6610919833183289, 0.23771028220653534, -0.2350386530160904, 0.3069330155849457, -0.916895866394043, 0.3424869477748871, ...
func (o *QueueManager) GetClusterQueuesOk() (*[]ClusterQueue, bool) { if o == nil { return nil, false } return &o.ClusterQueues, true }
[ 0.5398522019386292, -0.7886549830436707, 0.3606889247894287, 0.46635711193084717, -0.28088638186454773, -0.19583626091480255, 0.44386646151542664, -0.16468991339206696, -0.002569279633462429, 1.4306297302246094, -1.2757760286331177, -0.6065505743026733, -0.22193245589733124, -0.05413723364...
func (o *QueueManager) SetClusterQueues(v []ClusterQueue) { o.ClusterQueues = v }
[ 0.2009107917547226, -0.7663345336914062, 0.029535451903939247, 0.3110501170158386, -0.05934476479887962, 0.23970317840576172, -0.462360143661499, -0.44694066047668457, 0.2750204801559448, 0.8789302110671997, -0.3042762279510498, 0.4207807183265686, -0.7886585593223572, 0.8691432476043701, ...
func (bf *boardFilter) atStation(tpl string) bool { for _, s := range bf.res.Station { if s == tpl { return true } } return false }
[ -1.2419401407241821, -0.5658538937568665, 0.4271708130836487, -1.2646960020065308, -0.6562333703041077, -0.07087025791406631, -0.39907655119895935, -0.3555591404438019, -0.8936177492141724, 0.7827367782592773, -0.49317467212677, -0.6878286004066467, -0.3634141981601715, -0.1451767832040786...
func (bf *boardFilter) callsAt(callingPoints []darwind3.CallingPoint, tpls []string) bool { for _, cp := range callingPoints { for _, tpl := range tpls { if tpl == cp.Tiploc { return true } } } return false }
[ -0.9962978363037109, -0.34105414152145386, 0.37691178917884827, -1.1064497232437134, -0.6324465274810791, 0.3229880630970001, -1.1868046522140503, -0.9125878810882568, 0.12235068529844284, 0.029767639935016632, 0.3081994652748108, -0.1504499614238739, -0.3310990333557129, 0.069893442094326...
func (bf *boardFilter) addTiploc(tiploc string) { if tiploc != "" { bf.tiplocs[tiploc] = nil } }
[ -0.5335227847099304, 0.22769898176193237, 0.5758423209190369, -0.655208945274353, 0.20653009414672852, -0.3294461965560913, 0.9733678102493286, 0.3059637248516083, 0.6898261904716492, 0.282514363527298, 0.10673948377370834, -0.34456124901771545, 0.8109738826751709, -0.43136462569236755, ...
func (bf *boardFilter) addVia(rid, dest string) *darwinref.ViaResolveRequest { viaRequest := &darwinref.ViaResolveRequest{ Crs: bf.station.Crs, Destination: dest, } bf.vias[rid] = viaRequest return viaRequest }
[ -0.6874437928199768, 0.21093158423900604, 0.6588060855865479, -0.8072836995124817, 0.02230573631823063, -0.5519151091575623, -0.4472869634628296, -0.2795557379722595, -0.7329636216163635, -0.4776090085506439, 0.08913333714008331, -0.1248658150434494, -0.37716051936149597, -0.14967936277389...
func (bf *boardFilter) processCallingPoints(s ldb.Service) { if len(s.CallingPoints) > 0 { viaRequest := bf.addVia(s.RID, s.CallingPoints[len(s.CallingPoints)-1].Tiploc) for _, cp := range s.CallingPoints { bf.addTiploc(cp.Tiploc) viaRequest.AppendTiploc(cp.Tiploc) } } }
[ -0.5312858819961548, 0.4572261869907379, 0.5096396803855896, -0.1028880625963211, 0.1479533612728119, 0.03199787437915802, 0.009012308903038502, 0.16528770327568054, 0.7890538573265076, 0.4185503125190735, 0.5612320899963379, -0.08654486387968063, -0.5572941303253174, 0.5753679871559143, ...
func (bf *boardFilter) processAssociations(s ldb.Service) { for _, assoc := range s.Associations { assoc.AddTiplocs(bf.tiplocs) //if assoc.IsJoin() || assoc.IsSplit() { ar := assoc.Main.RID ai := assoc.Main.LocInd if ar == s.RID { ar = assoc.Assoc.RID ai = assoc.Assoc.LocInd } // Resolve the sche...
[ -0.4703083634376526, -0.2774999439716339, 0.8912302255630493, -0.6927036643028259, 0.06011848524212837, -0.6509445905685425, 1.0948035717010498, 0.41956859827041626, 0.568718433380127, -0.1745651811361313, 1.1058269739151, -0.24651089310646057, 0.09749001264572144, 0.3645952045917511, 0....
func (bf *boardFilter) acceptService(service ldb.Service) bool { // Original requirement, must have an RID if service.RID == "" { return false } // remove terminating services if bf.terminated && bf.atStation(service.Destination) { return false } if bf.callAt && !bf.callsAt(service.CallingPoints, bf.callAt...
[ -0.5408191084861755, 0.5194537043571472, 0.7360795736312866, -0.11072763800621033, -1.3486802577972412, 1.1393818855285645, -0.047261614352464676, -0.166486456990242, -0.4426780939102173, -0.2756267189979553, 0.8492476344108582, -0.24365326762199402, -1.2352477312088013, 1.4996485710144043...
func (sd *SettingsDialog) OpenSettingsDialog() { if !sd.isDisplayInited { sd.__init_display() } sd.populateFields() sd.Open() }
[ -0.6878267526626587, 1.1145521402359009, 0.20158416032791138, -0.0930795967578888, -1.3196007013320923, 0.042515430599451065, 0.7166131138801575, 0.5371547937393188, 0.3875046670436859, -0.06899426877498627, 0.41225382685661316, -0.7841204404830933, 0.4478228688240051, 0.7638561725616455, ...
func Upload( src, dest string ) ( err error ) { cfg, err := config.Read() if err != nil { return } connString := "leo-deploy@" + cfg.ServerName dest = connString + ":apps/" + cfg.AppName + "/" + dest fmt.Printf( "Copying %s into %s\n", src, dest ) out, err := exec.Command( "scp", src, dest ).CombinedOutput() fm...
[ 0.02385541796684265, 0.34778735041618347, 0.741921067237854, -0.28333696722984314, -0.21702797710895538, 0.6297062039375305, -0.7294539213180542, 0.34761959314346313, -1.0000537633895874, 1.2264093160629272, 0.06377416104078293, 0.46927952766418457, -0.5322563648223877, -0.0558555871248245...
func (s *sqlStore) List(opts ...store.ListOption) ([]string, error) { options := store.ListOptions{ Order: store.OrderAsc, } for _, o := range opts { o(&options) } db, queries, err := s.db(options.Database, options.Table) if err != nil { return nil, err } pattern := "%" if options.Prefix != "" { patte...
[ -0.21986334025859833, 0.13271869719028473, 0.7778276205062866, -0.05028419569134712, -0.2325441986322403, -0.4943685233592987, -0.5966780781745911, 0.4662316143512726, 0.3942931890487671, 1.1507538557052612, -0.22737759351730347, 0.32372140884399414, 0.30301254987716675, 0.2333733886480331...
func (s *sqlStore) rowToRecord(row pgx.Row) (*store.Record, error) { var expiry *time.Time record := &store.Record{} metadata := make(Metadata) if err := row.Scan(&record.Key, &record.Value, &metadata, &expiry); err != nil { if err == sql.ErrNoRows { return record, store.ErrNotFound } return nil, err } ...
[ 0.35676294565200806, 0.5021839141845703, 0.3732546269893646, -1.0213676691055298, -0.16665805876255035, 0.27341702580451965, -1.1423659324645996, 0.15533965826034546, 0.5835183262825012, 0.21386098861694336, 0.3614889681339264, 0.5417660474777222, 0.09299647808074951, -0.5451058149337769, ...
func (s *sqlStore) rowsToRecords(rows pgx.Rows) ([]*store.Record, error) { var records []*store.Record for rows.Next() { var expiry *time.Time record := &store.Record{} metadata := make(Metadata) if err := rows.Scan(&record.Key, &record.Value, &metadata, &expiry); err != nil { return records, err } ...
[ -0.7349755764007568, 0.36090216040611267, 0.08865036815404892, -0.6642550826072693, -0.20304058492183685, -0.2470632791519165, -1.4166343212127686, 0.11034902185201645, 0.6712402701377869, 0.27234870195388794, -0.002668695757165551, 0.33917519450187683, -0.17592580616474152, -0.32937422394...
func (s *sqlStore) Read(key string, opts ...store.ReadOption) ([]*store.Record, error) { options := store.ReadOptions{ Order: store.OrderAsc, } for _, o := range opts { o(&options) } db, queries, err := s.db(options.Database, options.Table) if err != nil { return nil, err } // read one record if !optio...
[ -0.46798524260520935, 0.3858509361743927, 0.817922055721283, -0.3685641884803772, -0.6209999322891235, 0.1330617070198059, 0.025987084954977036, 0.08364450186491013, 0.5106666684150696, 0.6529114842414856, 0.6403855681419373, 0.31516334414482117, -0.19055166840553284, 0.04510681703686714, ...
func (s *sqlStore) Delete(key string, opts ...store.DeleteOption) error { var options store.DeleteOptions for _, o := range opts { o(&options) } db, queries, err := s.db(options.Database, options.Table) if err != nil { return err } _, err = db.Exec(s.options.Context, queries.Delete, key) return err }
[ -0.062433723360300064, 1.1429169178009033, 0.4165804386138916, 0.7633662819862366, 0.15194359421730042, 0.3759945034980774, -0.1297224909067154, -0.2349691092967987, 0.3278660178184509, 0.6915174722671509, 0.22268766164779663, -0.17233158648014069, -1.1014869213104248, 0.09597165882587433,...
func NewStore(opts ...store.Option) store.Store { options := store.Options{ Database: defaultDatabase, Table: defaultTable, } for _, o := range opts { o(&options) } // new store s := new(sqlStore) s.options = options s.databases = make(map[string]DB) s.re = regexp.MustCompile("[^a-zA-Z0-9]+") go s...
[ 0.02714180015027523, 0.1763821691274643, 0.3409898281097412, 0.5322014689445496, -1.1552077531814575, 0.679817259311676, -0.7095233201980591, 0.16228622198104858, 0.7751110792160034, -0.30614402890205383, -0.05071811005473137, -0.07053115963935852, -1.0078028440475464, -0.32130441069602966...
func (d *DB) startHourly(key string) bool { // Try to load this key, if not present then it can be started lastCall, err := d.loadTime(key) if err != nil { Log.Println("Command: ", key, " was never called") return true } return int(time.Since(lastCall).Hours()) > 0 }
[ -0.44789400696754456, 0.07525304704904556, 0.9338111877441406, 0.6560503244400024, -0.4218007028102875, 0.2969572842121124, -0.6829313039779663, 0.5384677052497864, -0.41219839453697205, 0.6740186810493469, -0.6538234949111938, -0.4086279273033142, -0.6903649568557739, 1.1863685846328735, ...
func (l *LogStore) findConflict(entries []*pb.Entry) uint64 { // TODO: 会有第0个冲突么? for _, ne := range entries { if !l.matchTerm(ne.Index, ne.Term) { if ne.Index <= l.lastIndex() { l.logger.Info("log found conflict", zap.Uint64("conflictIndex", ne.Index), zap.Uint64("conflictTerm", ne.Term), zap....
[ -0.47100338339805603, -0.314243346452713, 0.8952297568321228, -0.1740659773349762, 0.36678609251976013, -0.3827669620513916, 0.4404233694076538, -0.35408687591552734, -0.6032581329345703, 0.15229344367980957, 0.3600437641143799, -0.3185909688472748, -1.5249500274658203, 0.7090560793876648,...
func New(ctx context.Context, logger yolo.Logger, client *http.Client, filter FilterFunc, mapper Mapper) *Crawler { return &Crawler{ ctx: ctx, logger: logger, client: client, filter: filter, mapper: mapper, visitChan: make(chan visit, visitChanBuffer), toVisit: make(map[string]struct{}), } }
[ -0.21526338160037994, -0.0796082392334938, 0.5411565899848938, -0.11427225172519684, -0.41700637340545654, -0.5059919953346252, 0.7527585029602051, 0.07270006090402603, -0.8744874596595764, -0.28136587142944336, 0.11223094165325165, 1.0118314027786255, 0.7119024395942688, 0.248732104897499...
func (c *Crawler) Add(source *url.URL, uri ...*url.URL) []error { var errs []error for _, u := range uri { var err error u := u u.Fragment = "" // reset fragment, we don't want it messing our visited list if source != nil { u = source.ResolveReference(u) } if u.Scheme != "http" && u.Scheme != "http...
[ -1.5142384767532349, 0.7210810780525208, 0.7141926288604736, -0.09231775999069214, 0.15107661485671997, -0.6544468402862549, 1.0201457738876343, 0.548660933971405, 0.34977269172668457, 0.543291449546814, -0.06383486092090607, 0.42705971002578735, 0.06688962876796722, 0.9729037880897522, ...
func (c *Crawler) Run(numWorkers int) { // Here we create a new cancellable context to control goroutines and requests. // We can't just rely on the parent context because we want to shutdown goroutines if there's no activity for some time. // Closing the channel would introduce "send on closed chan" errors since c...
[ -0.318350613117218, -0.16640031337738037, 0.7413924932479858, -0.09209184348583221, 0.49208757281303406, -0.2537415325641632, 0.9172390699386597, -0.38750573992729187, -0.5525795221328735, 0.36502978205680847, 0.15786118805408478, -0.09717989712953568, -1.221031665802002, 0.403614580631256...
func (svc *Service) getSourcegraphVersion(ctx context.Context) (string, error) { var result struct { Site struct { ProductVersion string } } ok, err := svc.client.NewQuery(sourcegraphVersionQuery).Do(ctx, &result) if err != nil || !ok { return "", err } return result.Site.ProductVersion, err }
[ -0.0863790363073349, 0.5684525370597839, 0.2650320827960968, 0.8501639366149902, -0.6881316900253296, -0.2876341938972473, 1.2756634950637817, -1.3195990324020386, -0.11579841375350952, 1.302329421043396, -1.322393774986267, 0.5654888153076172, -0.8447346687316895, -0.5931073427200317, 0...
func (svc *Service) DetermineFeatureFlags(ctx context.Context) error { version, err := svc.getSourcegraphVersion(ctx) if err != nil { return errors.Wrap(err, "failed to query Sourcegraph version to check for available features") } return svc.features.setFromVersion(version) }
[ -0.14018727838993073, 0.290211021900177, 0.11670476198196411, 0.5691106915473938, 0.3882606327533722, 0.1417747586965561, 0.004845655057579279, 0.1841639131307602, -0.4720807671546936, -0.43045035004615784, -1.0231910943984985, 0.34455931186676025, -0.3862362802028656, 1.1726815700531006, ...
func Handler(a adding.Service, l listing.Service, d deleting.Service) *gin.Engine { router := gin.Default() router.GET("/movies", listMovies(l)) router.GET("/movies/:id", getMovie(l)) router.POST("/movies", addMovie(a)) router.DELETE("/movies/:id", deleteMovie(d)) return router }
[ -0.5965661406517029, 0.10485254228115082, 0.3514018654823303, 0.5705171227455139, 0.8184329867362976, 0.14354735612869263, -0.2608053684234619, 0.9448896646499634, -0.4813438057899475, -0.6320896148681641, -0.07169400900602341, 0.6793133616447449, 0.1794431507587433, 0.9725594520568848, ...
func ApplyOptions(opt ...Option) Options { opts := Options{ MaxTraversalLinks: math.MaxInt64, //default: traverse all MaxAllowedHeaderSize: carv1.DefaultMaxAllowedHeaderSize, MaxAllowedSectionSize: carv1.DefaultMaxAllowedSectionSize, } for _, o := range opt { o(&opts) } // Set defaults for zero valued...
[ 0.16946657001972198, 0.6452329754829407, 0.579714298248291, 0.24755814671516418, 0.5218490958213806, -0.594521164894104, -0.10879845172166824, 0.3731495141983032, 0.14669844508171082, -1.1542081832885742, -0.2219666689634323, -0.6221135258674622, -0.45225444436073303, 0.6858596205711365, ...
func ZeroLengthSectionAsEOF(enable bool) Option { return func(o *Options) { o.ZeroLengthSectionAsEOF = enable } }
[ 0.9700343608856201, -0.9314892292022705, 0.49068984389305115, -0.4420701563358307, 0.1352006196975708, -0.1011165902018547, 0.2288258969783783, -0.2011524885892868, 0.3807298243045807, -0.2983240783214569, 0.02898198366165161, -0.6094405055046082, -0.11959860473871231, 0.2092454880475998, ...
func UseDataPadding(p uint64) Option { return func(o *Options) { o.DataPadding = p } }
[ -0.5887411832809448, 1.078560471534729, 0.5016026496887207, -0.6360400915145874, -0.2366570383310318, 0.15004530549049377, 0.21772608160972595, 0.02029258757829666, 0.7752343416213989, -0.2633897066116333, -0.7009987831115723, 0.02695644088089466, 0.07237186282873154, 0.8542574048042297, ...
func UseIndexPadding(p uint64) Option { return func(o *Options) { o.IndexPadding = p } }
[ -0.8436848521232605, 0.7411029934883118, 0.2788417935371399, 0.40468868613243103, -0.051879074424505234, -0.3718906342983246, 0.7918775677680969, -0.14843209087848663, 0.9309804439544678, -0.0763833075761795, -0.012478167191147804, -0.5655931830406189, -0.9814550280570984, -0.1726230829954...
func UseIndexCodec(c multicodec.Code) Option { return func(o *Options) { o.IndexCodec = c } }
[ 0.39528438448905945, -0.3250577449798584, 0.4822174608707428, 0.11453177779912949, -0.3997780382633209, -0.6571365594863892, 1.0347708463668823, 0.4272938370704651, 0.6528322696685791, -1.0302150249481201, -0.04145772382616997, 0.2825590670108795, 0.029141290113329887, 0.5397648215293884, ...
func WithoutIndex() Option { return func(o *Options) { o.IndexCodec = index.CarIndexNone } }
[ -0.6054633259773254, -0.5942447781562805, 0.32365211844444275, -0.6140485405921936, 0.26127001643180847, -0.17313739657402039, 1.0560139417648315, 0.5384315252304077, -0.02669682912528515, -0.9183362722396851, -0.6223018169403076, -0.10839404165744781, -0.6505780220031738, -0.7326107621192...
func StoreIdentityCIDs(b bool) Option { return func(o *Options) { o.StoreIdentityCIDs = b } }
[ -0.11299003660678864, -0.3874507546424866, 0.12354140728712082, -0.19207094609737396, 0.8417070508003235, 0.734050452709198, 0.2982978820800781, 0.4808330535888672, 0.6749728322029114, 0.12840981781482697, -1.0459033250808716, -0.020532548427581787, -1.4597535133361816, -0.1542278379201889...
func MaxIndexCidSize(s uint64) Option { return func(o *Options) { o.MaxIndexCidSize = s } }
[ -0.10939620435237885, -0.1299259066581726, 0.08498486876487732, -0.21341513097286224, -0.31879445910453796, -0.5925618410110474, -0.20998592674732208, -0.16919557750225067, 1.1180176734924316, -1.1112619638442993, -0.4609086811542511, -0.029821336269378662, -0.28650203347206116, -0.7406955...
func WithTraversalPrototypeChooser(t traversal.LinkTargetNodePrototypeChooser) Option { return func(o *Options) { o.TraversalPrototypeChooser = t } }
[ -0.15162764489650726, -0.507275402545929, 0.40951234102249146, 0.030777975916862488, 0.44934526085853577, 0.27710238099098206, 0.6295351982116699, -0.33635151386260986, -0.32610780000686646, 0.5632767081260681, 0.008989143185317516, 0.0670476034283638, 0.18941153585910797, -0.0722683444619...
func WithTrustedCAR(t bool) Option { return func(o *Options) { o.TrustedCAR = t } }
[ -0.08193182945251465, -0.4427945911884308, 0.28378769755363464, -0.7307369709014893, 0.28038275241851807, 0.15768952667713165, 0.28475794196128845, -0.6375909447669983, -0.5384358763694763, 0.4903431832790375, -1.0285147428512573, -0.6521486043930054, 0.34811338782310486, 0.201317533850669...
func MaxAllowedHeaderSize(max uint64) Option { return func(o *Options) { o.MaxAllowedHeaderSize = max } }
[ 0.4634157121181488, -0.2257489413022995, 0.08574451506137848, 0.07365971803665161, -1.4726390838623047, 0.23160725831985474, -0.4313255846500397, -0.5103452801704407, 0.7726027369499207, -0.11141100525856018, 0.6448008418083191, 0.18195149302482605, -0.8384062647819519, -0.3252107501029968...
func MaxAllowedSectionSize(max uint64) Option { return func(o *Options) { o.MaxAllowedSectionSize = max } }
[ 0.6799413561820984, -0.3240281641483307, 0.31836527585983276, 0.19775810837745667, -1.5144903659820557, 0.3771330416202545, 0.06532922387123108, -0.2845563292503357, 0.8513675928115845, -0.09144293516874313, 0.8398251533508301, -0.46996328234672546, -0.11309105902910233, 0.2690110802650451...
func WriteAsCarV1(asCarV1 bool) Option { return func(o *Options) { o.WriteAsCarV1 = asCarV1 } }
[ -0.9227040410041809, -1.0850374698638916, 0.5946473479270935, 0.2871176302433014, 0.37640348076820374, 0.501844048500061, 0.4390770494937897, 0.06707995384931564, -0.10252628475427628, 1.0560311079025269, -0.0314483605325222, -0.07336242496967316, 0.3165474832057953, -0.07483606785535812, ...
func AllowDuplicatePuts(allow bool) Option { return func(o *Options) { o.BlockstoreAllowDuplicatePuts = allow } }
[ -0.17795276641845703, -0.12691688537597656, 0.7514292001724243, 0.44499748945236206, -0.369968056678772, 0.7628732323646545, 1.6458102464675903, -0.820465087890625, 0.2877156138420105, 0.49647581577301025, 0.14574135839939117, -0.535334587097168, -0.9119014143943787, 0.19317764043807983, ...
func (d Duration) Hours() float64 { return time.Duration(d).Hours() }
[ -1.3172597885131836, 1.2598472833633423, 0.2799863815307617, -0.13395898044109344, -1.0126280784606934, 1.0936484336853027, -0.822623610496521, 0.0824098140001297, -0.029635615646839142, -0.023537319153547287, 0.47570908069610596, -0.32635462284088135, 1.0060477256774902, 0.454851090908050...
func (d Duration) Minutes() float64 { return time.Duration(d).Minutes() }
[ -1.4894670248031616, 1.3892825841903687, -0.11845636367797852, -0.4951232373714447, -0.15692755579948425, -0.24968938529491425, -0.9296272993087769, -1.0920042991638184, 0.8274189829826355, -0.23471097648143768, 0.1659030020236969, -0.3040914535522461, 0.5418855547904968, 0.635719180107116...
func (d Duration) Nanoseconds() int64 { return time.Duration(d).Nanoseconds() }
[ -0.6341761350631714, 1.1201826333999634, -0.0069196466356515884, 0.04676935821771622, -1.2927714586257935, -0.7891387343406677, -0.07891997694969177, -0.49525186419487, -0.11757848411798477, 0.05901549383997917, -0.03824517875909805, -0.12153700739145279, 0.7814360857009888, 0.704156339168...
func (d Duration) Seconds() float64 { return time.Duration(d).Seconds() }
[ -0.5867667198181152, 0.7038673162460327, -0.007096247281879187, 0.19891011714935303, -0.45866236090660095, -0.424808144569397, -0.37632688879966736, -0.7804920673370361, -0.36893129348754883, -0.6396680474281311, -0.27415263652801514, 0.18000128865242004, 1.1329164505004883, 1.367477297782...
func (d Duration) String() (result string) { var seconds, minutes, hours int seconds = int(d.Seconds()) if seconds > 60 { minutes = (seconds - seconds%60) / 60 seconds = seconds % 60 } if minutes > 59 { hours = (minutes - minutes%60) / 60 minutes = minutes - hours*60 result = numberInString(hours, false)...
[ -0.5350616574287415, -0.2998295724391937, 0.7813994288444519, -0.6677800416946411, -0.8842490911483765, -0.0931222140789032, 0.08805476874113083, -1.3571290969848633, 0.028706729412078857, 0.29543036222457886, 0.07338613271713257, 0.4924049377441406, 0.41207727789878845, 0.0103893298655748...
func (d Duration) StringApproximate() (result string) { var seconds, minutes, hours, days, months, years int seconds = int(d.Seconds()) if seconds > 60 { minutes = int(d.Minutes()) } if minutes > 59 { hours = int(d.Hours()) minutes = minutes - hours*60 } if hours > 24 { days = (hours - hours%24) / 24 h...
[ -0.5414955615997314, -0.3223246932029724, 1.123004674911499, -1.2411167621612549, -0.597110390663147, -0.1389426589012146, -0.7146848440170288, -0.42722007632255554, -0.20470502972602844, 0.5863558650016785, 0.42896568775177, 0.425434410572052, -0.04082128033041954, 0.4300956428050995, 0...
func (fc *fakeClient) AddLabel(owner, repo string, number int, label string) error { fc.added = append(fc.added, label) fc.labels = append(fc.labels, label) return nil }
[ -0.3049224019050598, 0.18554162979125977, 0.3965985178947449, -0.2590944468975067, 1.0905189514160156, 0.9979591965675354, -0.9261125922203064, 0.11017048358917236, 0.5112321972846985, -0.3185604214668274, 0.47477516531944275, 0.032091520726680756, -0.6376489996910095, 0.5168785452842712, ...
func (fc *fakeClient) RemoveLabel(owner, repo string, number int, label string) error { fc.removed = append(fc.removed, label) // remove from existing labels for k, v := range fc.labels { if label == v { fc.labels = append(fc.labels[:k], fc.labels[k+1:]...) break } } return nil }
[ -0.2567441761493683, -0.17100076377391815, 0.3217640817165375, -0.558716893196106, 0.4469837248325348, 0.08673582226037979, -0.4897134602069855, 0.719911515712738, 0.4458718001842499, 0.512606143951416, 0.024761583656072617, 0.09482992440462112, -0.8585863709449768, -0.33696427941322327, ...
func (fc *fakeClient) GetIssueLabels(owner, repo string, number int) ([]github.Label, error) { var la []github.Label for _, l := range fc.labels { la = append(la, github.Label{Name: l}) } return la, nil }
[ -0.9120852947235107, 0.08265640586614609, 0.4214698076248169, 0.3269229829311371, 0.22380568087100983, 0.21007472276687622, -1.1302824020385742, -0.03240294009447098, 0.3586210608482361, 0.6212249398231506, -0.7008092403411865, -0.14504778385162354, -0.7837386131286621, 0.4416477680206299,...
func (fc *fakeClient) CreateComment(owner, repo string, number int, comment string) error { fc.commentsAdded[number] = append(fc.commentsAdded[number], comment) return nil }
[ -0.2564185857772827, -0.3218386769294739, 0.2212357372045517, -0.34810274839401245, 1.853615641593933, 0.22713428735733032, 0.0847957581281662, -0.3190946578979492, 0.029917629435658455, 0.29508647322654724, -0.4530280828475952, -0.784595787525177, -0.9991477131843567, 0.520943820476532, ...
func (fc *fakeClient) NumComments() int { n := 0 for _, comments := range fc.commentsAdded { n += len(comments) } return n }
[ 0.4465095102787018, -0.4348781406879425, 0.4187306761741638, -0.7658747434616089, 0.4319935739040375, -0.8612591624259949, 0.8527243733406067, -0.2718711793422699, 0.01677989959716797, 0.06285440921783447, -1.0445809364318848, -0.679134726524353, -0.43480128049850464, 0.6010271906852722, ...
func (f elasticsearchOutputPlugin) NewOutput( config *outputs.MothershipConfig, topologyExpire int, ) (outputs.Outputer, error) { // configure bulk size in config in case it is not set if config.BulkMaxSize == nil { bulkSize := defaultBulkSize config.BulkMaxSize = &bulkSize } output := &elasticsearchOutput{...
[ 0.05752521753311157, -0.24549657106399536, 0.4628189206123352, 0.3844013810157776, -0.2369217425584793, -1.3723000288009644, 0.3409874737262726, 0.1000010296702385, 0.45285430550575256, 0.5692529082298279, -0.1328444927930832, -0.3038800358772278, -0.33778753876686096, 0.19888833165168762,...
func loadTemplate(config outputs.Template, clients []mode.ProtocolClient) { // Check if template should be loaded // Not being able to load the template will output an error but will not stop execution if config.Name != "" && len(clients) > 0 { // Always takes the first client esClient := clients[0].(*Client) ...
[ 0.076299287378788, -0.2843470871448517, 0.6120026707649231, -0.09368425607681274, -0.02014761231839657, -0.1030341163277626, -0.056151825934648514, 0.3231905400753021, -0.892612636089325, 0.7952828407287598, 0.010689032264053822, -0.591896116733551, -1.2302736043930054, 0.00351452687755227...
func New(c *config.PagerdutyConfig, t *template.Template, l log.Logger, httpOpts ...commoncfg.HTTPClientOption) (*Notifier, error) { client, err := commoncfg.NewClientFromConfig(*c.HTTPConfig, "pagerduty", httpOpts...) if err != nil { return nil, err } n := &Notifier{conf: c, tmpl: t, logger: l, client: client} ...
[ -0.30948352813720703, -0.8621311187744141, 0.4783047139644623, -0.8925911784172058, -0.266471266746521, -0.32957106828689575, 0.210349902510643, -0.18381600081920624, -0.6121046543121338, 0.18579883873462677, -0.16377291083335876, 0.3809955418109894, 0.1130039393901825, 0.8882123827934265,...
func (n *Notifier) Notify(ctx context.Context, as ...*types.Alert) (bool, error) { key, err := notify.ExtractGroupKey(ctx) if err != nil { return false, err } var ( alerts = types.Alerts(as...) data = notify.GetTemplateData(ctx, n.tmpl, as, n.logger) eventType = pagerDutyEventTrigger ) if alerts....
[ -0.6799784302711487, 0.37132489681243896, 0.6190940737724304, 0.13850820064544678, 0.4768940508365631, -0.37444281578063965, -0.05583726614713669, -0.0512685626745224, -0.7577022314071655, 0.3295780122280121, -0.3829468786716461, 0.0932253822684288, -0.14982682466506958, 0.7127217054367065...
func (o *Patchintegrationactionfields) String() string { o.RequestMappings = []Requestmapping{{}} j, _ := json.Marshal(o) str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1)) return str }
[ -0.47142380475997925, -0.7130060791969299, 0.26903364062309265, -0.7871922254562378, -0.24222925305366516, 0.32715460658073425, 0.9593750238418579, -0.609459400177002, 0.20543207228183746, 0.5548073053359985, -0.5460569262504578, 0.6146146655082703, -0.6721782684326172, -1.3791712522506714...
func Open(addr string) (*bufio.ReadWriter, error) { // Dial the remote process. // Note that the local port is chosen on the fly. If the local port // must be a specific one, use DialTCP() instead. log.Println("Dial " + addr) conn, err := net.Dial("tcp", addr) if err != nil { return nil, errors.Wrap(err,...
[ 0.43354320526123047, -0.14957678318023682, 0.6882101893424988, -0.7618301510810852, -1.044051170349121, 0.08154192566871643, -0.06140173226594925, 1.0216010808944702, 0.19708730280399323, -0.10599186271429062, 0.2820274531841278, 0.3804719150066376, 0.1461613029241562, -0.7303439378738403,...
func NewEndpoint() *Endpoint { // Create a new Endpoint with an empty list of handler funcs. return &Endpoint{ handler: map[string]HandleFunc{}, } }
[ 0.3635459542274475, -0.5856127142906189, 0.0871763527393341, 1.0115046501159668, 0.2097437083721161, -0.05025022104382515, -0.3445318639278412, 0.6019196510314941, -0.21963387727737427, -1.3653186559677124, -0.774806797504425, 0.24628950655460358, -0.4387538731098175, -0.21725860238075256,...
func (e *Endpoint) AddHandleFunc(name string, f HandleFunc) { e.mutex.Lock() e.handler[name] = f e.mutex.Unlock() }
[ 0.4611092507839203, -0.18900534510612488, 0.49431538581848145, -0.37532803416252136, 0.26119858026504517, 0.14502567052841187, 0.35243043303489685, 0.21113801002502441, -0.1356784999370575, -0.7370221614837646, -0.3055892288684845, -0.38142403960227966, 0.5055817365646362, -0.5884559750556...
func (e *Endpoint) Listen() error { var err error e.listener, err = net.Listen("tcp", Port) if err != nil { return errors.Wrapf(err, "Unable to listen on port %s\n", Port) } log.Println("Listen on", e.listener.Addr().String()) for { log.Println("Accept a connection request.") conn, err := e.listene...
[ 0.5140795707702637, -0.6454636454582214, 0.6326593160629272, -0.3563016653060913, 0.8989733457565308, 0.22604142129421234, -0.2418871819972992, 0.21013927459716797, -1.0240168571472168, 0.11605951935052872, 0.407541960477829, -0.39762502908706665, -0.20793260633945465, 0.14217476546764374,...
func (e *Endpoint) handleMessages(conn net.Conn) { // Wrap the connection into a buffered reader for easier reading. rw := bufio.NewReadWriter(bufio.NewReader(conn), bufio.NewWriter(conn)) defer conn.Close() // Read from the connection until EOF. Expect a command name as the // next input. Call the handler ...
[ 0.021559499204158783, -0.5247144103050232, 0.6065636873245239, 0.003712346777319908, 0.5596355199813843, -0.7853017449378967, -0.16626842319965363, -0.7854048609733582, -0.5437936782836914, -0.7052647471427917, 0.811553955078125, -0.7025284767150879, -0.31294766068458557, 0.290295153856277...
func handleStrings(rw *bufio.ReadWriter) { // Receive a string. log.Print("Receive STRING message:") s, err := rw.ReadString('\n') if err != nil { log.Println("Cannot read from connection.\n", err) } s = strings.Trim(s, "\n ") log.Println(s) _, err = rw.WriteString("Thank you.\n") if err != nil { ...
[ 0.8831728100776672, 0.060165874660015106, 0.6698184609413147, -1.0255382061004639, 0.23872508108615875, -0.35473617911338806, 0.20034566521644592, -0.2784962058067322, -0.5974658727645874, -0.3240358233451843, 0.5115070939064026, -0.18721507489681244, 0.08010577410459518, -0.56234431266784...
func handleGob(rw *bufio.ReadWriter) { log.Print("Receive GOB data:") var data complexData // Create a decoder that decodes directly into a struct variable. dec := gob.NewDecoder(rw) err := dec.Decode(&data) if err != nil { log.Println("Error decoding GOB data:", err) return } // Print the complex...
[ 0.7328335642814636, -0.35104238986968994, 0.7163887619972229, 0.14152182638645172, 0.8588882088661194, 0.482150137424469, 0.13309286534786224, 0.09757964313030243, -1.0093258619308472, -0.5908078551292419, -0.4785239100456238, 0.11264780908823013, -0.956548810005188, -0.021758463233709335,...
func client(ip string) error { // Some test data. Note how GOB even handles maps, slices, and // recursive data structures without problems. testStruct := complexData{ N: 23, S: "string data", M: map[string]int{"one": 1, "two": 2, "three": 3}, P: []byte("abc"), C: &complexData{ N: 256, S: "...
[ 0.04037574678659439, 0.2639167606830597, 0.7837201952934265, -0.3580123782157898, -0.09932254254817963, -0.34451159834861755, 0.13401512801647186, -0.8429859280586243, -0.72625333070755, 0.24941229820251465, -0.49555009603500366, 0.9175307750701904, -0.68587327003479, -0.8426995873451233, ...
func server() error { endpoint := NewEndpoint() // Add the handle funcs. endpoint.AddHandleFunc("STRING", handleStrings) endpoint.AddHandleFunc("GOB", handleGob) // Start listening. return endpoint.Listen() }
[ -0.2468496859073639, -0.7247713804244995, 0.2150646150112152, 0.08851435780525208, 1.6001520156860352, 0.03658529743552208, -0.34240731596946716, 0.6485280990600586, -1.0265051126480103, -0.8262724876403809, -0.8267333507537842, 0.16367852687835693, -0.826315701007843, -0.191825270652771, ...
func main() { connect := flag.String("connect", "", "IP address of process to join. If empty, go into listen mode.") flag.Parse() // If the connect flag is set, go into client mode. if *connect != "" { err := client(*connect) if err != nil { log.Println("Error:", errors.WithStack(err)) } log.P...
[ 0.9646039009094238, -0.029002351686358452, 0.898285448551178, 0.6900660395622253, 0.5137578248977661, 0.5458659529685974, 0.41082748770713806, 0.44346970319747925, -1.113336205482483, 0.038558684289455414, 0.3850998878479004, 0.572725236415863, -0.4839451014995575, -0.5021601319313049, 0...
func init() { log.SetFlags(log.Lshortfile) }
[ 2.4383816719055176, -0.4919607639312744, 0.2603521943092346, 0.1068795919418335, 0.44969114661216736, 1.1400774717330933, 0.39445042610168457, 0.8209568858146667, -0.7251353859901428, -1.1233799457550049, -0.5972590446472168, 1.1882472038269043, 0.795254111289978, 0.7430844902992249, -0....
func NewHealthController(service *goa.Service) *HealthController { return &HealthController{Controller: service.NewController("HealthController")} }
[ 1.2368173599243164, -0.3374926447868347, 0.04644814506173134, -0.223489448428154, -0.9235057234764099, -0.21490035951137543, -0.48114579916000366, -0.9418582320213318, 0.6822822093963623, -0.5153030753135681, -0.168229877948761, 0.8614427447319031, 0.6034347414970398, 1.3282344341278076, ...
func (c *HealthController) Health(ctx *app.HealthHealthContext) error { // HealthController_Health: start_implement ver := "unknown" semVer, err := semver.Make(MajorMinorPatch + "-" + ReleaseType + "+git.sha." + GitCommit) if err == nil { ver = semVer.String() } return ctx.OK([]byte("Health OK: " + time.Now().S...
[ 0.636535108089447, -0.8663007616996765, 0.4297293722629547, 0.15073485672473907, -0.09124934673309326, 1.1937283277511597, 0.39605602622032166, 0.2568514049053192, 0.2858717143535614, -0.01113478560000658, 0.2621213495731354, 0.4956796169281006, 0.18091760575771332, 1.0278193950653076, 0...
func NewGenerator(input chan<- uint) chan<- bool { stop := make(chan bool) go func() { var current uint = 1 for { select { case input <- current: current++ case <-stop: close(input) return } } }() return stop }
[ -1.7461267709732056, 0.10593830794095993, 0.5047871470451355, -0.14510996639728546, -0.948015034198761, 0.62147456407547, 0.5746433734893799, -0.4601494371891022, -0.31579652428627014, -0.4851537346839905, 0.17893393337726593, -0.25255024433135986, -1.1414021253585815, 0.798946738243103, ...
func Asset(name string) ([]byte, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) } return a.bytes, nil } return nil, fmt.Errorf("Asset %s not foun...
[ -0.7961483001708984, -1.2313168048858643, 0.633165180683136, -0.6093899011611938, -1.546921730041504, -0.11101024597883224, 0.12971386313438416, -1.3390334844589233, -1.1358720064163208, 0.4855233430862427, 0.3090141713619232, 0.32495471835136414, -0.6009681224822998, -0.44264674186706543,...
func MustAsset(name string) []byte { a, err := Asset(name) if err != nil { panic("asset: Asset(" + name + "): " + err.Error()) } return a }
[ -0.012778956443071365, 0.11985661834478378, 0.4091298282146454, -0.5268413424491882, -0.8276715278625488, 0.4719155430793762, -0.8186293840408325, -1.5736604928970337, 0.16388541460037231, 0.6357062458992004, -0.5354578495025635, 0.35693347454071045, 0.0057142809964716434, -0.0248885955661...
func AssetInfo(name string) (os.FileInfo, error) { cannonicalName := strings.Replace(name, "\\", "/", -1) if f, ok := _bindata[cannonicalName]; ok { a, err := f() if err != nil { return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) } return a.info, nil } return nil, fmt.Errorf("Asset...
[ 0.371969997882843, -1.1052993535995483, 0.5630446076393127, -0.922572672367096, -1.356387734413147, 0.0033556853886693716, 0.6777529716491699, -0.8006685972213745, -1.2748286724090576, 0.3115358352661133, 0.2636086046695709, 0.26388120651245117, 0.0635773167014122, -0.3988074064254761, 0...
func AssetNames() []string { names := make([]string, 0, len(_bindata)) for name := range _bindata { names = append(names, name) } return names }
[ -0.7293784618377686, -0.8460342288017273, 0.7321816682815552, -0.39323121309280396, -0.48951536417007446, 0.7661203145980835, -0.5028699636459351, -0.8655748963356018, -0.4145073890686035, 0.8099913597106934, 0.16903363168239594, 1.163049578666687, -0.028152840211987495, 0.0342608317732811...
func RestoreAsset(dir, name string) error { data, err := Asset(name) if err != nil { return err } info, err := AssetInfo(name) if err != nil { return err } err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) if err != nil { return err } err = ioutil.WriteFile(_filePath(dir, name), d...
[ 0.3437124192714691, -0.3622540235519409, 0.6770355701446533, -1.2592030763626099, -0.006139514967799187, -0.04453148692846298, -0.0072639440186321735, -0.43950510025024414, -0.20619122684001923, -0.2510169744491577, 0.1784360408782959, 0.13568510115146637, -0.23627112805843353, -0.56985116...
func RestoreAssets(dir, name string) error { children, err := AssetDir(name) // File if err != nil { return RestoreAsset(dir, name) } // Dir for _, child := range children { err = RestoreAssets(dir, filepath.Join(name, child)) if err != nil { return err } } return nil }
[ 0.42261892557144165, 0.30020031332969666, 0.5813396573066711, -0.20641657710075378, -0.23828908801078796, -0.24414615333080292, 0.5739709138870239, -0.029911456629633904, 0.06188219040632248, -0.43923482298851013, 0.5113736987113953, 0.3275970220565796, -0.6125145554542542, 0.0351656526327...
func (s *service) Start() error { log.Debug("Starting Proc") s.pipe, _ = s.Proc.StdoutPipe() e := s.Proc.Start() if e != nil { return e } s.isRunning = true log.Debug("Waiting") e = s.Proc.Wait() return e }
[ 0.7109748125076294, -0.440643310546875, 0.5361234545707703, -0.06333669275045395, -0.22078195214271545, -0.18835486471652985, 0.276101291179657, 0.5944461226463318, -0.5199989080429077, -0.19006229937076569, 0.09263208508491516, 1.1375731229782104, -0.45679914951324463, 0.14838431775569916...
func toFieldName(name string) string { name = strings.Title(name) // NOTE: golint prefers method names use "ID" instead of "Id". re := regexp.MustCompile("Id([A-Z]|$)") return re.ReplaceAllString(name, "ID${1}") }
[ -0.3501364290714264, -0.1880010962486267, 0.8214964866638184, -1.1430134773254395, -0.0792074203491211, 0.02858446165919304, -0.8538621664047241, 0.15612322092056274, 0.5977573990821838, 1.1342419385910034, -1.4475394487380981, -0.2029891014099121, -0.8662634491920471, -0.49581536650657654...
func genFields(fs []*ast.FieldDefinition) *jen.Statement { // // Generate config for fields // // == Example input SDL // // type Dog { // name(style: NameComponentsStyle = SHORT): String! // givenName: String @deprecated(reason: "No longer supported; please use name field.") // } // // == ...
[ -0.9165525436401367, 0.4369291663169861, 0.6035638451576233, -0.6074171662330627, -0.47884759306907654, -0.3835706114768982, -0.20591026544570923, -0.4875231981277466, -0.4088004529476166, 0.029558628797531128, -0.8060657978057861, -0.6406057476997375, 0.5088164806365967, 0.257479101419448...
func genField(field *ast.FieldDefinition) *jen.Statement { // // Generate config for field // // == Example input SDL // // interface Pet { // "name of the pet" // name(style: NameComponentsStyle = SHORT): String! // """ // givenName of the pet ★ // """ // givenName: String...
[ -0.5403081178665161, 0.19418136775493622, 0.6365823745727539, -0.6992591619491577, -0.5637685656547546, -0.3647548258304596, -0.41687801480293274, -0.6475961804389954, -0.5107151865959167, 0.5906015038490295, -0.32769522070884705, -0.14186495542526245, 0.09397067874670029, 0.41353884339332...
func genArguments(args []*ast.InputValueDefinition) *jen.Statement { // // Generate config for arguments // // == Example input SDL // // type Dog { // name( // "style is stylish" // style: NameComponentsStyle = SHORT, // ): String! // } // // == Example output // // Fiel...
[ -1.5496091842651367, -0.09697402268648148, 0.6184399127960205, -0.42094194889068604, -0.11504904180765152, -0.020153040066361427, -0.3138345777988434, -0.06465326994657516, -0.7467111349105835, 0.7680699825286865, -0.3955143690109253, -0.026997050270438194, 0.20320750772953033, 1.152796626...
func genArgument(arg *ast.InputValueDefinition) *jen.Statement { // // Generate config for argument // // == Example input SDL // // type Dog { // name( // "style is stylish" // style: NameComponentsStyle = SHORT, // ): String! // } // // == Example output // // &Argument...
[ -1.2374073266983032, -0.3305896818637848, 0.5581923127174377, -0.5464746356010437, -0.32797569036483765, 0.23741257190704346, -0.15679268538951874, -0.26926374435424805, -0.15278030931949615, 0.8862853646278381, -0.03332937881350517, 0.8134298324584961, 0.3090958893299103, 1.05671322345733...
func (client Client) AddReceipt(userId string, text string) error { addReceiptUrl := client.backendUrl + "/internal/receipt" request := addReceiptRequest{ReceiptString: text, UserId: userId} reader, err := getReader(request) if err != nil { return err } response, err := http.Post(addReceiptUrl, "text/javascrip...
[ -0.23695215582847595, 0.30054277181625366, 0.7697563767433167, -0.23306459188461304, -0.4090207815170288, 0.01732173189520836, -0.5739055275917053, -0.0610637292265892, 0.24566888809204102, 0.20064039528369904, 0.6666020154953003, 0.17401768267154694, -0.46907296776771545, -0.0319416485726...
func Contain(list []string, str string) bool { for _, s := range list { if s == str { return true } } return false }
[ 0.3476426899433136, -0.8992108106613159, 0.3342488408088684, 0.29637205600738525, -0.6599231362342834, 0.3952157497406006, -0.949684739112854, 0.27199119329452515, -0.7368593811988831, 0.5782240629196167, -0.1609659492969513, -0.07792199403047562, -0.677786111831665, 0.7389703392982483, ...
func MergeUnique(dest, source []string) []string { for _, str := range source { if !Contain(dest, str) { dest = append(dest, str) } } return dest }
[ -1.0874042510986328, 0.03379342705011368, 0.4759823679924011, -0.8066766262054443, 0.20840273797512054, -0.24416173994541168, -1.764946699142456, 0.8693906664848328, 0.06996821612119675, 0.42304497957229614, -0.7666284441947937, 0.7515305876731873, 0.2580689787864685, -0.11084800213575363,...