Skip to content

Instantly share code, notes, and snippets.

😔
I may be slow to respond.

Iskander (Alex) Sharipov quasilyte

😔
I may be slow to respond.
Block or report user

Report or block quasilyte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View preg_match.txt
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:306: preg_match("/Subject: [^\n]*\n--[0-9a-z\.]*\/pedlfaster.pedlr.com--/si", $msg)
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:307: preg_match("/\b(t|that6036)@lyricwiki.org/si", $msg)
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:310: preg_match("/To: [a-zA-Z]+[0-9]+@lyricwiki.org/i", $msg)
wikia-app/extensions/3rdparty/LyricWiki/Special_SendToAFriend.body.php:312: preg_match("/To:\s*([^\n]*@lyricwiki.org)/si", $msg)
wikia-app/extensions/3rdparty/LyricWiki/nusoap.php:4465: preg_match('#^http://www.w3.org/[0-9]{4}/XMLSchema$#',$value)
wikia-app/maintenance/wikia/updateCentralInterwiki.inc:95: preg_match( '/(wowwiki.com|wikia.com|falloutvault.com)/', $url )
composer/src/Composer/Repository/Vcs/GitDriver.php:200: preg_match('#(^git://|\.git/?$|git(?:olite)?@|//git\.|//github.com/)#i', $url)
composer/src/Composer/Repository/Vcs/HgDriver.php:209: preg_match('#(^(?:https?|ssh)://(?:[^@]+@)?bi
View equalFold.txt
./cloud.google.com/go/logging/logging.go:527:6: equalFold: consider replacing with strings.EqualFold(name, sl)
./github.com/99designs/gqlgen/codegen/object.go:413:22: equalFold: consider replacing with strings.EqualFold(word, word)
./github.com/99designs/gqlgen/graphql/bool.go:22:10: equalFold: consider replacing with strings.EqualFold("true", v)
./github.com/Azure/azure-sdk-for-go/storage/util_test.go:58:6: equalFold: consider replacing with strings.EqualFold(filepath.Ext(path), ".yaml")
./github.com/Azure/azure-storage-blob-go/azblob/parsing_urls.go:103:6: equalFold: consider replacing with strings.EqualFold(k, key)
./github.com/Azure/golua/pkg/pattern/classes.go:45:5: equalFold: consider replacing with strings.EqualFold(i.val, i.val)
./github.com/Azure/golua/pkg/pattern/classes.go:82:5: equalFold: consider replacing with strings.EqualFold(item.val, item.val)
./github.com/GoogleCloudPlatform/cloudsql-proxy/proxy/certs/certs.go:102:7: equalFold: consider replacing with strings.EqualFold(ipAddressType, "PUBLI
View gocritic_manifest.md

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
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 (
"fmt"
"runtime"
"time"
)
// Запускать через "go run no_preempt.go".
// См. также: https://github.com/golang/go/issues/10958.
@quasilyte
quasilyte / channels.go
Created Nov 8, 2018
Channel vs mutex vs atomic for synchronized counter
View channels.go
package benchmark
import (
"context"
"runtime"
"sync"
"sync/atomic"
"testing"
"time"
)
View andnot.txt
quasilyte src $ gogrep -x '$x & ^$y' ./...
bytes/bytes.go:294:8: wasSpace & ^isSpace
cmd/internal/src/pos.go:407:14: uint(x) & ^uint(xlogueMax<<xlogueShift)
cmd/internal/src/pos.go:415:14: uint(x) & ^uint(isStmtMax<<isStmtShift)
crypto/elliptic/p256.go:1058:11: pIsNoninfiniteMask & ^nIsInfinityMask
crypto/elliptic/p256.go:1139:10: pIsNoninfiniteMask & ^nIsInfinityMask
crypto/tls/conn.go:818:20: payloadBytes & ^(blockSize - 1)
hash/crc32/crc32_ppc64le.go:42:14: len(p) & ^vecAlignMask
hash/crc32/crc32_ppc64le.go:79:14: len(p) & ^vecAlignMask
hash/crc32/crc32_s390x.go:50:14: len(p) & ^vxAlignMask
View go_fma.patch
diff --git a/src/cmd/compile/internal/amd64/ssa.go b/src/cmd/compile/internal/amd64/ssa.go
index 307cdc5e83..dc1ab4161a 100644
--- a/src/cmd/compile/internal/amd64/ssa.go
+++ b/src/cmd/compile/internal/amd64/ssa.go
@@ -149,6 +149,17 @@ func duff(size int64) (int64, int64) {
func ssaGenValue(s *gc.SSAGenState, v *ssa.Value) {
switch v.Op {
+ case ssa.OpAMD64FMASD:
+ p := s.Prog(v.Op.Asm())
View strings_pkg_warnings.txt
$GOROOT/src/strings/replace.go:450:22: unslice: could simplify s[:] to s
$GOROOT/src/strings/replace.go:148:2: elseif: should rewrite if-else to switch statement
$GOROOT/src/strings/replace.go:156:3: elseif: should rewrite if-else to switch statement
$GOROOT/src/strings/replace.go:219:3: elseif: should rewrite if-else to switch statement
$GOROOT/src/strings/replace.go:370:1: paramTypeCombine: func(pattern string, value string) *singleStringReplacer could be replaced with func(pattern, value string) *singleStringReplacer
$GOROOT/src/strings/replace.go:259:2: rangeExprCopy: copy of r.mapping (256 bytes) can be avoided with &r.mapping
$GOROOT/src/strings/replace.go:264:2: rangeExprCopy: copy of r.mapping (256 bytes) can be avoided with &r.mapping
$GOROOT/src/strings/strings.go:791:1: paramTypeCombine: func(s string, cutset string) string could be replaced with func(s, cutset string) string
$GOROOT/src/strings/strings.go:800:1: paramTypeCombine: func(s string, cutset string) string could be replaced with func(s,
View appends.txt
$GOROOT/src/net/http/socks_bundle.go:106:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:425:4: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:430:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:434:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:438:3: append-combine: can combine chain of 3 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:443:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/vet/asmdecl.go:448:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/dist/test.go:605:3: append-combine: can combine chain of 2 appends into one
$GOROOT/src/cmd/dist/test.go:674:4: append-combine: can combine chain of 2 appends into one
$GOROOT/src/net/dnsclient.go:30:3: append-combine: can combine chain of 4 appends into one
You can’t perform that action at this time.