Comments (2)
Hi @kyubuns
Yes! See this discussion:
If a struct has at least one private member (and in your example id
is private, since it's the default), it will be impossible to use struct initialization syntax outside the module it's defined in.
So you'll have to provide a constructor method (like new_user() User
).
from v.
Great.
Thanks!!
from v.
Related Issues (20)
- Uniform Function Call Syntax (UFCS) HOT 2
- Veb livereload flag needs to be renamed HOT 1
- A compilation error is thrown after compiling the Custom Iterators example in the For Loop documentation HOT 3
- Compiling an Array Slice example does not produce the result mentioned in the documentaion
- Struct and Reference Struct type mismatch in Struct Default Value
- auto deref not working
- rename os.getwd -> os.getcwd HOT 1
- cgen: regression for Option return of C alias
- Rename 'make.bat' to another name
- Sibling Module Imports
- Generic function pointer returns wrong output HOT 2
- @[heap] flag in wrapper struct does not make the error disappear
- using a C struct as a struct field does not adopted default values HOT 1
- v does not support Chinese character path name under Windows 10 HOT 3
- Storing a function result value in a variable does not work as expected in an `or` block
- A struct with an option field of type interface doesn't accept none as value
- cgen error for `x := 5 * p` where `p` is &int HOT 2
- [info] and incase helps others (is now working) HOT 1
- vfmt erasing lines of code following `// vfmt off` HOT 2
- C error when compiling code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v.