aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-toolsmith/astp/README.md
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-07-04 11:12:55 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-07-04 15:05:30 +0200
commitc7d7f10bdff703e4a3c0414e8a33d4e45c91eb35 (patch)
tree0dff0ee1f98dbfa3ad8776112053a450d176592b /vendor/github.com/go-toolsmith/astp/README.md
parent9573094ce235bd9afe88f5da27a47dd6bcc1e13b (diff)
go.mod: vendor golangci-lint
Diffstat (limited to 'vendor/github.com/go-toolsmith/astp/README.md')
-rw-r--r--vendor/github.com/go-toolsmith/astp/README.md39
1 files changed, 39 insertions, 0 deletions
diff --git a/vendor/github.com/go-toolsmith/astp/README.md b/vendor/github.com/go-toolsmith/astp/README.md
new file mode 100644
index 000000000..7313c6ab8
--- /dev/null
+++ b/vendor/github.com/go-toolsmith/astp/README.md
@@ -0,0 +1,39 @@
+[![Go Report Card](https://goreportcard.com/badge/github.com/go-toolsmith/astp)](https://goreportcard.com/report/github.com/go-toolsmith/astp)
+[![GoDoc](https://godoc.org/github.com/go-toolsmith/astp?status.svg)](https://godoc.org/github.com/go-toolsmith/astp)
+[![Build Status](https://travis-ci.org/go-toolsmith/astp.svg?branch=master)](https://travis-ci.org/go-toolsmith/astp)
+
+
+# astp
+
+Package astp provides AST predicates.
+
+## Installation:
+
+```bash
+go get github.com/go-toolsmith/astp
+```
+
+## Example
+
+```go
+package main
+
+import (
+ "fmt"
+
+ "github.com/go-toolsmith/astp"
+ "github.com/go-toolsmith/strparse"
+)
+
+func main() {
+ if astp.IsIdent(strparse.Expr(`x`)) {
+ fmt.Println("ident")
+ }
+ if astp.IsBlockStmt(strparse.Stmt(`{f()}`)) {
+ fmt.Println("block stmt")
+ }
+ if astp.IsGenDecl(strparse.Decl(`var x int = 10`)) {
+ fmt.Println("gen decl")
+ }
+}
+```