Exemplo n.º 1
0
func (s *MySuite) TestLookup(c *C) {
	// Test initializing.
	e := contentdb.Init()
	c.Assert(e, IsNil)

	// Test MustLookup.
	contentType, e := contentdb.Lookup("exe")
	c.Assert(e, IsNil)
	c.Assert(contentType, Not(Equals), "")

	// Test MustLookup.
	contentType = contentdb.MustLookup("exe")
	c.Assert(contentType, Not(Equals), "")
}
Exemplo n.º 2
0
Arquivo: main.go Projeto: fwessels/mc
func main() {
	probe.Init() // Set project's root source path.
	probe.SetAppInfo("Release-Tag", mcReleaseTag)
	probe.SetAppInfo("Commit", mcShortCommitID)

	contentdb.Init() // Load contentdb into memory.
	app := registerApp()
	app.Before = registerBefore

	app.ExtraInfo = func() map[string]string {
		if _, e := ts.GetSize(); e != nil {
			globalQuiet = true
		}
		if globalDebug {
			return getSystemData()
		}
		return make(map[string]string)
	}

	app.RunAndExitOnError()
}