Skip to content

Commit 013e295

Browse files
committed
adding new questions to golang
1 parent e943968 commit 013e295

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,9 @@
12401240
| 5 | [What are the data types in Golang?](#what-are-the-data-types-in-golang)
12411241
| 6 | [Can you return multiple values from a function?](#can-you-return-multiple-values-from-a-function)
12421242
| 7 | [What is a GOPATH?](#what-is-a-gopath)
1243-
1243+
| 8 | [What are Goroutines?](#what-are-goroutines)
1244+
| 9 | [What is nil in Go?](#what-is-nil-in-go)
1245+
| 10 | [What is the difference between array and slice in Go?](#what-is-the-difference-between-array-and-slice-in-go)
12441246

12451247

12461248

@@ -1328,4 +1330,30 @@
13281330
The GOPATH environment variable specifies the location of your workspace. It defaults to a directory named go inside your home directory <br/>
13291331
The command go env GOPATH prints the effective current GOPATH; it prints the default location if the environment variable is unset.
13301332

1333+
**[ Back to Top ⬆ ](#table-of-contents---golang)**
1334+
1335+
8. ### What are Goroutines?
1336+
1337+
Goroutines are incredibly lightweight “threads” managed by the go runtime. They enable us to create asynchronous parallel programs that can execute some tasks far quicker than if they were written in a sequential manner.
1338+
1339+
**[ Back to Top ⬆ ](#table-of-contents---golang)**
1340+
1341+
9. ### What is nil in Go?
1342+
nil is a predeclared identifier in Go that represents zero values for pointers, interfaces, channels, maps, slices and function types.
1343+
1344+
**[ Back to Top ⬆ ](#table-of-contents---golang)**
1345+
1346+
10. ### What is the difference between array and slice in Go ?
1347+
1348+
* **ARRAY** : An array is a fixed collection of data. The emphasis here is on fixed, because once you set the length of an array, it cannot be changed.<br/>
1349+
1350+
```go
1351+
arr := [4]int{3, 2, 5, 4}
1352+
```
1353+
* **SLICE** : Slices are much more flexible, powerful, and convenient than arrays. Unlike arrays, slices can be resized using the built-in append function .
1354+
1355+
```go
1356+
slicee := make([]Type, length, capacity)
1357+
```
1358+
13311359
**[ Back to Top ⬆ ](#table-of-contents---golang)**

sentence_to_hashing_converter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ function hashing(num=0,str) {
2020
return `| ${num} | [${str}?](#${hashed})`
2121
}
2222

23-
console.log(hashing(7,'What is a GOPATH'));
23+
console.log(hashing(10,'What is the difference between array and slice in Go'));

0 commit comments

Comments
 (0)