Пример #1
0
func main() {
	if len(os.Args) == 1 {
		usage()
		console.Pause("press any key to continue...")
		return
	}

	haserror := false

	for _, f := range os.Args[1:] {
		exp := Try(func() {
			dofile(f)
		})

		if exp != nil {
			Println(exp.Message)
			haserror = true
		}
	}

	if haserror {
		console.Pause("press any key to continue ...")
	} else {
		// time.Sleep(time.Second * 3)
	}
}
Пример #2
0
func main() {
	testString()
	Println()

	testArray()
	Println()

	testNamedReturn()
	Println()

	testDict()
	Println()

	testLogger()
	Println()

	for _, v := range os.Args {
		Println(v)
	}
	Println()

	testMisc(1)
	Println()

	testNet()
	Println()

	testEncoding()
	Println()

	testSql()
	Println()

	console.Pause("done")
}
Пример #3
0
func main() {
	defer console.Pause("done")

	wg := sync.WaitGroup{}

	users := readuser()

	for i := 0; i+1 < len(users); i += 2 {
		if users[i].Length() == 0 {
			i--
			continue
		}

		wg.Add(1)
		go do(users[i], users[i+1])
	}

	wg.Wait()
}
Пример #4
0
func main() {
	defer console.Pause("done")
	// pprof.Start()
	// defer pprof.Stop()

	sigc := make(chan os.Signal, 10)

	signal.Notify(sigc, os.Interrupt)

	go func() {
		for {
			_, ok := <-sigc
			if ok == false {
				break
			}

			exiting = true
		}
	}()

	wg := sync.WaitGroup{}

	users := readuser()

	for i := 0; i+1 < len(users); i += 2 {
		if users[i].Length() == 0 {
			i--
			continue
		}

		wg.Add(1)
		go func(i int) {
			do(users[i], users[i+1])
			wg.Done()
		}(i)
	}

	wg.Wait()
}
Пример #5
0
func main() {
	f2()
	console.Pause("done")
}
Пример #6
0
func main() {
	if err := qml.Run(run); err != nil {
		Printf("error: %v\n", err)
		console.Pause("done")
	}
}