Is there a way to apply a function on all elements of a slice in go? : <p>How do I apply a function to all elements of go slice without having to explicitly iterate over the slice? </p>

<p>Is there something similar to Java </p>

<p><code>stream().map(&lt;fn&gt;)</code> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#map-java.util.function.Function-" rel="nofollow noreferrer">https://docs.oracle.com/javase/8/docs/api/java/util/stream/Stream.html#map-java.util.function.Function-</a></p>

<p>(OR)</p>

<p><code>forEach(&lt;fn&gt;)</code> <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html#forEach-java.util.function.Consumer-" rel="nofollow noreferrer">https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html#forEach-java.util.function.Consumer-</a></p>
