Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What Is Types Marshaling Among JS and GOLANG Spaces. #564

Open
gastraight opened this issue Mar 25, 2024 · 0 comments
Open

What Is Types Marshaling Among JS and GOLANG Spaces. #564

gastraight opened this issue Mar 25, 2024 · 0 comments

Comments

@gastraight
Copy link

Hi!

Is there any simple 2-3 terms rule that allow. to grasp some general idea behind the types mapping/conversion among js and golang spaces or is it more like a batch of a lot individual cases?

E.g. in particular to cover such questions

  • js function() {} instance is just a func () one in golang or could it be as well be an object with a constructor of Function and the methods of call, apply etc. Could it be just chosen among both cases?

  • Or is there any chance to map something like someFunc in the following example into golang space

    const someFunc = (a) => a + 1;
    someFunc.other = (a) => a * 2;
  • As I understood any "scalar" types and their related pointers in golang are just mapped the similarly into respective js primitives?
  • As both js hashes and any class instances mapped to either map[string]any or related struct{} still is it possible to restrict mapping to fail from js into a struct{} if there're any extra property exists in js object that is non presented in golang one?
  • Could js Symbol-indexed properties or even Maps be mapped into something like map[any]any
  • etc.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant