compiler RFE

212 views
Skip to first unread message

hardcon...@gmail.com

unread,
Jun 17, 2020, 3:16:24 PM6/17/20
to golang-nuts
I remember using mainframe FORTRAN compilers where the compiler would print out a page of symbol cross references.

For each symbol or function there would listed the line where it was defined and then line numbers where it was used/referenced.

Something similar would be useful for GO. Printing out the symbol. it's package, file and line #  and then where it was referenced.

Thanks,

Joe

Ian Lance Taylor

unread,
Jun 17, 2020, 3:44:47 PM6/17/20
to hardcon...@gmail.com, golang-nuts
In Go this would more typically be done using a separate tool rather
than the compiler itself.

Certainly gopls can compute this information.

Ian

Jon Perryman

unread,
Jun 19, 2020, 12:56:11 PM6/19/20
to golang-nuts
Compiler cross references were needed when editor's were used.  Today, we have IDE's (Interactive Development Environments).  Several are available, each with their pro's and con's. I currently use VSCODE but each has features I like and dislike.

Most IDE's allow you to select a variable in a program and right mouse. The options listed will depend upon the programming language. You specifically asked for "find all references" but you will find other useful options such as "goto definition", "goto references", "goto implementation" and much more.

I strongly recommend you get familiar with your IDE otherwise you will get overwhelmed by large projects. 

Good luck, Jon.


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/9a4f6833-265b-4306-81d4-a0c41a08fde2o%40googlegroups.com.

Andrew Archibald

unread,
Jun 22, 2020, 12:47:22 PM6/22/20
to golang-nuts
Is there an existing tool that can generate a DOT digraph of a program's call graph?

Andrew
Reply all
Reply to author
Forward
0 new messages