This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
---
title: "值传递"
---
# 值传递
函数传参有三种方式,分别是**值传递(pass by value)**、**引用传递(pass by reference)**,以及**指针传递(pass by pointer)**。指针传递也称为地址传递,本质上也属于值传递,它只不过传递的值是地址而已。所以按照广义的函数传递来分,分为值传递和引用传递。Go语言中函数传参值传递,不支持引用传递。但是由于切片,通道,映射等具有引用传递的某些特性,往往令人疑惑其应该是引用传递。这个章节我们就来探究下Go语言中函数传递的问题。