<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Number on Gopher Coding</title><link>https://gophercoding.com/tags/number/</link><description>Recent content in Number on Gopher Coding</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Thu, 27 Apr 2023 18:46:03 +0100</lastBuildDate><atom:link href="https://gophercoding.com/tags/number/index.xml" rel="self" type="application/rss+xml"/><item><title>Find the Length of an Array</title><link>https://gophercoding.com/find-length-of-array/</link><pubDate>Thu, 15 Sep 2022 15:00:00 +0000</pubDate><guid>https://gophercoding.com/find-length-of-array/</guid><description>&lt;p>You can find the length of an &lt;strong>array&lt;/strong>, or to be correct a &lt;em>slice&lt;/em> or &lt;em>map&lt;/em>, in Go by using the standard library function &lt;code>len()&lt;/code>. We use the term array loosely here, as a general variable holding multiple things. Maps tend to have defined keys, whereas slices don&amp;rsquo;t (&lt;a href="https://boltandnuts.wordpress.com/2017/11/20/go-slice-vs-maps/">more info on the difference here&lt;/a>).&lt;/p>
&lt;p>We have shown both as examples below, how to get the length of a slice and how to get the length of a map. In Golang, the method is the same for both.&lt;/p></description></item></channel></rss>