On Wed, 2023-03-15 at 12:55 -0400, Frank Juedes wrote:
> >
> Hi Dan,
> Thank you very much for your answer, so that's the data structure
> behind maps, very interesting.
> I had actually thought about using unsafe pointers and then type-
> casting, but that is how i would have done it in the C-deka
On 2023-03-15 06:06, Jan Mercl wrote:
On Wed, Mar 15, 2023 at 11:03 AM Frank Jüdes wrote:
Well, that didn't go very far:https://go.dev/play/p/UtsrRar9J0Q
Fails with the messages
./prog.go:15:11: invalid operation: cannot index p_Map (variable of type MAP
constrained by DataMap)
./prog.go:16:26
Which is also the reason why you can't insert into a nil map - you have to
make() one.
On Wednesday, 15 March 2023 at 10:58:09 UTC Dan Kortschak wrote:
> On Tue, 2023-03-14 at 19:56 -0700, Kurtis Rader wrote:
> > Maps are a special-case. You can't pass them "by value" in the sense
> > you mean b
On Tue, 2023-03-14 at 19:56 -0700, Kurtis Rader wrote:
> Maps are a special-case. You can't pass them "by value" in the sense
> you mean because a "map" value is a very tiny structure that contains
> a pointer to the actual map.
The passed value is a pointer to the header, otherwise changes to map
On Wed, Mar 15, 2023 at 11:03 AM Frank Jüdes wrote:
>
> Well, that didn't go very far: https://go.dev/play/p/UtsrRar9J0Q
> Fails with the messages
> ./prog.go:15:11: invalid operation: cannot index p_Map (variable of type MAP
> constrained by DataMap)
> ./prog.go:16:26: cannot range over p_Map (v
Well, that didn't go very far: https://go.dev/play/p/UtsrRar9J0Q
Fails with the messages
./prog.go:15:11: invalid operation: cannot index p_Map (variable of type
MAP constrained by DataMap)
./prog.go:16:26: cannot range over p_Map (variable of type MAP constrained
by DataMap) (MAP has no core ty
Hi Kurtis,
good to know that a map will always be "kind of" passed by reference to
functions. I have verified that with a short test-program on the playground
-> https://go.dev/play/p/HxdgpM-QozM
So in the next code-review all those *[maptype] references will be removed.
Things are very differen
On Tue, Mar 14, 2023 at 7:07 PM Frank Jüdes wrote:
> Thank you very much Ian!
> I am using a pointer to the map because i want to pass the map by
> reference, not by value.
> Those maps can become pretty large and are being handed down through a
> couple of function calls and i don't want them to
Thank you very much Ian!
I am using a pointer to the map because i want to pass the map by
reference, not by value.
Those maps can become pretty large and are being handed down through a
couple of function calls and i don't want them to be copied over and over
again.
I read the document you re
On Tue, Mar 14, 2023 at 6:27 PM Frank Jüdes wrote:
>
> i still somewhat new with Go and need a little tutoring: I have to create
> Excel files, using the excelize package and wrote a little function to store
> data from a map[string]int64 into a column within the worksheet:
>
> //
> ---
10 matches
Mail list logo