Struct modification in branches #35

Closed
opened 2025-09-14 07:30:01 +00:00 by ed · 1 comment
Owner

Modifying examples/shell to include a branch with a struct modification makes the compiler panic:

execute(path string) {
	if path.len == 0 {
		return
	}

	if !strings.hasPrefix(path, "/") && !strings.hasPrefix(path, ".") {
		path = strings.concat("/bin/", path)
	}

	err := exec.run(path)

	if err != 0 {
		io.write("error executing: ")
		io.write(path)
		io.write("\n")
	}
}
Modifying `examples/shell` to include a branch with a struct modification makes the compiler panic: ``` execute(path string) { if path.len == 0 { return } if !strings.hasPrefix(path, "/") && !strings.hasPrefix(path, ".") { path = strings.concat("/bin/", path) } err := exec.run(path) if err != 0 { io.write("error executing: ") io.write(path) io.write("\n") } } ```
ed self-assigned this 2025-09-14 07:30:01 +00:00
Author
Owner

Fixed in cli/q@1fdb2d1343.

Fixed in https://git.urbach.dev/cli/q/commit/1fdb2d134344106bb519e446312c7e106524d62f.
ed closed this issue 2025-09-14 08:22:49 +00:00
ed added spent time 2025-09-14 08:22:57 +00:00
30 minutes
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 30 minutes
ed
30 minutes
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
cli/q#35
No description provided.