• 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
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...