There are two things at play here:
1. many builtins, including append, are not real functions. The compiler
will always expand them into a certain sequence of instructions.
2. some builtins, including append, do involve calling functions, either
always or in some cases (for example sometimes append will call
runtime.growslice). But they are private runtime functions and we always
skip those (because the compiler freely inserts them in many places, some of
which wouldn't look like function calls to users).
The only way to really see what's going on is to use the disassemble command
and the only way to step into a private runtime function is to set a
breakpoint on it, 'step' will not enter them.
On Sun, 26 Apr 2020 11:43:55 -0700, Choudhary Sourya Vatsyayan <
souryav...@gmail.com> wrote:
> In the following code, I tried stepping into the builtin function append but
> Delve simply goes ahead, onto the next statement in main function.
>
> What could be the reason for it? I had a few theories, but I am pretty sure
> that none of them is the real (or complete) reason.
>
> Theories:
>
> 1. append in line number 15 is optimised, hence, the work of appending
> a known number to a slice is done beforehand: However, delve compiles with
> optimisations disabled, so this should not be the case. The fmt.Sprintf
> in line number 17 can be stepped in, however, but the append can still
> not be stepped into. Hence, this hypothesis probably does not hold.
> 2. append is not a real function, hence the compiler figures out which
> --
> You received this message because you are subscribed to the Google Groups "delve-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
delve-dev+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/delve-dev/4a9c6084-60e8-43e0-be5f-5cdd13d6ae93%40googlegroups.com.
>