Skip to content

docs: fix example code not printing properly - #28034

Merged
medvednikov merged 1 commit into
vlang:masterfrom
lq259:patch-1
Aug 7, 2026
Merged

docs: fix example code not printing properly#28034
medvednikov merged 1 commit into
vlang:masterfrom
lq259:patch-1

Conversation

@lq259

@lq259 lq259 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This code example:

fn foo() (int, int) {
return 2, 3
}

fn main() {
c, _ := foo()
print(c)
// no warning about unused variable returned by foo.
}

is supposed to print out the second returned variable from foo(), which is 3.

The issue is that it uses print() instead of println() to do so, resulting in nothing being printed to output, because a new line has not been started.
There are multiple ways to start a new line for this context, println() is easiest.

@medvednikov
medvednikov merged commit 8c076f1 into vlang:master Aug 7, 2026
6 checks passed
@lq259
lq259 deleted the patch-1 branch August 8, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants