<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>literal on Golang</title><link>https://golang.k5kc.com/tags/literal/</link><description>Recent content in literal on Golang</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 16 Aug 2020 00:10:00 +0530</lastBuildDate><atom:link href="https://golang.k5kc.com/tags/literal/index.xml" rel="self" type="application/rss+xml"/><item><title>Functional literals</title><link>https://golang.k5kc.com/2020/08/16/functional-literals/</link><pubDate>Sun, 16 Aug 2020 00:10:00 +0530</pubDate><guid>https://golang.k5kc.com/2020/08/16/functional-literals/</guid><description>A functional literal just represents an anonymous function. You can assign functional literal to a variable:
package main import ( &amp;#34;fmt&amp;#34; ) func main() { f := func() { fmt.Println(&amp;#34;Hello, भारत！&amp;#34;) } f() } Or invoke functional literal directly (Please notice the () at the end of functional literal):
package main import ( &amp;#34;fmt&amp;#34; ) func main() { func() { fmt.Println(&amp;#34;Hello, भारत！&amp;#34;) }() } The above 2 programs both output &amp;ldquo;Hello, भारत！&amp;rdquo;.</description></item><item><title>Go functions</title><link>https://golang.k5kc.com/2020/08/16/8.functions/</link><pubDate>Sun, 16 Aug 2020 00:10:00 +0530</pubDate><guid>https://golang.k5kc.com/2020/08/16/8.functions/</guid><description>A function can take zero or more typed arguments. The type comes after the variable name. Functions can be defined to return any number of values that are always typed.
package main import &amp;#34;fmt&amp;#34; func add(x int, y int) int { return x + y } func main() { fmt.Println(add(42, 13)) } Go Tour Functions example In the following example, instead of declaring the type of each parameter, we only declare one type that applies to both.</description></item></channel></rss>