# For Range Semantics

DevFeed: [For Range Semantics](<https://devfeed.tech/articles/for-range-semantics-22127.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2017/06/for-range-semantics.html>)

Published: 2017-06-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Programming language](<https://devfeed.tech/topics/programming-language.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [loops](<https://devfeed.tech/tags/loops.md>), [pointers](<https://devfeed.tech/tags/pointers.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [readability](<https://devfeed.tech/tags/readability.md>)

## AI overview

This tutorial explains value and pointer semantics in Go range loops. It compares how loops operate on copies versus original values, shows how mixing the two forms can cause problems, and examines the mechanics through code examples.

## Source excerpt

Prelude These are good posts to read first to better understand the material presented in this post: Index of the four part series: Language Mechanics On Stacks And Pointers Language Mechanics On Escape Analysis Language Mechanics On Memory Profiling Design Philosophy On Data And Semantics The idea of value and pointer semantics are everywhere in the Go programming language. As stated before in those earlier posts, semantic consistency is critical for integrity and readability. It allows developers to maintain a strong mental model of a code base as it continues to grow. It also helps to minimize mistakes, side effects, and unknown behavior.