Skip to content

go.tools/imports: fails to parse valid Go code #6983

@dgryski

Description

@dgryski
(Sorry I haven't managed to trim down the test case.  In doing so, I kept running into
the formatting problem I just reported with strange comment movements.)


What steps will reproduce the problem?
1. git clone github.com/dgryski/dkrcrypt  
2. edit aria.go, add "var _ cipher.Block = &AriaCipher{}" at the bottom
3. goimports

What is the expected output?
The crypto/cipher import is added.

What do you see instead?
I get a warning added to the top of my fail (which then fails to compile -- this may be
vim integration problems).
2013/12/18 10:16:12 addImportViaSourceModification error: 194:3: expected 1 expression
and the crypto/cipher import is added oddly split across a comment:

import
  
// The ARIA Block cipher from KISA
// Copyright (c) 2012 Damian Gryski <damian@gryski.com>
// Licensed under the GPLv3 or, at your option, any later version.
"crypto/cipher"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions