الحزم
الحزم
يتكوّن كل برنامج بلغة Go من حزم.
يبدأ تنفيذ البرامج في الحزمة main.
يستخدم هذا البرنامج الحزم ذات مساري الاستيراد "fmt" و"math/rand".
جرت العادة على أن يكون اسم الحزمة مطابقًا لآخر عنصر في مسار الاستيراد. فعلى سبيل المثال، تتكوّن الحزمة "math/rand" من ملفات تبدأ بالتعليمة package rand.
النص الأصلي بالإنجليزية
Packages
Every Go program is made up of packages.
Programs start running in package main.
This program is using the packages with import paths "fmt" and "math/rand".
By convention, the package name is the same as the last element of the import path. For instance, the "math/rand" package comprises files that begin with the statement package rand.
هذا الدرس للقراءة فقط؛ جرّب المثال في الدرس التالي.