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
// https://play.golang.org/p/0CnyWvQ8rY | |
package main | |
import ( | |
"bufio" | |
"bytes" | |
"fmt" | |
"io" | |
"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
(function() { | |
function getGoogleCalendarEventID() { | |
var elm = document.querySelector('div.ep[data-eid]'); | |
if (!elm) { | |
return; | |
} | |
var eid = elm.getAttribute('data-eid'); | |
if (!eid) { | |
return; | |
} |
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
command! -nargs=1 BikaBika call s:make_bikabika(<q-args>) | |
command! -nargs=0 BikaBikaStop call s:stop_bikabika() | |
highlight! BikaBika ctermbg=green guibg=green | |
let s:_bika = {} | |
function! s:make_bikabika(pattern) abort | |
if !empty(s:_bika) | |
call s:_bika.stop() |
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
benchmark old ns/op new ns/op delta | |
BenchmarkCompileOnepass/^(?:(?:(?:.(?:$))?))$-4 5782 5759 -0.40% | |
BenchmarkCompileOnepass/^abcd$-4 4831 4974 +2.96% | |
BenchmarkCompileOnepass/^(?:(?:a{0,})*?)$-4 5616 5636 +0.36% | |
BenchmarkCompileOnepass/^(?:(?:a+)*)$-4 5239 5201 -0.73% | |
BenchmarkCompileOnepass/^(?:(?:a|(?:aa)))$-4 6576 6967 +5.95% | |
BenchmarkCompileOnepass/^(?:[^\s\S])$-4 4090 4100 +0.24% | |
BenchmarkCompileOnepass/^(?:(?:(?:a*)+))$-4 5520 5652 +2.39% | |
BenchmarkCompileOnepass/^[a-c]+$-4 4207 4214 +0.17% | |
BenchmarkCompileOnepass/^[a-c]*$-4 4606 4625 +0.41% |
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 test -v -bench=. | prettybench | |
PASS | |
benchmark iter time/iter bytes alloc allocs | |
--------- ---- --------- ----------- ------ | |
BenchmarkBefore-4 200000 7609.00 ns/op 4427 B/op 4 allocs/op | |
BenchmarkAfter-4 500000 3633.00 ns/op 2414 B/op 1 allocs/op |
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
## Commit emoji convention | |
# | |
# | emoji | description | | |
# |--------------------|-----------------------------------------| | |
# | :memo: | Add comment or doc | | |
# | :gift: | New feature. | | |
# | :bug: | Bug fix | | |
# | :bomb: | Breaking compatibility. | |
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 ( | |
"testing" | |
"github.com/kylelemons/godebug/pretty" | |
) | |
type ShipManifest 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
diff --git a/imports/imports.go b/imports/imports.go | |
index 67573f4..32db0ca 100644 | |
--- a/imports/imports.go | |
+++ b/imports/imports.go | |
@@ -124,6 +124,11 @@ func parse(fset *token.FileSet, filename string, src []byte, opt *Options) (*ast | |
if err == nil { | |
return file, nil, nil | |
} | |
+ | |
+ if err != nil && strings.Contains(err.Error(), "missing ',' before newline in composite literal") { |
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 ( | |
"context" | |
"fmt" | |
"log" | |
"golang.org/x/build/gerrit" | |
) |
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 ( | |
"bytes" | |
"flag" | |
"fmt" | |
"io" | |
"os" | |
"strings" |