End isURL
(input string)
| 69 | return parsedURL.Scheme != "" && parsedURL.Host != "" |
| 70 | } // End isURL |
| 71 | func isFilePath(input string) (bool, error) { // Check if input is file |
| 72 | _, err := os.Stat(input) // Get file info |
| 73 | if err != nil { |
| 74 | if os.IsNotExist(err) { |
| 75 | return false, errors.New("file does not exist") |
| 76 | } |
| 77 | if os.IsPermission(err) { |
| 78 | return false, errors.New("permission denied") |
| 79 | } |
| 80 | return false, err |
| 81 | } |
| 82 | return true, nil // File exists |
| 83 | } // End isFilePath |
| 84 | func loadFromURL(inputURL string) (string, error) { // Load schema from URL |
| 85 | // Parse and validate the URL |
| 86 | parsedURL, err := url.Parse(inputURL) |
no outgoing calls
no test coverage detected