~mna/snow

snow/pkg/codegen/testdata/fn_call_struct_init.snow.want -rw-r--r-- 389 bytes
424066c5Martin Angers doc: v0.0.5 1 year, 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package main

import "fmt"

type _اS struct {
	_اx int
	_اy string
}

func _اSاnew(
	s _اS,
	m map[string]bool,
) _اS {
	var r _اS
	if m["x"] {
		r._اx = s._اx
	}
	if m["y"] {
		r._اy = s._اy
	}
	return r
}

func _اprintln(
	s _اS,
) {
	fmt.Println(s)
}

func main() {
	var s _اS = _اSاnew(_اS{_اx: 1, _اy: "a"}, map[string]bool{"x": true, "y": true})
	_اprintln(s)
}