question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Go sample can't run files without task

See original GitHub issue

Is your task related to a problem? Please describe.

Our golang devfile (https://github.com/eclipse/che-devfile-registry/tree/master/devfiles/go) uses https://github.com/golang/example.git as a sample project. It has many runnable files with func main(), but we have only tasks for outyet subproject. AFAIK there is no way how to run Go file from IDE. Some languages can run files with little Run | Debug hovering over the runnable function, bug in Go, this does not work. So only way how to run files is by running terminal and write commands. I would consider this as not good IDE user experience.

Describe the solution you’d like

  • we should consider to use simpler Go sample with only one runnable file.
  • there should be way to run Go file with func main().

Describe alternatives you’ve considered

  • do nothing, user can run files from terminal
  • add more tasks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
azatsarynnyycommented, Jul 26, 2019

@slemeur @sparkoo a command for running the current file can look like the following:

        }
            "type": "che",
            "label": "run current file",
            "command": "go get -d && go run ${file}",
            "target": {
                "containerName": "go-cli"
            }
        }

FYI all the variables that can be processed by the substitution mechanism are available through Variable: List All command in Theia commands palette.

Note, resolving the variables in the command property for che tasks will come with the PR https://github.com/eclipse/che-theia/pull/373

0reactions
slemeurcommented, Jul 26, 2019

I’m labelling this issue as bug (as misconfiguration of the command).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command can not be run in Windows #319 - go-task ... - GitHub
Task version: master OS: windows 10 A command like - cmd: rm -r -fo "$home/foo/" cann't be run because task finds the command...
Read more >
How to Run Program without Admin Privileges and to Bypass ...
To force the regedit.exe to run without the administrator privileges and to suppress the UAC prompt, simple drag the EXE file you want...
Read more >
Force a program to run *without* administrator privileges or ...
I get a Windows cannot find 'C:\Program'. Make sure you typed the name correctly, and then try again . I've tried this command...
Read more >
Windows Task Scheduler doesn't start batch file task
Go to Run command and type shell:Startup · Now Windows will open the folder of startup. · Give this file all file user...
Read more >
Fix Scheduled Task Won't Run for .BAT File - Help Desk Geek
Step 1: Check File/Folder Permissions​​ The first step to fixing this issue is ensuring that the account you are using to run the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found