Closed rmescandon closed 7 years ago
Thanks Roberto. Couple items:
If we don't drop wifiap.go, then every time we need to add a new rest api call we have to implement it twice.
I'd prefer SNAP_COMMON because it persists through snap version increments, whereas SNAP_DATA does not, I think, unless there's a reason for this change.
Do you agree it is reasonable to only output text if there is an error, or if the command clearly should output something (like show the ap config)?
1) I've moved the REST operations to wifiap.go, leaving in restclient.go only the generic methods used for any request. This way makes sense wifiap existence 2) Completely agree. For some (unknown) reason, when I made some tests I was only able to access remote snap folder path. But I've now tried original one in common folder and goes ok. Changed to SNAP_COMMON/sockets 3) TBH, I also was not too convinced of returning anything. Removed. 4) This is the only point to see how to solve. I used sublime text except for this last change, where I've made changes using Visual Studio Code. In both IDEs there are plugins formatting code. Let me know if now you see same lack of alignment in vi and we can discuss a good solution.
About formatting Go. There are no problems with Go and formatting. All plugins should be using gofmt, which has very strict rules (always tabs!).
@knitzsche Are you using the vi Go plugin? (https://github.com/fatih/vim-go) If not, you should. That will format your code in the "Go way" :smile:
Actually, to make sure all code is Go compliant, please, run gofmt in all the code and submit a pull request. Thanks!
Tested on armhf (rpi3) Verified operations:
Removed not needed yet unixhttpc tool