diff options
author | Felix Lange <fjl@twurst.com> | 2017-02-16 20:21:11 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2017-02-16 20:44:09 +0800 |
commit | 2c4455b12aca82ccd29c05c1750c25430867e545 (patch) | |
tree | 0beb8c96c7bf6a5a82434ed79218e822927434c3 /vendor/golang.org/x/tools | |
parent | c8695fae359aa327da9203a57ffaf4f2d47d4370 (diff) | |
download | dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.gz dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.bz2 dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.lz dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.xz dexon-2c4455b12aca82ccd29c05c1750c25430867e545.tar.zst dexon-2c4455b12aca82ccd29c05c1750c25430867e545.zip |
vendor: update dependencies with github.com/kardianos/govendor
Diffstat (limited to 'vendor/golang.org/x/tools')
-rw-r--r-- | vendor/golang.org/x/tools/go/ast/astutil/imports.go | 11 | ||||
-rw-r--r-- | vendor/golang.org/x/tools/imports/imports.go | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/vendor/golang.org/x/tools/go/ast/astutil/imports.go b/vendor/golang.org/x/tools/go/ast/astutil/imports.go index 2e81f4d3a..36c536b5e 100644 --- a/vendor/golang.org/x/tools/go/ast/astutil/imports.go +++ b/vendor/golang.org/x/tools/go/ast/astutil/imports.go @@ -234,16 +234,17 @@ func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (del } } - gen.Lparen = token.NoPos // drop parens spec := gen.Specs[0].(*ast.ImportSpec) + + // Move the documentation right after the import decl. if spec.Doc != nil { - // Move the documentation above the import statement. - gen.TokPos = spec.Doc.End() + 1 + for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Doc.Pos()).Line { + fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) + } } - for _, cg := range f.Comments { if cg.End() < spec.Pos() && fset.Position(cg.End()).Line == fset.Position(spec.Pos()).Line { - for fset.Position(gen.TokPos).Line != fset.Position(spec.Pos()).Line { + for fset.Position(gen.TokPos).Line+1 < fset.Position(spec.Pos()).Line { fset.File(gen.TokPos).MergeLine(fset.Position(gen.TokPos).Line) } break diff --git a/vendor/golang.org/x/tools/imports/imports.go b/vendor/golang.org/x/tools/imports/imports.go index c26c1946a..67573f497 100644 --- a/vendor/golang.org/x/tools/imports/imports.go +++ b/vendor/golang.org/x/tools/imports/imports.go @@ -276,7 +276,7 @@ func addImportSpaces(r io.Reader, breaks []string) []byte { } if inImports && len(breaks) > 0 { if m := impLine.FindStringSubmatch(s); m != nil { - if m[1] == string(breaks[0]) { + if m[1] == breaks[0] { out.WriteByte('\n') breaks = breaks[1:] } |