wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Golang Fiber with GORM

Total questions: 24

Worksheet time: 9mins

Name
Class
Date
1.

how to get Golang package in VS Code

a)
Download the package from the internet
b)
Use a different code editor
c)
Install the 'Go' extension from the Extensions view in VS Code.
d)
Manually write the package code
2.

How to create a module in golang?

a)
Use the 'go module create' command followed by the name of the module.
b)
Use the 'go mod create' command followed by the name of the module.
c)
Use the 'go module init' command followed by the name of the module.
d)
Use the 'go mod init' command followed by the name of the module.
3.

How to update the module in Golang?

a)
Use the 'go update' command followed by the module path to update the module in Golang.
b)
Use the 'go install' command followed by the module path to update the module in Golang.
c)

Use the 'go mod tidy' command to update the module in Golang.

d)
Use the 'go upgrade' command followed by the module path to update the module in Golang.
4.

Lists of Variable Declarations in Golang

a)

short variable declaration

b)

single variable declaration

c)

explicit type declaration

d)

implicit type declaration

5.

Single variable declaration syntax in Golang

a)
var dataType variableName
b)
dataType var variableName
c)
var variableName dataType
d)
variableName dataType var
6.

Multiple variable declaration in Golang

a)
var ( var1 int; var2 string )
b)
var ( var1 int, var2 string )
c)
var ( var1 int var2 string )
d)
var ( var1, var2 ) int string
7.

Multiple short variable declaration syntax in Golang

a)

var1, va2 := val1, val2

b)

var variableName type

c)

var (var1 int var2 string)

d)

var variableName type

8.

Struct declaration in Golang

a)

type MyStruct = struct { field1 type1 field2 type2 }

b)

type MyStruct struct { field1 type1 field2 type2 }

c)

struct MyStruct { field1 type1 field2 type2 }

d)
MyStruct = { field1 type1; field2 type2 }
9.

List of data types in Golang

a)

int

b)

string

c)

text

d)

float

10.

Function with parameter syntax in Golang

a)
functionName(parameterType) returnType
b)

func functionName(parameterName parameterType)
{
body
}

c)
func functionName(parameterType returnType) parameterName
d)
func(parameterName parameterType) returnType functionName
11.

Function with return type syntax in Golang

a)

func functionName() returnType
{
body
}

b)
functionName(parameters) returnType { // function body }
c)
functionName(parameters) returnType // function body
d)
functionName(parameters) { // function body } returnType
12.

Function with parameter and return type syntax in Golang

a)
func functionName(parameterType) returnType { // function body }
b)
functionName(parameterType parameterName) returnType { // function body }
c)

func functionName(parameterName parameterType) returnType
{
body
return returnType
}

d)
func functionName(parameterName) returnType { // function body }
13.

Folder structures in Golang Project

a)

Controller, Model, Routes

b)

Feature(Controller. Model), Routes

14.

Is this the correct representation of API?

a)

YES

b)

NO

15.

What is A.P.I.?

a)
Automated Programming Interface
b)
Advanced Protocol Interface
c)
Analog Processing Interface
d)
Application Programming Interface
16.

How to initialize Golang Fiber?

a)

b)

c)

d)

17.

Golang Fiber http methods are?

a)
CREATE
b)
UPDATE
c)

POST

d)

GET

18.

app.Listen(":3000")

a)
Opening a file on port 3000
b)
Creating a new variable on port 3000
c)
Printing a message on port 3000
d)
Starting a server on port 3000
19.

What are the commands used to run the application in Golang?

a)

go run main.go

b)
go start
c)
execute
d)

go run .

20.

GORM url package is?

(a)  

21.

Golang Fiber url package is?

(a)  

22.

GORM postgresql connection syntax is?

a)
gorm.Open(postgres.Open('host=myhost user=gorm dbname=gorm password=mypassword port=5432 sslmode=enable'))
b)
gorm.Open(postgres.Open('host=myhost user=gorm dbname=gorm password=mypassword port=5432 sslmode=require'))
c)
gorm.Open(postgres.Open('host=myhost user=gorm dbname=gorm password=mypassword port=5432 sslmode=prefer'))
d)
gorm.Open(postgres.Open("host=myhost user=gorm dbname=gorm password=mypassword port=5432 sslmode=disable"))
23.

How to use GORM raw?

a)
Use the GORM raw method to execute raw JavaScript queries.
b)
Use the Raw method to execute raw CSS queries.
c)
Use the Raw method to execute raw SQL queries.
d)
Use the Raw method to execute raw HTML queries.
24.

It is a request and response body format used for storing and transporting data

a)
JSON
b)
CSV
c)
XML
d)
YAML