/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/func3.go
20 строк
556 B
Robert Griesemer
go/parser, syntax: better error message for parameter missing type
01 окт 2024, 01:04
01 окт 2024, 01:04
bae2e96
Код
Авторство
О чём код?
// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Verify that illegal function signatures are detected. // Does not compile. package main type t1 int type t2 int type t3 int func f1(*t2, x t3) // ERROR "missing parameter name" func f2(t1, *t2, x t3) // ERROR "missing parameter name" func f3() (x int, *string) // ERROR "missing parameter name" func f4() (t1 t1) // legal - scope of parameter named t1 starts in body of f4.