Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use strings.Contains instead #1573

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions module.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (m *Module) Namespace() (namespace string) {
// Returns the named controller and action that is in this module.
func (m *Module) ControllerByName(name, action string) (ctype *ControllerType) {
comparison := name
if strings.Index(name, namespaceSeperator) < 0 {
if !strings.Contains(name, namespaceSeperator) {
comparison = m.Namespace() + name
}
for _, c := range m.ControllerTypeList {
Expand Down Expand Up @@ -129,9 +129,7 @@ func ModuleByName(name string) (*Module, bool) {
// Loads the modules specified in the config.
func loadModules() {
keys := []string{}
for _, key := range Config.Options("module.") {
keys = append(keys, key)
}
keys = append(keys, Config.Options("module.")...)

// Reorder module order by key name, a poor mans sort but at least it is consistent
sort.Strings(keys)
Expand Down