master
go 18 lines 489 Bytes
Raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 package functions
4
5 import (
6 "fmt"
7 "strings"
8 )
9
10 // SplitFunctionName splits a function name into module and method parts.
11 // Expected format: module:method.
12 func SplitFunctionName(name string) (string, string, error) {
13 parts := strings.SplitN(name, ":", 2)
14 if len(parts) != 2 || parts[0] == "" || parts[1] == "" {
15 return "", "", fmt.Errorf("invalid function name '%s' (expected module:method)", name)
16 }
17 return parts[0], parts[1], nil
18 }