access modifiers: update tests/examples
parent
78131e78bc
commit
dc83e30a44
|
@ -154,6 +154,19 @@ fn test_assoc_with_constants() {
|
|||
assert again.b == 22
|
||||
}
|
||||
|
||||
struct AttrTest{
|
||||
a int // private immutable (default)
|
||||
mut:
|
||||
b int // private mutable
|
||||
c int // (you can list multiple fields with the same access modifier)
|
||||
pub:
|
||||
d int // public immmutable (readonly)
|
||||
pub mut:
|
||||
e int // public, but mutable only in parent module
|
||||
//__global:
|
||||
f int // public and mutable both inside and outside parent module
|
||||
}
|
||||
|
||||
/*
|
||||
[typedef]
|
||||
struct C.fixed {
|
||||
|
|
|
@ -21,8 +21,7 @@ struct Reader {
|
|||
// has_header bool
|
||||
// headings []string
|
||||
data string
|
||||
pub:
|
||||
mut:
|
||||
pub mut:
|
||||
delimiter byte
|
||||
comment byte
|
||||
is_mac_pre_osx_le bool
|
||||
|
|
|
@ -44,10 +44,9 @@ pub struct Log {
|
|||
mut:
|
||||
level LogLevel
|
||||
output_label string
|
||||
|
||||
ofile os.File
|
||||
output_to_file bool
|
||||
pub:
|
||||
pub mut:
|
||||
output_file_name string
|
||||
}
|
||||
|
||||
|
|
|
@ -321,7 +321,7 @@ fn escape(s string, mode EncodingMode) string {
|
|||
// URL's String method uses the escaped_path method to obtain the path. See the
|
||||
// escaped_path method for more details.
|
||||
pub struct URL {
|
||||
pub: mut:
|
||||
pub mut:
|
||||
scheme string
|
||||
opaque string // encoded opaque data
|
||||
user &Userinfo // username and password information
|
||||
|
|
|
@ -5,14 +5,12 @@
|
|||
module urllib
|
||||
|
||||
struct Value {
|
||||
pub:
|
||||
mut:
|
||||
pub mut:
|
||||
data []string
|
||||
}
|
||||
|
||||
struct Values {
|
||||
pub:
|
||||
mut:
|
||||
pub mut:
|
||||
data map[string]Value
|
||||
size int
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue