This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = 'proto2'; | |
package example; | |
enum CompanyType { | |
Private = 17; | |
Public = 18; | |
NonProfit = 19; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by protoc-gen-go. | |
// source: spec.proto | |
// DO NOT EDIT! | |
/* | |
Package example is a generated protocol buffer package. | |
It is generated from these files: | |
spec.proto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net/http" | |
pprofHTTP "net/http/pprof" | |
"os" | |
"runtime/pprof" | |
"strings" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"strings" | |
"time" | |
"golang.org/x/net/context" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func zipit(source, target string, keepHierarchy bool) error { | |
zipfile, err := os.Create(target) | |
if err != nil { | |
return err | |
} | |
defer zipfile.Close() | |
archive := zip.NewWriter(zipfile) | |
defer archive.Close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2009 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// | |
// Modified into a gotemplate by Nick Craig-Wood <[email protected]> | |
// Package list implements a doubly linked list. | |
// | |
// To iterate over a list (where l is a *List): | |
// for e := l.Front(); e != nil; e = e.Next() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
//go:generate stringer -type=MessageStatus | |
type MessageStatus int | |
const ( | |
Sent MessageStatus = iota | |
Received |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
//go:generate jsonenums -type=Status | |
type Status int | |
const ( | |
Pending Status = iota | |
Sent | |
Received | |
Rejected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//go:generate ffjson $GOFILE | |
package education | |
type Student struct { | |
FirstName string | |
LastName string | |
} | |
type University struct { | |
Name string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This systemd runs iptables-restore on boot: | |
[Unit] | |
Description=Packet Filtering Framework | |
DefaultDependencies=no | |
After=systemd-sysctl.service | |
Before=sysinit.target | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/sbin/iptables-restore /opt/docker/scripts/iptables/iptables.rules |