( id toolspkg.ToolID, field string, value string, scope toolspkg.Scope, )
| 4903 | } |
| 4904 | |
| 4905 | func nativeCallerWorkspaceInput( |
| 4906 | id toolspkg.ToolID, |
| 4907 | field string, |
| 4908 | value string, |
| 4909 | scope toolspkg.Scope, |
| 4910 | ) (string, error) { |
| 4911 | trusted := strings.TrimSpace(scope.WorkspaceID) |
| 4912 | current := strings.TrimSpace(value) |
| 4913 | if scope.Operator { |
| 4914 | if current == "" { |
| 4915 | return trusted, nil |
| 4916 | } |
| 4917 | return current, nil |
| 4918 | } |
| 4919 | if trusted == "" { |
| 4920 | return current, nil |
| 4921 | } |
| 4922 | if current == "" { |
| 4923 | return trusted, nil |
| 4924 | } |
| 4925 | if current != trusted { |
| 4926 | return "", nativeScopeMismatchError(id, field) |
| 4927 | } |
| 4928 | return current, nil |
| 4929 | } |
| 4930 | |
| 4931 | func nativeScopeMismatchError(id toolspkg.ToolID, field string) error { |
| 4932 | return toolspkg.NewToolError( |
no test coverage detected