Once a channel is created, its capacity (buffer size) cannot be changed. You can only create and assign a new channel with different capacity.
Note that just declaring a variable of channel type does not create and initialize a channel, it will be its zero value which is nil for channel types:
var xxx chan int
Here xxx is a variable of chan int, but it's not yet initialized, you cannot send any values on it. You have to create one with the builtin make() function, e.g.:
var xxx chan int = make(chan int, 10)
Or simply:
var xxx = make(chan int, 10)
Its capactiy will be 10 and it cannot be changed. You can however assign a new channel value to it, e.g.:
xxx = make(chan int, 20)
But know that if multiple goroutines access and use the xxx variable, the above operation may cause a data race, and changing the value of xxx should be synchronized with other goroutines that read it.
Also note that if goroutines do not access xxx but the channel is "passed" to them, then assigning a new channel value to xxx will not affect them, those goroutines will not know about the new channel and will continue to use the old, passed channel.