gluaquestion

package module
v0.0.0-...-311437c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2016 License: MIT Imports: 6 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gluaquestion

A library of gopher-lua to prompt the user for input.

Installation

go get github.com/kohkimakimoto/gluaquestion

API

  • question.ask(text)
  • question.secret(text)

Usage

package main

import (
    "github.com/yuin/gopher-lua"
    "github.com/kohkimakimoto/gluaquestion"
)

func main() {
    L := lua.NewState()
    defer L.Close()

    L.PreloadModule("question", gluaquestion.Loader)
    if err := L.DoString(`
local question = require("question")

local name = question.ask("What's your name: ")
print("hello " .. name)

-- What's your name: kohki
-- hello kohki

`); err != nil {
        panic(err)
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Loader is glua module loader.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址