@@ -236,14 +236,16 @@ func linuxNetworking(buildTags []string) bool {
236
236
return false
237
237
}
238
238
239
- // The boolean indicates whether to merge the subdirs. True means merge, false
240
- // means use the TinyGo version.
239
+ // The boolean indicates whether to merge the subdirs.
240
+ //
241
+ // True: Merge the golang and tinygo source directories.
242
+ // False: Uses the TinyGo version exclusively.
241
243
func pathsToOverride (goMinor int , buildTags []string ) map [string ]bool {
242
244
paths := map [string ]bool {
243
- "" : true ,
245
+ "" : true , // root
244
246
"crypto/" : true ,
245
247
"crypto/rand/" : false ,
246
- "crypto/tls/" : false ,
248
+ "crypto/tls/" : false , // necessary for embedded tls
247
249
"device/" : false ,
248
250
"examples/" : false ,
249
251
"internal/" : true ,
@@ -256,7 +258,7 @@ func pathsToOverride(goMinor int, buildTags []string) map[string]bool {
256
258
"internal/task/" : false ,
257
259
"internal/wasi/" : false ,
258
260
"machine/" : false ,
259
- "net/" : true , // this is important if the GOOS is not linux
261
+ "net/" : true , // this is important if the GOOS != linux
260
262
"net/http/" : false ,
261
263
"os/" : true ,
262
264
"reflect/" : false ,
@@ -276,15 +278,12 @@ func pathsToOverride(goMinor int, buildTags []string) map[string]bool {
276
278
paths ["syscall/" ] = true // include syscall/js
277
279
}
278
280
281
+ // To make sure the correct version of the net package is used, it is advised
282
+ // to clean the go cache before building
279
283
if linuxNetworking (buildTags ) {
280
284
for _ , v := range []string {"crypto/tls/" , "net/http/" , "net/" } {
281
285
delete (paths , v ) // remove entries so go stdlib is used
282
286
}
283
-
284
- // ensure that the goroot path does not contain the the tinygo net package
285
- // path
286
- } else {
287
- // if the GOOS!=linux several tls files have to be for tls
288
287
}
289
288
290
289
return paths
0 commit comments