V
V
Vladimir2018-08-17 17:44:22
go
Vladimir, 2018-08-17 17:44:22

How to assign a function via var name type?

println := fmt.Println how to do it via var name type? If it's simpler, what type are the functions in go?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Movchan, 2018-08-17
@akifai

var f func(...interface {}) (int, error) = fmt.Println

A
Ara Israelyan, 2018-11-08
@juggleru

A type declaration is not needed.
var println = fmt.Println

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question