// Init must be called after flag.Parse, and before doing any other operations.
351549
func Init() {
	switch *streamlog.QueryLogFormat {
	case streamlog.QueryLogFormatText:
	case streamlog.QueryLogFormatJSON:
	default:
		log.Exitf("Invalid querylog-format value %v: must be either text or json", *streamlog.QueryLogFormat)
	}

	if *queryLogHandler != "" {
		StatsLogger.ServeLogs(*queryLogHandler, streamlog.GetFormatter(StatsLogger))
	}

	if *txLogHandler != "" {
		TxLogger.ServeLogs(*txLogHandler, streamlog.GetFormatter(TxLogger))
	}
}
188523
func (c *ActionGetCommand) Init(args []string) error {
	if len(args) > 0 {
		err := cmd.CheckEmpty(args[1:])
		if err != nil {
			return err
		}
		c.keys = strings.Split(args[0], ".")
	}
	return nil
}
432879
func (s *scanner) init(buf string) {
	s.buf = buf
	s.pos = 0
	s.start = 0
	s.width = 0
	s.accept = nil
}
55988
func (p *Provider) Init() error {
	defaultRuleTpl, err := provider.MakeDefaultRuleTemplate(p.DefaultRule, nil)
	if err != nil {
		return fmt.Errorf("error while parsing default rule: %v", err)
	}

	p.defaultRuleTpl = defaultRuleTpl
	return nil
}
899497
func Init() bool {
	initializer, exists := registeredInitializers[os.Args[0]]
	if exists {
		initializer()

		return true
	}
	return false
}
474247
func (c *RegisterCmd) Init(args []string) error {
	if len(args) < 3 {
		return errors.Errorf("missing required arguments")
	}
	c.typ = args[0]
	c.class = args[1]
	c.id = args[2]
	c.labels = args[3:]
	return nil
}
516388
func init() {
	log = logger.New()
	log.Out = os.Stdout
	log.Level = logger.DebugLevel
}
402864
func (h *multiHandler) Init() error {
	for _, handler := range h.handlers {
		if err := handler.Init(); err != nil {
			return err
		}
	}
	return nil
}
98447
func (ctx *compctx) Init(goopts libs.SassOptions) libs.SassOptions {
	if ctx.Precision == 0 {
		ctx.Precision = 5
	}
	ctx.options = goopts
	ctx.Headers.Bind(goopts)
	ctx.Imports.Bind(goopts)
	ctx.Funcs.Bind(goopts)
	libs.SassOptionSetSourceComments(goopts, ctx.compiler.LineComments())
	//os.PathListSeparator
	incs := strings.Join(ctx.IncludePaths, string(os.PathListSeparator))
	libs.SassOptionSetIncludePath(goopts, incs)
	libs.SassOptionSetPrecision(goopts, ctx.Precision)
	libs.SassOptionSetOutputStyle(goopts, ctx.OutputStyle)
	libs.SassOptionSetSourceComments(goopts, ctx.Comments)

	if ctx.includeMap {
		libs.SassOptionSetSourceMapEmbed(goopts, true)
	}

	return goopts
}
1068616
func (c *leaderSetCommand) Init(args []string) (err error) {
	c.settings, err = keyvalues.Parse(args, true)
	return
}
943341
func (l *MutexD) Init() {
	if !l.initialized {
		l.locks = make(map[string]int64)
		l.signals = make(chan *lockSignal, 1000)
		go l.listner()
		l.initialized = true
	}
}
826021
func init() {
	flag.Parse()
	args := flag.Args()
	envVar := os.Getenv("CONF_FILE")

	var file string
	if len(args) == 1 {
		file = args[0]
	} else if envVar != "" {
		file = envVar
	} else {
		panic(fmt.Sprintln("Configuration file is required.\nUse: CONF_FILE environment variable or cli args"))
	}

	var err error

	if err = initConfiguration(file); err != nil {
		panic(fmt.Sprintf("[!] %v\n", err))
	}

	var connectionString string
	if connectionString, err = Configuration.ConnectionString(); err != nil {
		panic(err.Error())
	}

	if db, err = igor.Connect(connectionString); err != nil {
		panic(fmt.Sprintf("Got error when connect database: '%v'\n", err))
	}

	logger := log.New(os.Stdout, "query-logger: ", log.LUTC)
	Db().Log(logger)
}
42252
func (j *JSONParser) Init(b *bytes.Buffer) bool {
	m := make(map[string]interface{})

	err := json.Unmarshal(b.Bytes(), &m)
	if err != nil {
		var offset int

		jerr, ok := err.(*json.SyntaxError)
		if !ok {
			return false
		}

		offset = int(jerr.Offset)

		m = make(map[string]interface{})
		err = json.Unmarshal(b.Next(offset-1), &m)
		if err != nil {
			return false
		}
	}

	j.metadata = NewMetadata(m)
	j.markdown = bytes.NewBuffer(b.Bytes())

	return true
}
609414
func (c *Cmd) Init() {
	c.Lock()
	defer c.Unlock()

	c.exitCh = make(chan struct{})
}
1164246
func init() {
	flag.BoolVar(&resolve.AllowFloat, "fp", resolve.AllowFloat, "allow floating-point numbers")
	flag.BoolVar(&resolve.AllowSet, "set", resolve.AllowSet, "allow set data type")
	flag.BoolVar(&resolve.AllowLambda, "lambda", resolve.AllowLambda, "allow lambda expressions")
	flag.BoolVar(&resolve.AllowNestedDef, "nesteddef", resolve.AllowNestedDef, "allow nested def statements")
	flag.BoolVar(&resolve.AllowBitwise, "bitwise", resolve.AllowBitwise, "allow bitwise operations (&, |, ^, ~, <<, and >>)")
}
863065
func (r *LogResponse) Init(context smolder.APIContext) {
	r.Parent = r
	r.Context = context

	r.Logs = []logInfoResponse{}
}
627929
func (engine *Engine) Init() {
	engine.RelTagIdentifier = `rel`
	engine.AliasTagIdentifier = `alias`
	engine.TLogger = NewTLogger(engine.logger)
}