-
Notifications
You must be signed in to change notification settings - Fork 567
Description
Hello all,
First of all, thx for this awesome plugin.
I configure the plugin filewatcher to goimported on each save my go giles.
Is it possible to add the possibility to add new import at the beginning of the import block instead of at its end.
Because that's cause some trouble with goimports that sort the import block.
I try to describle the pb with this example:
initial:
import (
"fmt"
"sync"
)
if add github.com/inconshreveable/log15
via auto import of the idea plugin, I have this :
import (
"fmt"
"sync"
"github.com/inconshreveable/log15"
)
When I save (filewatcher executes goimport on it), I have this:
import (
"fmt"
"sync"
"github.com/inconshreveable/log15"
)
If I add another package from stdlib (for example strconv) with auto import (as it appends the new import at the end of the block), I have this:
import (
"fmt"
"sync"
"github.com/inconshreveable/log15"
"strconv"
)
If I save it (and goimported), I have this:
import (
"fmt"
"sync"
"strconv"
"github.com/inconshreveable/log15"
)
So if autoimport add the new package à the beginning the import block like this
import (
"strconv"
"fmt"
"sync"
"github.com/inconshreveable/log15"
)
When I save/goimport the file, I have expected result like this:
import (
"fmt"
"strconv"
"sync"
"github.com/inconshreveable/log15"
)
Regard
Jérôme