[GH-ISSUE #620] Error when running demo/presentation/main.go #455

Closed
opened 2026-03-04 01:05:09 +03:00 by kerem · 3 comments
Owner

Originally created by @Zeebrow on GitHub (Jun 12, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/620

I appologize in advance if I missed something obvious; I started learning Go today.

Output:

~$ go run demos/presentation/main.go
# command-line-arguments
./main.go:35:3: undefined: Cover
./main.go:36:3: undefined: Introduction
./main.go:37:3: undefined: HelloWorld
./main.go:38:3: undefined: InputField
./main.go:39:3: undefined: Form
./main.go:40:3: undefined: TextView1
./main.go:41:3: undefined: TextView2
./main.go:42:3: undefined: Table
./main.go:43:3: undefined: TreeView
./main.go:44:3: undefined: Flex
./main.go:44:3: too many errors
~$

Reproduce with commands (Ubuntu 20.04):

cd `mktemp -d`
git clone https://github.com/rivo/tview.git
cd tview/
go run demos/presentation/main.go

Other info:
go version go1.16.5 linux/amd64

~$ uname -a
Linux zeebrow-pc 5.8.0-55-generic #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal
Originally created by @Zeebrow on GitHub (Jun 12, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/620 I appologize in advance if I missed something obvious; I started learning Go today. Output: ``` ~$ go run demos/presentation/main.go # command-line-arguments ./main.go:35:3: undefined: Cover ./main.go:36:3: undefined: Introduction ./main.go:37:3: undefined: HelloWorld ./main.go:38:3: undefined: InputField ./main.go:39:3: undefined: Form ./main.go:40:3: undefined: TextView1 ./main.go:41:3: undefined: TextView2 ./main.go:42:3: undefined: Table ./main.go:43:3: undefined: TreeView ./main.go:44:3: undefined: Flex ./main.go:44:3: too many errors ~$ ``` Reproduce with commands (Ubuntu 20.04): ``` cd `mktemp -d` git clone https://github.com/rivo/tview.git cd tview/ go run demos/presentation/main.go ``` Other info: `go version go1.16.5 linux/amd64` ``` ~$ uname -a Linux zeebrow-pc 5.8.0-55-generic #62~20.04.1-Ubuntu SMP Wed Jun 2 08:55:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux ``` ``` ~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal ```
kerem closed this issue 2026-03-04 01:05:09 +03:00
Author
Owner

@Zeebrow commented on GitHub (Jun 12, 2021):

I made this in case anyone else wants to try the presentation demo, albeit in a more limited capacity (see readme).

<!-- gh-comment-id:860117949 --> @Zeebrow commented on GitHub (Jun 12, 2021): I made [this](https://github.com/Zeebrow/tview-demo-pres-wrkarnd/tree/master) in case anyone else wants to try the presentation demo, albeit in a more limited capacity (see readme).
Author
Owner

@marcelocantos commented on GitHub (Jun 13, 2021):

You should usually go run packages, not individual files:

go run ./demos/presentation

What you tried is valid, but treats main.go as a standalone package all by itself, so it's missing symbols it needs that are defined in other Go files in the same package.

<!-- gh-comment-id:860160644 --> @marcelocantos commented on GitHub (Jun 13, 2021): You should usually `go run` packages, not individual files: ```bash go run ./demos/presentation ``` What you tried is valid, but treats `main.go` as a standalone package all by itself, so it's missing symbols it needs that are defined in other Go files in the same package.
Author
Owner

@Zeebrow commented on GitHub (Jun 16, 2021):

Thanks @marcelocantos! Running go run . indeed gives me the nice presentation.

<!-- gh-comment-id:861917628 --> @Zeebrow commented on GitHub (Jun 16, 2021): Thanks @marcelocantos! Running `go run .` indeed gives me the nice presentation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#455
No description provided.