inspect

package
v0.0.0-...-f7fb57a Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

README

inspect GoDoc

Usage

local inspect = require("inspect")

local table = {a={b=2}}
local result = inspect(table, {newline="", indent=""})
if not(result == "{a = {b = 2}}") then error("inspect") end

Documentation

Overview

inspect.lua for gopher-lua

Example (Full)

inspect(obj)

state := lua.NewState()
Preload(state)
source := `
	local inspect = require("inspect")
    local table = {a={b=2}}
    print(inspect(table, {newline="", indent=""}))
`
if err := state.DoString(source); err != nil {
	log.Fatal(err.Error())
}
Output:

{a = {b = 2}}

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Loader

func Loader(L *lua.LState) int

Loader is the module loader function.

func Preload

func Preload(L *lua.LState)

Preload adds inspect to the given Lua state's package.preload table. After it has been preloaded, it can be loaded using require:

local inspect = require("inspect")

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