~/talk

Static Analysis in Go

Talkat Golang UK 2017 · 2017-08-16..08-18· [testing, developer-experience]
links:none on file
slides:none on file

Step‑by‑step walkthrough of how to tokenise, parse and type‑check Go source to find actual occurrences of a type named "gopher" (demo finds it three times), using go/token, go/ast with ast.Inspect and go/types via a pass/File→token.FileSet→types.Info flow; shows how that data powers two real projects: go‑httpdoc (generate API docs from HTTP tests) and a reflection helper (gpass) that accesses nested struct fields by Go expressions. Concrete code snippets and error handling included.

AI-written summary · about

  1. 0:00Intro
  2. 1:38Tech Commnities
  3. 2:54Where's Gopher?
  4. 4:29Static Analysis & Dynamic Analysis
  5. 5:20Reflection → Reflection
  6. 5:59Static Analysis Tools for Go → There are many static analysis tools for Go
  7. 7:13Go for Static Analysis → Go is easy to static analyze
  8. 7:47Sub packages of go package
  9. 8:14Flow of Static Analysis
  10. 11:14Parsing -go/parser,go/ast → Converting tokens to abstract syntax tree
  11. 12:46AST of "Hello, World"
  12. 17:08Getting AST from a file
  13. 18:56token. FileSet
  14. 24:43Traversing AST - Recursively
  15. 25:14Inspect identifiers
  16. 27:28Type Checking (types.Config).Check do a type checking
  17. 28:49types. Info holds results of type checking
  18. 29:26Inspect Gopher type
  19. 33:04Tests for requests and responses
  20. 35:53Create own static analysis tools
  21. 36:46Banner Tool → A management tool of in-app banners
  22. 37:49Evaluation of Delivery Conditions → Describing delivery conditions by a Go like expression
  23. 39:10Conclutions → Static Analysis is EASY in Go
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.