This file contains 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" | |
"io/ioutil" | |
"log" | |
"os" | |
) | |
func main() { |
This file contains 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
//+build !appengine | |
package prefetch | |
func prefetchBS(b [][]byte) |
This file contains 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 move | |
import "unsafe" | |
func memmove(to uintptr, from uintptr, n uintptr) | |
func MemMove(dst, src []byte) { | |
memmove(uintptr(unsafe.Pointer(&dst[0])), uintptr(unsafe.Pointer(&src[0])), uintptr(len(src))) | |
} |
This file contains 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" | |
"math/rand" | |
) | |
// This will show various cases where bounds checks can be eliminated by keeping track of | |
// minimum and maximum potential values of slices and variables as SSA. | |
func main() { |
This file contains 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
// THESE PACKAGES ARE FOR DEMONSTRATION PURPOSES ONLY! | |
// | |
// THEY DO NOT NOT CONTAIN WORKING INTRINSICS! | |
// | |
// See https://github.com/klauspost/intrinsics | |
package sse2 | |
import "github.com/bjwbell/gensimd/simd" | |
var _ = simd.M128{} // Make sure we use simd package |
This file contains 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
// Match tags in notes, etc. | |
// Group 1: Must start with whitespace OR start of string | |
// - : Must start with hash sign # | |
// Group 2: Match everything, until we reach a whitespace, '#' '.' ',' '!' ')'. | |
// Must be end of string | |
var matchTags = regexp.MustCompile(`[^\S]|^#([^\s#.,!)]+)$`) | |
// tagsSplitter returns true if the current rune is a tag ending | |
// Tags MUST end with whitespace, '.' ',' '!' or ')' | |
func tagsSplitter(c rune) bool { |
This file contains 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
" </div>" | |
" })();\r\n" | |
" && " | |
" & " | |
" " | |
" ''The " | |
" ("" | |
" (199" | |
" (200" | |
" (e.g." |
This file contains 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" | |
"io" | |
"os" | |
"path/filepath" | |
) | |
const ( |
This file contains 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 app | |
import ( | |
"math/rand" | |
"time" | |
"github.com/revel/revel" | |
) | |
// randomDuration generates a duration between min and max duration. |
This file contains 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 2011 The Go Authors. All rights reserved. | |
// Copyright 2013 Klaus Post | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
package crc32 | |
import ( | |
"github.com/klauspost/intrinsics/x86/sse2" | |
"github.com/klauspost/intrinsics/x86" |