1) What is Go Programming language?
Go programming language is an open source programming language. It is developed at Google in 2007. It is designed for system programming language.
2) Who designed Go programming language?
Robert Griesemer designed Go programming language.
3) What are the features of Go programming Language?
Go programming language features are:
- It supports dynamic language.
- The compilation time is fast.
- It has Garbage collection.
- It is inbuilt concurrency support.
- It is conciseness, simplicity and safety etc.
4) Is Go programming language is case sensitive?
Yes, Go programming language is case sensitive.
5) How to use print type of variable in Go?
Following code uses to print type of variable:
var a, b, c = 3, 4, "foo"
fmt.Printf("a is of type %T\n", a)
6) How can we write a simple program of Go programming Language?
We can write a simple program by using following step:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
7) What is the use of whitespace in Go?
Whitespace is used to express blanks, tabs, newline character and comment.
Example:
8) Can we declare multiple string in a single declaration in Go language?
Yes, we can declare multiple string in a single declaration.
Example:
var a, b, c = 3, 4, "foo"
9) What is the use of lvalue and rvalue in Go language?
Lvalue and rvalue are the expressions in Go language:
- Lvalue: It refers to a memory location.
- Rvalue: It refers to data value that is stored at some address in memory.
10) Does Go programming language support generic?
Go programming language doesn't support generic.
11) How many type of string literal in Go programming language?
There are two type of string literal in Go programming language:
- Raw string literal
- Interpreted string literals
12) What are the types of operator in Go programming language?
In Go programming language, the following types of operator are:
- Arithmetic Operators
- Relational Operators
- Logical Operators
- Bitwise Operators
- Assignment Operators
- Miscellaneous Operators
13) What is the use of goto statement in Go programming language?
In Go programming language, goto statement is used to transfers control to the labeled statement.
14) What are the libraries to manipulate string in Go programming language?
In Go programming language, there are various libraries to manipulate string:
15) What is pointer in Go programming language?
In Go programming language, pointer is used to hold the address of a variable.
Example:
var a = 2
var p *int
p = &a
fmt.Printf(" the address of variable a = %d", *p)
16) What is the syntax of Go programming language?
The syntax of go programming language specified by EBNF(Extended Backus-Naur Form):
Production = production_name "=" [ Expression ]
Expression = Alternative { "l" Alternative }
Alternative = Term { Term }
Term = Production_name l token [ "?"token] l Group l Option l Repetition
Group = " ( "" Expression")"
Option = " [ " Expression "" ]"
Repetition = " {" Expression "}"
17) In which language Go is implemented?
Go is implemented in multiple language like assembly
language,
C and
C++.
18) When Go programming language was launched?
Go programming language was launched in November 2009.
19) What are the various Go programming editors?
There are various Go programming editors like
"vi" and
"vim" and many more.
20) What is the file extension of Go programming language?
The Go programming language file extension is
".go".
21) Does Go programming language support multiple OS?
Yes, Go programming language support multiple OS like Windows, Linux, Mac and FreeBSD.
22) What are the steps to write Go program?
The following steps to write Go program:
- Package Declaration
- Import Packages
- Functions
- Variables
- Statements and Expressions
- Comments
23) What is the use of line separator?
The line separator is used to terminate the statement. There is no required ";" separator in D programming language.
Example:
fmt.Println("Hello, World!")
fmt.Println("I am in Go Programming World!")
24) How can we declaration mixed variable in Go?
We can declare mixed variable in Go by using following code:
var a, b, c = 3, 4, "foo"
25) What are the expressions used in Go?
There are following expressions used in Go that are
- lvalue: It refers to a memory location
- rvalue: It refers to a data value that is stored at some address in memory.
26) What is the shortcut key to terminate an infinite loop?
Ctrl+C is the shortcut key to terminate an infinite loop.
27) How can we create a function?
We can create a function by using following steps:
func function_name( [parameter list] ) [return_types]
{
body of the function
}
28) How can we Concatenate Strings?
We can concatenate string by using Join method.
Example:
strings.Join(sample, " Interview")
29) How can we initialize an array in Go Programming language?
We can initialize an array in Go Programming language by using following code:
var balance = [5]float32{1000.0, 2.0, 3.4, 7.0, 50.0}
30) Which operator is used to access any member of a structure?
member access operator (.) is used to access any member of a structure.