(n ast.Node)
| 157 | } |
| 158 | |
| 159 | func name(n ast.Node) string { |
| 160 | switch t := n.(type) { |
| 161 | case *ast.InterfaceType: |
| 162 | return "interface{}" |
| 163 | case *ast.Ident: |
| 164 | return t.Name |
| 165 | case *ast.SelectorExpr: |
| 166 | return t.Sel.Name |
| 167 | case *ast.StarExpr: |
| 168 | return "*" + name(t.X) |
| 169 | case *ast.BasicLit: |
| 170 | return t.Value |
| 171 | case *ast.Ellipsis: |
| 172 | return "..." |
| 173 | default: |
| 174 | return "<unknown>" |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | // fieldToType returns the type name and whether if it's an ellipsis. |
| 179 | func fieldToType(f *ast.Field) (string, bool) { |
no outgoing calls
no test coverage detected
searching dependent graphs…