Trong đoạn code này
var flagSet = flag.NewFlagSet(os.Args[0], flag.ExitOnError) if err := flagSet.Parse(os.Args[1:]);
Thì 1:
nghĩa là gì nhỉ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Mình đã tìm được bài này: https://zetcode.com/golang/array/. Nó giống kiểu sub array. Như trong ví dụ là sub array từ vị trí thứ 1.
Em xin bổ sung 1 ý là khi dùng kiểu syntax trên là mình đang tạo ra 1 slice từ array/slice
Trong docs của golang cũng có phần này https://tour.golang.org/moretypes/7
Vd này e thử dùng thư viện reflect để kiểm tra: https://replit.com/@ngochieu642/Array-vs-Sclie
:))) lấy ra mảng string từ input đầu vào
Ở trên mình thấy viết os.Args[0] ở dưới lại thấy os.Args[1:] thì 2 cách viết này khác gì nhau Quang Minh nhỉ?