Repository navigation
main: add tinygo fix - #5992
main: add tinygo fix#5992davecheney wants to merge 1 commit into
Conversation
|
This is mostly working now. It has some usability issues compared to regular More than modernising existing tinygo code, it unlocks the |
|
example one ./build/tinygo fix -target pico -diff -rangeint ./src/internal/reflectlite-for i := uintptr(0); i < size; i++ {
+for range size {example two ./build/tinygo fix -target pico -diff -rangeint ./src/machine/usb/msc-for i := 0; i < length; i++ {
+for i := range length {example three ./build/tinygo fix -C ~/devel/drivers -target pico -diff -rangeint ./ssd1289-for i := uint8(0); i < 16; i++ {
+for i := range uint8(16) {
pin := machine.Pin(i + uint8(firstPin))
pin.Configure(machine.PinConfig{Mode: machine.PinOutput})
}example four; interface{} -> any ./build/tinygo fix -C ~/devel/drivers -target pico -diff -any ./tester- Fatalf(f string, a ...interface{})
+ Fatalf(f string, a ...any)#5966 adds TINYGOROOT=<rename-branch-sources> ./build/tinygo fix \
-C <caller-module> -target pico -inline -diff .-value, err := machine.GetRNG()
+value, err := machine.RandomUint32() |
b0b5d18 to
0f4e85c
Compare
|
The test failure is karma for fixing the tests so they actually run on windows :) |
0f4e85c to
fb7ea26
Compare
go fix cannot load TinyGo's src packages or target-specific code because it does not know TinyGo's overlays and build tags. tinygo fix runs the go fix analyzers through TinyGo's loader, so the same modernizations can be applied to TinyGo itself and to programs built for a TinyGo target.
fb7ea26 to
5b0b244
Compare
|
@davecheney thanks for working on fixing fix. I checked out this PR and ran the tests locally. Here are some notes edited from an automated review:
What do you think? Thanks! |
Thanks for the feedback. I'll take another pass at this in the morning. buenas noches |
go fix cannot load TinyGo's src packages or target-specific code because it does not know TinyGo's overlays and build tags.
Instead, tinygo fix runs the go fix analyzers through TinyGo's loader, so the same modernizations can be applied to TinyGo itself and to programs built for a TinyGo target.
/ht to @dgryski for the suggestion