|
1256 | 1256 | | 20 | [How would you tell a goroutine to use less core than what you have?](#how-would-you-tell-a-goroutine-to-use-less-core-than-what-you-have)
|
1257 | 1257 | | 21 | [How would you determine the type of a variable and Which package to use for it?](#how-would-you-determine-the-type-of-a-variable-and-which-package-to-use-for-it)
|
1258 | 1258 | | 22 | [What all types can map store?](#what-all-types-can-map-store)
|
1259 | | -| 23 | [What are services in golang?](#what-are-services-in-golang) |
| 1259 | +| 23 | [What are microservices?](#what-are-microservices) |
1260 | 1260 | | 24 | [Why are there no classes in Go?](#why-are-there-no-classes-in-go)
|
1261 | 1261 | | 25 | [Difference between Compile time and runtime?](#difference-between-compile-time-and-runtime)
|
1262 | 1262 | | 26 | [Do you need to convert the type of a variable of interface{} type passed in a function as an argument?](#do-you-need-to-convert-the-type-of-a-variable-of-interface{}-type-passed-in-a-function-as-an-argument)
|
|
1613 | 1613 |
|
1614 | 1614 |
|
1615 | 1615 |
|
| 1616 | + 22. ### What all types can map store? |
| 1617 | + **Value** - The Value type of a mpa can be anything, including another map <br/> |
| 1618 | + **Key** - The key type of Map can only be values that can be compared i.e - boolean, numeric, string, pointer, channel, and interface types, and structs or arrays , that excludes - slices, maps, and functions |
| 1619 | + |
| 1620 | + **[ Back to Top ⬆ ](#table-of-contents---golang)** |
| 1621 | + |
| 1622 | + 23. ### What are microservices? |
| 1623 | + Microservices is an architectural style that structures an application as a collection of services that are |
| 1624 | + * Highly maintainable and testable |
| 1625 | + * Loosely coupled |
| 1626 | + * Independently deployable |
| 1627 | + * Organized around business capabilities |
| 1628 | + * Owned by a small team |
| 1629 | + |
| 1630 | + **[ Back to Top ⬆ ](#table-of-contents---golang)** |
| 1631 | + |
| 1632 | + 24. ### Why are there no classes in Go ? |
| 1633 | + |
| 1634 | + Go doesn't require an explicit class definition as Java, C++, C#, etc do. Instead, a "class" is implicitly defined by providing a set of "methods" which operate on a common type. The type may be a struct or any other user-defined type. For example: |
| 1635 | + |
| 1636 | + ```go |
| 1637 | + type Integer int; |
| 1638 | + func (i *Integer) String() string { |
| 1639 | + return strconv.itoa(i) |
| 1640 | + } |
| 1641 | + ``` |
| 1642 | + is analogous to below code in java:<br/> |
| 1643 | + |
| 1644 | + ```java |
| 1645 | + class Integer { |
| 1646 | + public int i; |
| 1647 | + public String toString() { return Integer.toString(i); } |
| 1648 | + } |
| 1649 | + ``` |
| 1650 | + **[ Back to Top ⬆ ](#table-of-contents---golang)** |
| 1651 | + |
1616 | 1652 |
|
1617 | 1653 |
|
1618 | 1654 | ### Table of Contents - Database Engineering
|
|
0 commit comments