You can get the CFG (control flow graph) for a function by setting the 
environment variable GOSSAFUNC to the function in question when building.
It will generate a file named ssa.html in the current directory which you 
can load into a browser.  It doesn't draw the CFG explicitly but the nodes 
(basic blocks) and edges are all listed.

GOSSAFUNC=foo go build <some target>

will generate an ssa.html file for the foo function (as well as spew lots 
of info about foo to stdout).

On Saturday, November 26, 2016 at 4:05:03 AM UTC-8, Michael Jones wrote:
>
> I had the same reaction. More of a riddle than a question. 
>
> If CFG means Context Free Grammar, then how could it be something of a 
> program rather than of the language? 
>
> if CFG means Configuration File, then the programming language would have 
> nothing to do with the quest for the file, which would be a separate entity.
>
> If CFG means Control Flow Graph, then "access" is problematic as the flow 
> graph is more an attribute to be derived rather than a manifest element to 
> be accessed.
>
> Other CFGs, including Certificat de Formation Générale, the airport code 
> for Cienfuegos Cuba, Cubic Feet Gas, Cross Florida Greenway, and the 
> airline Condor Flugdienst GmbH, amongst others, seem far removed from Go 
> programs.
>
> So, the best guest is Control Flow Graph. The best answer is to start with 
> the graphical output of execution profiling as explained in the Go Blog (in 
> 2011):
>
> https://blog.golang.org/profiling-go-programs
>
> On Sat, Nov 26, 2016 at 6:45 AM, Tamás Gulácsi <tgula...@gmail.com 
> <javascript:>> wrote:
>
>> What the hell is a CFG?
>>
>> --
>> 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 <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Michael T. Jones
> michae...@gmail.com <javascript:>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to