File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -58,20 +58,20 @@ func (r *Resolve) WIT(_ Node, _ string) string {
58
58
slices .SortFunc (packages , func (a , b * Package ) int {
59
59
return strings .Compare (a .Name .String (), b .Name .String ())
60
60
})
61
- // Special case if only single package.
62
- if len (packages ) == 1 {
63
- return packages [0 ].WIT (nil , "" )
64
- }
65
- // Use single-file, multi-package style:
66
- // https://github.com/WebAssembly/component-model/pull/340
67
- // https://github.com/bytecodealliance/wasm-tools/pull/1577
68
61
var b strings.Builder
69
62
for i , p := range packages {
70
- if i > 0 {
63
+ if i == 0 {
64
+ // Context == nil means write non-nested form of package
65
+ // https://github.com/bytecodealliance/wasm-tools/pull/1700
66
+ b .WriteString (p .WIT (nil , "" ))
67
+ } else {
71
68
b .WriteRune ('\n' )
72
69
b .WriteRune ('\n' )
70
+ // Context == *Resolve means write single-file, multi-package style:
71
+ // https://github.com/WebAssembly/component-model/pull/340
72
+ // https://github.com/bytecodealliance/wasm-tools/pull/1577
73
+ b .WriteString (p .WIT (r , "" ))
73
74
}
74
- b .WriteString (p .WIT (r , "" ))
75
75
}
76
76
return b .String ()
77
77
}
You can’t perform that action at this time.
0 commit comments