#Is there any concept of `private functions` in zig?

1 messages · Page 1 of 1 (latest)

weak veldt
#

From what ih ave seen, looks like the answer is No, but just in case!

golden otter
#

Yes, don't make it pub

naive palm
#

fn xyz() void already is a private (meaning you can only access it from the same file).

meager laurel
#

In case this is why you didn't know: within a single file, all functions are declarations are visible. pub affects visibility for other files that import it.

weak veldt
#

That explains it, I was in the same file actually. So same file but private is not a thing then?

#

I guess not, since functions inside structs are just namespaced functions right?

meager laurel