Git Product home page Git Product logo

Comments (16)

Saad118 avatar Saad118 commented on May 22, 2024 1

http://prntscr.com/j0rfh6
i am using go 10.1 how i build my first doc i-e 'hello.go'
go build not working

from go-plus.

joefitzgerald avatar joefitzgerald commented on May 22, 2024

Hi @simon-whitehead. There is not a go build command in the command palette. Building occurs on save (when Syntax Check On Save preference is enabled) as a means to check syntax.

from go-plus.

simon-whitehead avatar simon-whitehead commented on May 22, 2024

Hi @joefitzgerald,

Apologies. I must have misunderstood when I saw "go build" as a feature. Thanks for the response! :)

from go-plus.

joefitzgerald avatar joefitzgerald commented on May 22, 2024

Is there a go build related feature that you wish you did have? I can imagine it might be nice to have a go run, or a go install command, but that does raise the question of which working directory to use. The current syntax checking focuses on the file being saved, which makes that question moot.

from go-plus.

simon-whitehead avatar simon-whitehead commented on May 22, 2024

Well I'm in a bit of a flow now with Sublime - thought I would give Atom a try. Basically, just wondered how I could compile and run the code from within Atom like I would with Sublime's GoSublime package.

from go-plus.

joefitzgerald avatar joefitzgerald commented on May 22, 2024

So you would like a 'go run' command, with display of the output?

from go-plus.

simon-whitehead avatar simon-whitehead commented on May 22, 2024

Yes. You can also kill the executable from within Sublime with GoSublime. If for example, you are developing a web app that blocks while processing requests, you can kill it from within Sublime.

My flow is basically:

Command+B -> "build" (runs go build) -> All fine, I'll type "run" (runs go run) -> App may/may not block -> if it does block and I want to change something and re-run, i'll execute "tskill" and kill the process.. all within Sublime. Output is displayed in a window within Sublime.

I was kinda looking for a similar flow with Atom (I realise I am now asking for a lot - given that it doesn't exist currently).

from go-plus.

joefitzgerald avatar joefitzgerald commented on May 22, 2024

Well that flow would be slightly different with go-plus:

  • [Existing Feature] Saving any file runs a go build or a go test
  • [New Feature] Execute go run
  • [New Feature] Display go run output
  • [New Feature] Kill a running process

from go-plus.

simon-whitehead avatar simon-whitehead commented on May 22, 2024

Perhaps for now I can just change my flow - when I save in Atom, where does Go-Plus build the executable? Or does it clean it up afterwards? Or it doesn't output one at all?

from go-plus.

joefitzgerald avatar joefitzgerald commented on May 22, 2024

go build never creates an executable. go install creates one; go run runs one; both run a go build implicitly as part of their pipeline. So you don't actually need anything to manage this for you; it's just a convenience. Running go run in the directory where you have your main function will run the app.

from go-plus.

simon-whitehead avatar simon-whitehead commented on May 22, 2024

Sorry - that was my question. build has an -o flag for output, I just wondered if Go-Plus was including that or not.

from go-plus.

joefitzgerald avatar joefitzgerald commented on May 22, 2024

It does use -o to redirect the output to a temporary directory (where it is then deleted). This is to ensure files don't clutter each package and cause the treeview to flicker. As it stands, go test output cannot be redirected in the same way, and consequently you see a small flicker in the treeview when saving a test.

from go-plus.

jqnote avatar jqnote commented on May 22, 2024

Could we make a config file for every project in the root of the project . Just like

gopath=.....
gobin=.....
golint=....
gofmt=....
gobuild=...
bobuild_args=....

after project loaded, atom check this file and change it's config ~~

Could u understand my words?~~~Thanks~

from go-plus.

djahma avatar djahma commented on May 22, 2024

Hello! Have you resumed work on simon-whitehead suggestions? I'd very much love exactly the same features he asked about.
I thought of using atom to provide an html gui for a golang technical analysis software. it would be kool to just develop in both go and web within the same piece of software.

from go-plus.

qoke avatar qoke commented on May 22, 2024

Bump - go build, run and kill would make migration from Sublime a lot easier.

Also, can we have a flag to keep the executable file (in the same directory as the source), rather than deleting it?

from go-plus.

joefitzgerald avatar joefitzgerald commented on May 22, 2024

@Saad118 unfortunately your question has nothing to do with go-plus. Check out https://golang.org/doc/install#install and pay special attention to the need to update your PATH environment variable.

from go-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.