S
S
Sm4llDev2020-05-19 20:47:31
go
Sm4llDev, 2020-05-19 20:47:31

What is the role of packages in Go?

I searched for a very long time, but I did not understand a clear, and most importantly, understandable explanation of why packages are in Go, what is it, what is their role? Can you please explain? Preferably as easy as possible :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2020-05-19
@Sm4llDev

This can be thought of as an analogy with other languages:
Classes
Namespace
The point is the same, to group the code that performs one task and separate it from the rest of the code for ease of maintenance.
For example, the net/http package allows you to work with the http protocol. encode/json, with json format, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question