Telegram Group & Telegram Channel
Note #9 Когда лучше использовать именнованые параметры в функциях, определеных в интерфейсах?

Ели нам попадается такой код, то не совсем понятно что такое str или int O_O:

type runner interface {
run(context.Context, string, int)
}


Сразу же последует PR с чем-то вроде такого:

2c2
< run(context.Context, string, int)
---
> run(ctx context.Context, service string, instances int)
4d3
<

Так намного лучше :)

Но иногда есть более спорный кейс, в котором называть не объязательно:
type Enroller interface {
Enroll(*User, *Course) error
}


// P.S.
func main(){println("не забываем, что код пишется, еще и для наших коллеги, а не только для того, чтобы его можно было запустить на проде!")}

🍺



tg-me.com/golang_for_two/33
Create:
Last Update:

Note #9 Когда лучше использовать именнованые параметры в функциях, определеных в интерфейсах?

Ели нам попадается такой код, то не совсем понятно что такое str или int O_O:

type runner interface {
run(context.Context, string, int)
}


Сразу же последует PR с чем-то вроде такого:

2c2
< run(context.Context, string, int)
---
> run(ctx context.Context, service string, instances int)
4d3
<

Так намного лучше :)

Но иногда есть более спорный кейс, в котором называть не объязательно:
type Enroller interface {
Enroll(*User, *Course) error
}


// P.S.
func main(){println("не забываем, что код пишется, еще и для наших коллеги, а не только для того, чтобы его можно было запустить на проде!")}

🍺

BY 🇺🇦 Go for two :)


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/golang_for_two/33

View MORE
Open in Telegram


🇺🇦 Go на двоих Telegram | DID YOU KNOW?

Date: |

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

What is Telegram?

Telegram is a cloud-based instant messaging service that has been making rounds as a popular option for those who wish to keep their messages secure. Telegram boasts a collection of different features, but it’s best known for its ability to secure messages and media by encrypting them during transit; this prevents third-parties from snooping on messages easily. Let’s take a look at what Telegram can do and why you might want to use it.

🇺🇦 Go на двоих from us


Telegram 🇺🇦 Go for two :)
FROM USA