Skip to content

Instantly share code, notes, and snippets.

View rules.go
package gorules
import ""
func useMathBits(m fluent.Matcher) {
m.Match(`$X >> $N | $X << (8 - $N)`,
`$X << $N | $X >> (8 - $N)`,
`$X >> (8 - $N) | $X << $N`,
`$X << (8 - $N) | $X >> $N`,
`$X >> $N | $X << (16 - $N)`,
View regexp_test.txt
Parser test cases:
// Empty pattern.
{``, `{}`},
// Anchors.
{`^`, `^`},
{`^^`, `{^ ^}`},
{`$`, `$`},
{`$$`, `{$ $}`},
View arraycopy.go
"".getID1 STEXT size=169 args=0x10 locals=0x88
0x0000 00000 (arrcopy.go:10) TEXT "".getID1(SB), ABIInternal, $136-16
0x0000 00000 (arrcopy.go:10) MOVQ (TLS), CX
0x0009 00009 (arrcopy.go:10) LEAQ -8(SP), AX
0x000e 00014 (arrcopy.go:10) CMPQ AX, 16(CX)
0x0012 00018 (arrcopy.go:10) JLS 159
0x0018 00024 (arrcopy.go:10) SUBQ $136, SP
0x001f 00031 (arrcopy.go:10) MOVQ BP, 128(SP)
0x0027 00039 (arrcopy.go:10) LEAQ 128(SP), BP
0x002f 00047 (arrcopy.go:10) FUNCDATA $0, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
View stdlib mappings
var stdlib = map[string]string{
"adler32": "hash/adler32",
"aes": "crypto/aes",
"ascii85": "encoding/ascii85",
"asn1": "encoding/asn1",
"ast": "go/ast",
"atomic": "sync/atomic",
"base32": "encoding/base32",
"base64": "encoding/base64",
"big": "math/big",
View preg_match.txt
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:306: preg_match("/Subject: [^\n]*\n--[0-9a-z\.]*\/", $msg)
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:307: preg_match("/\b(t|that6036)", $msg)
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:310: preg_match("/To: [a-zA-Z]+[0-9]", $msg)
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:312: preg_match("/To:\s*([^\n]*", $msg)
wikia-app/extensions/3rdparty/LyricWiki/nusoap.php:4465: preg_match('#^[0-9]{4}/XMLSchema$#',$value)
wikia-app/maintenance/wikia/ preg_match( '/(||', $url )
composer/src/Composer/Repository/Vcs/GitDriver.php:200: preg_match('#(^git://|\.git/?$|git(?:olite)?@|//git\.|//', $url)
composer/src/Composer/Repository/Vcs/HgDriver.php:209: preg_match('#(^(?:https?|ssh)://(?:[^@]+@)?bi
View equalFold.txt
./ equalFold: consider replacing with strings.EqualFold(name, sl)
./ equalFold: consider replacing with strings.EqualFold(word, word)
./ equalFold: consider replacing with strings.EqualFold("true", v)
./ equalFold: consider replacing with strings.EqualFold(filepath.Ext(path), ".yaml")
./ equalFold: consider replacing with strings.EqualFold(k, key)
./ equalFold: consider replacing with strings.EqualFold(i.val, i.val)
./ equalFold: consider replacing with strings.EqualFold(item.val, item.val)
./ equalFold: consider replacing with strings.EqualFold(ipAddressType, "PUBLI

Project manifest

This document exists to make it clear what fits gocritic project and what is not.
In a sense, this manifest describes project philosophy.

This document may change over time.
Contributors and maintainers are encouraged to discuss it and propose changes.

What gocritic is

View datarace.go
package main
import "sync"
// Запустите с помощью "go run -race datarace.go".
var globalX int
func main() {
var wg sync.WaitGroup
quasilyte / no_preempt.go
Last active Nov 8, 2018
Example of a deadlock due to the lack of a better preemption in go scheduler
View no_preempt.go
package main
import (
// Запускать через "go run no_preempt.go".
// См. также:
quasilyte / channels.go
Created Nov 8, 2018
Channel vs mutex vs atomic for synchronized counter
View channels.go
package benchmark
import (