Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go script should work in ideal world #37666

Closed
ORESoftware opened this issue Mar 4, 2020 · 2 comments
Closed

go script should work in ideal world #37666

ORESoftware opened this issue Mar 4, 2020 · 2 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@ORESoftware
Copy link

I am on go version

go version go1.13.7 linux/amd64

something like this should work:

#!/usr/bin/env bash

go run <(cat  <<EOF
package main

import "log"

func main(){
  log.Println("here 123")
}
EOF
)

if I run it I get:

go: cannot find main module, but found .git/config in /home/oleg/codes/channelmeter/cm-scripts
to create a module there, run:
go mod init

@cherrymui
Copy link
Member

% cat hello.go
//usr/bin/env go run "$0"; exit
package main; func main() { println("hello") }
% chmod +x hello.go
% ./hello.go
hello

It needs to be named .go to work.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 5, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants