We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
How to use the REPL mode in the Golang language
The text was updated successfully, but these errors were encountered:
You should look at this repo -> https://github.com/golobby/repl
Sorry, something went wrong.
@ghost @eyupfidan Here is one small example of repl, this is inside main package, you can also create a separate package for repl
`package main
import ( "bufio" "fmt" "io" "os" )
const PROMPT = ">> "
func main() { fmt.Println("Hello bajrang") Start(os.Stdin, os.Stdout) }
func Start(in io.Reader, out io.Writer) { scanner := bufio.NewScanner(in) for { fmt.Printf(PROMPT) scanned := scanner.Scan() if !scanned { return } line := scanner.Text() fmt.Println("line = ", line) } } `
No branches or pull requests
How to use the REPL mode in the Golang language
The text was updated successfully, but these errors were encountered: