Repository: gofiber/fiber
File: app.go (Go)

Code before:
		app.config.BodyLimit = DefaultBodyLimit
	}
	if app.config.Concurrency <= 0 {
		app.config.Concurrency = DefaultConcurrency
	}
	if app.config.ReadBufferSize <= 0 {
		app.config.ReadBufferSize = DefaultReadBufferSize
	}
	if app.config.WriteBufferSize <= 0 {
		app.config.WriteBufferSize = DefaultWriteBufferSize
	}
	if app.config.CompressedFileSuffix == "" {
		app.config.CompressedFileSuffix = DefaultCompressedFileSuffix
	}
	if app.config.Immutable {
		getBytes, getString = getBytesImmutable, getStringImmutable
	}
	if app.config.ErrorHandler == nil {
		app.config.ErrorHandler = DefaultErrorHandler
	}
	if app.config.JSONEncoder == nil {
		app.config.JSONEncoder = json.Marshal
	}
	if app.config.Network == "" {
		app.config.Network = "tcp4"
	}

	// Init app
	app.init()

	// Return app
	return app
}

// Mount attaches another app instance as a sub-router along a routing path.
// It's very useful to split up a large API as many independent routers and
// compose them as a single service using Mount.
func (app *App) Mount(prefix string, fiber *App) Router {
	stack := fiber.Stack()
	for m := range stack {
		for r := range stack[m] {
			route := app.copyRoute(stack[m][r])
			app.addRoute(route.Method, app.addPrefixToRoute(prefix, route))
		}
	}
	return app
}

// Use registers a middleware route that will match requests
// with the provided prefix (which is optional and defaults to "/").
//

Review comment (suggestion):
Wouldn't it be better if you keep this strings (`tcp`, `tcp4`, `tcp6`) as constant and use the constant everywhere?
Also make those constants exported, so that when I use the network option, i can use it like `Network: fiber.NetworkTCP4` instead of `Network: "tcp4"`. And typing hardcoded strings can be misspelled.

Code after:
		app.config.BodyLimit = DefaultBodyLimit
	}
	if app.config.Concurrency <= 0 {
		app.config.Concurrency = DefaultConcurrency
	}
	if app.config.ReadBufferSize <= 0 {
		app.config.ReadBufferSize = DefaultReadBufferSize
	}
	if app.config.WriteBufferSize <= 0 {
		app.config.WriteBufferSize = DefaultWriteBufferSize
	}
	if app.config.CompressedFileSuffix == "" {
		app.config.CompressedFileSuffix = DefaultCompressedFileSuffix
	}
	if app.config.Immutable {
		getBytes, getString = getBytesImmutable, getStringImmutable
	}
	if app.config.ErrorHandler == nil {
		app.config.ErrorHandler = DefaultErrorHandler
	}
	if app.config.JSONEncoder == nil {
		app.config.JSONEncoder = json.Marshal
	}
	if app.config.Network == "" {
		app.config.Network = NetworkTCP4
	}

	// Init app
	app.init()

	// Return app
	return app
}

// Mount attaches another app instance as a sub-router along a routing path.
// It's very useful to split up a large API as many independent routers and
// compose them as a single service using Mount.
func (app *App) Mount(prefix string, fiber *App) Router {
	stack := fiber.Stack()
	for m := range stack {
		for r := range stack[m] {
			route := app.copyRoute(stack[m][r])
			app.addRoute(route.Method, app.addPrefixToRoute(prefix, route))
		}
	}
	return app
}

// Use registers a middleware route that will match requests
// with the provided prefix (which is optional and defaults to "/").
//