• Tim Cooper's avatar
    go/printer: allow one-method interfaces to be printed on a single line · 92ba9b5c
    Tim Cooper authored
    Previously, only the empty interface could be formatted to print on a
    single line. This behaviour made short one-method interfaces in function
    definitions and type assertions more verbose than they had to be.
    
    For example, the following type assertion:
    
        if c, ok := v.(interface {
            Close() error
        }); ok {
        }
    
    Can now be formatted as:
    
        if c, ok := v.(interface{ Close() error }); ok {
        }
    
    Fixes #21952
    
    Change-Id: I896f796c5a30b9f4da2be3fe67cb6fea5871b835
    Reviewed-on: https://go-review.googlesource.com/66130
    Run-TryBot: Robert Griesemer <gri@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    92ba9b5c
Name
Last commit
Last update
..
ast Loading commit data...
build Loading commit data...
constant Loading commit data...
doc Loading commit data...
format Loading commit data...
importer Loading commit data...
internal Loading commit data...
parser Loading commit data...
printer Loading commit data...
scanner Loading commit data...
token Loading commit data...
types Loading commit data...