Home »
Code Examples »
Golang Code Examples
Golang - How to get the last element of a slice? Code Example
Here is the solution for "How to get the last element of a slice?" in Golang.
Golang code for How to get the last element of a slice?
sl[len(sl)-1]
/*sl - is slice*/
Code by IncludeHelp,
on March 4, 2023 23:39