Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Convert spaces to tabs #16

Closed
athyuttamre opened this issue Apr 9, 2016 · 13 comments
Closed

Convert spaces to tabs #16

athyuttamre opened this issue Apr 9, 2016 · 13 comments

Comments

@athyuttamre
Copy link

Any way to convert spaces to tabs when saving?

@joefitzgerald
Copy link
Owner

This already happens?

@athyuttamre
Copy link
Author

Sorry, but doesn't seem to be working for me. I'm on the latest version of the package, and have my tabs setting in Atom to auto.

Here's a video of what I'm encountering: https://www.dropbox.com/s/fspku5qi4j2n2pj/gofmt.mov?dl=0.

Please let me know if you need more info to help debug this.

@joefitzgerald
Copy link
Owner

gofmt / goimports/ goreturns are clearly not being called successfully. Please make sure you run go get -u golang.org/x/tools/cmd/goimports or the equivalent for goreturns if you're using that.

@athyuttamre
Copy link
Author

Ah, I think I know the problem. It's the same issue as #14.

I'm not using Go's normal build command, and instead using something custom. So I too was looking for just formatting + build errors on save. The reason formatting wasn't working was because I had build errors.

Would it be possible to add a setting to surface build errors to the Atom panel with this package?

@joefitzgerald
Copy link
Owner

Are you using gb?

@athyuttamre
Copy link
Author

Probably not, since I'm not familiar with it. I'm writing a package that's being imported by another project that's actually being built.

So my cli.go file in package main imports package raft, which I'm editing right now.

@joefitzgerald
Copy link
Owner

So how is raft being built? If your source is invalid, gofmt / goimports and goreturns will not work.

@athyuttamre
Copy link
Author

If I'm not wrong, it gets built when I build package main. (Sorry, operating off of stencil code for a class here.)

And yep, exactly, gofmt fails because my source is invalid, but it would be ideal to surface those errors in the Atom panel.

@athyuttamre
Copy link
Author

So, to be clear, the original issue is no longer a problem. I have build errors in my source. You can close this issue!

My request is to surface errors through this package too, not just builder-go. This could be enabled/disabled using a setting.

@joefitzgerald
Copy link
Owner

So it's still using go build then? Install the builder-go package (or go-plus, which will do it for you).

@joefitzgerald
Copy link
Owner

I cannot surface the errors for this package without causing duplicates from builder-go. These are the exact same errors; why can't you use builder-go?

@athyuttamre
Copy link
Author

Yes, sorry! And thank you for your patience.

So maybe the issue is different? I am using go-plus, and therefore builder-go. However it doesn't surface the errors that simply running gofmt myfile.go throws up.

Screenshot of my shell:

screenshot 2016-04-09 23 47 52

Screenshot of the same file in Atom with no issues:

screenshot 2016-04-09 23 48 21

@athyuttamre
Copy link
Author

I think I know what the issue is. Reported here: joefitzgerald/builder-go#2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants