• Thomas Wanielista's avatar
    go/doc: classify function returning slice or array of T as constructor · adeb7e64
    Thomas Wanielista authored
    Previously, go/doc would only consider functions and slices that
    return types of T or any number of pointers to T: *T, **T, etc. This
    change expands the definition of a constructor to include functions
    that return arrays of a type (or pointer to that type) in its first
    return.
    
    With this change, the following return types also classify a function
    as a constructor of type T:
    
    [1]T
    [1]*T
    [1]**T
    (and so on)
    
    Fixes #22856.
    
    Change-Id: I37957c5f2d6a7b2ceeb3fbaef359057f2039393d
    Reviewed-on: https://go-review.googlesource.com/85355
    Run-TryBot: Robert Griesemer <gri@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    adeb7e64
issue22856.0.golden 654 Bytes