On Sunday, December 19, 2021 at 9:24:00 AM UTC-8 Jan Mercl wrote:
> On Sun, Dec 19, 2021 at 6:03 PM jlfo...@berkeley.edu
> wrote:
> > 1) Let's say I wanted to make the map elements smaller, so the map value
> would be a pointer to a structure, not the structure itself. I couldn't
> figure o
Oops, please ignore that. I was modifying the wrong play code.
>
--
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 vi
On Sunday, 19 December 2021 at 17:24:48 UTC b...@gmail.com wrote:
> you must use pointers, otherwise you can not do something like this:
>
> ft["a"].name = "b"
>
> As the entries in the map are non-addressable.
>
???
https://go.dev/play/p/ubx-WnElJOY
--
You received this message because you a
https://go.dev/play/p/fglmNnWFUxP
I would not worry about using pointers inside the map if the data is really
read only. If it is not, you must use pointers, otherwise you can not do
something like this:
ft["a"].name = "b"
As the entries in the map are non-addressable.
On Sun, Dec 19, 2021 at
On Sun, Dec 19, 2021 at 6:03 PM jlfo...@berkeley.edu
wrote:
> 1) Let's say I wanted to make the map elements smaller, so the map value
> would be a pointer to a structure, not the structure itself. I couldn't
> figure out how to modify this program so that the initialization still
> worked. Any
Consider the following extremely condensed program:
package main
type func_type func (a string)(out int)
type fte struct {
name string
expand_args bool
function func_type
}
var ft = map[string]fte {
"a":{"a", true, func_a},
};
func func_a(a string