Hi all

I am trying to understand the implementation of os.Args().

The os package says this is implemented in the runtime package

file runtime.go contains:
var argslice 
<https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/runtime/runtime.go;bpv=1;bpt=1;l=50?gsn=argslice&gs=kythe%3A%2F%2Fgolang.org%3Flang%3Dgo%3Fpath%3Druntime%23var%2520argslice>
 
[]string 
<https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/runtime/runtime.go;bpv=1;bpt=1;l=50?gsn=string&gs=kythe%3A%2F%2Fgolang.org%3Flang%3Dgo%3Froot%3Dref%2Fspec%23builtin-type%2520string>

//go:linkname os_runtime_args os.runtime_args 
func os_runtime_args 
<https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/runtime/runtime.go;bpv=1;bpt=1;l=59?gsn=os_runtime_args&gs=kythe%3A%2F%2Fgolang.org%3Flang%3Dgo%3Fpath%3Druntime%23func%2520os_runtime_args>()
 
[]string 
<https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/runtime/runtime.go;bpv=1;bpt=1;l=59?gsn=string&gs=kythe%3A%2F%2Fgolang.org%3Flang%3Dgo%3Froot%3Dref%2Fspec%23builtin-type%2520string>
 
{ return append 
<https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/runtime/runtime.go;bpv=1;bpt=1;l=59?gsn=append&gs=kythe%3A%2F%2Fgolang.org%3Flang%3Dgo%3Froot%3Dref%2Fspec%23builtin-func%2520append>
([]string 
<https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/runtime/runtime.go;bpv=1;bpt=1;l=59?gsn=string&gs=kythe%3A%2F%2Fgolang.org%3Flang%3Dgo%3Froot%3Dref%2Fspec%23builtin-type%2520string>{},
 
argslice 
<https://cs.opensource.google/go/go/+/refs/tags/go1.16.7:src/runtime/runtime.go;drc=refs%2Ftags%2Fgo1.16.7;l=50>...)
 
} 

*My question is:*

Where in the implementation is argslice populated?

Thanks for any insight someone can provide.

Cheers

Hamish

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4306ec54-bf1c-4797-987a-289dfc4e87edn%40googlegroups.com.

Reply via email to