futuretea / lazydog

inject golang source code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lazydog

Introduction

Just one thing , inject golang source code and print where is the code now !

Sometimes, l need to read some opensource golang project like tidb, jaeger, consul or other things. However, l'm too stupid to follow the code, especially when interface{} flies !

Impl way

l use golang standard lib to parse itself (A language can parse itself, amazing!), and inject what l want to do to the ast file.This is simple actually.

Install

make install

run test

make jumptest
make overtest

how to use

Inject the source code in dir recursively; never mind what the code will look like, just run the fucking opensource project and read the log.

lazydog jump -d src

And of course, lt can be restored

lazydog over -d src

what the log contains

[lazydog][{{goroutine id}}] {{pkgname}}:{{lineNo}} caller={{function}}

About

inject golang source code

License:MIT License


Languages

Language:Go 98.3%Language:Makefile 1.7%