Skip to content

Instantly share code, notes, and snippets.

View haya14busa's full-sized avatar
🐶

haya14busa haya14busa

🐶
View GitHub Profile
package main
import (
"testing"
"github.com/kylelemons/godebug/pretty"
)
type ShipManifest struct {
Name string
@haya14busa
haya14busa / patch.diff
Created February 4, 2017 13:55
ignore missing ','
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") {
@haya14busa
haya14busa / 2017-01-28-193616.go
Last active January 30, 2017 00:04
gerrit CommentInput test
package main
import (
"context"
"fmt"
"log"
"golang.org/x/build/gerrit"
)
@haya14busa
haya14busa / lint-throw.go
Last active January 14, 2017 16:06
linter for throw usage in vital.vim
package main
import (
"bytes"
"flag"
"fmt"
"io"
"os"
"strings"
@haya14busa
haya14busa / create_review.go
Created January 4, 2017 15:43
testing GitHub review API
package main
import (
"fmt"
"log"
"os"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
@haya14busa
haya14busa / pr17.diff
Created December 22, 2016 13:40
pr17.diff
diff --git a/.drone.sec b/.drone.sec
index f1a10a2..28b15e3 100644
--- a/.drone.sec
+++ b/.drone.sec
@@ -1 +1 @@
-eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.M2qFghvswadLY_OZqIAlf8RUgWQIZH5F6wL7g1DNmRDp8IzLmRltg0bbb8cDK2qJcG8STL2gi9m_SrW9bHrwR87Mg4SFYM50-RISmVh3-vTJpbKhZiGqW27xb9b0wOufJKSCWPKNtQK7mCpfO9aZMSGbMcln8aMJUyZt4povZVxRm8H1sq6KOEetg8eRYkAmbThche2KQQv3wU061dr0CaHHcdXZhrFWOuV4XlvWsB-yjpxntNksZQOCdDZ3dZHdJPdtt3AqnfkxqyGl16Q7fC1MUwDANwCvuD-omnvgGsQHybpsr2nmrG3Ce8ysMaO4Dkyv5d4M6qwHJRZfEfH1ew.W9jt_Vq4V41j1yuz.dSRr2SDGBDOMctB5RBLMhgk3w-wr9JnqCqxI02Tl_rIeXwbXsJi7Qutao1Nx8KFVB3umc7HLcizJd1KK9bwezSye2hoc3EvKBdFy4InuOKhrb7EW4bziRdE9x6e2ACAccYbZ1_Cn_-nklRP-SE0dA5C7mwzIFIbbUZlkp581nmuHmNQxzKEtmuIytm1rQnDjJD6q4aYx3gBFuA0-HPtb.43ijUiX-PTBYt9O95cuF-Q
\ No newline at end of file
+eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.GVCyMNII0AoQKyoZuVoy90AR5hhc5qKNDK8GEjaLS2xo1Kx3saLnkryg8DuOCE-Avf0O62toDYD0VIgXi6mtN5flf0JLAYdV_A6DZXfim3RVVzTBmHwVeeYwSt1K4TcOi_AT5iuXDLPj9Af87xdB7FMAvFr9hqOiCqA1_Oa2Zn-9BtzYVto_SXwrmPxM0K0
@haya14busa
haya14busa / 2016-12-22-173545.go
Created December 22, 2016 09:03
test go-github review API (ListReviews/GetReviews/ListReviewComments)
package main
import (
"fmt"
"log"
"github.com/google/go-github/github"
)
func main() {
@haya14busa
haya14busa / result.txt
Created December 5, 2016 10:56
gosumcheck example
$ gosumcheck github.com/mackerelio/...
/home/haya14busa/src/github.com/mackerelio/mkr/alerts.go:127:3: uncovered cases for github.com/mackerelio/mackerel-client-go.Monitor type switch:
- *github.com/mackerelio/mackerel-client-go.MonitorExpression
$ gosumcheck golang.org/x/tools/...
/home/haya14busa/src/golang.org/x/tools/cmd/godex/print.go:95:5: uncovered cases for go/types.Object type switch:
- *go/types.Nil
- *go/types.Label
- *go/types.PkgName
- *go/types.object
/home/haya14busa/src/golang.org/x/tools/cmd/guru/definition.go:163:4: uncovered cases for go/ast.Decl type switch:
@haya14busa
haya14busa / ast.go
Created December 4, 2016 17:15
How go/ast represents syntax tree
// source: https://github.com/golang/go/blob/d54b60a2b2470ea42559b58995e86ff20dd70471/src/go/ast/ast.go
type Node interface {
Pos() token.Pos
End() token.Pos
}
type Expr interface {
Node
exprNode()
@haya14busa
haya14busa / 2016-11-24-235047.vim
Created November 24, 2016 15:28
parse by syntax
function! s:func() abort
" hoge
endfunction
function! ParseBySyntax() abort
let lines = getline(1, '$')
for [lnum, l] in map(lines, {i,l -> [i+1, l]})
echo '---'
echo lnum l