Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for parseMetaGoImports (0.26 sec)

  1. src/cmd/go/internal/vcs/discovery.go

    		return input, nil
    	default:
    		return nil, fmt.Errorf("can't decode XML document using charset %q", charset)
    	}
    }
    
    // parseMetaGoImports returns meta imports from the HTML in r.
    // Parsing ends at the end of the <head> section or the beginning of the <body>.
    func parseMetaGoImports(r io.Reader, mod ModuleMode) ([]metaImport, error) {
    	d := xml.NewDecoder(r)
    	d.CharsetReader = charsetReader
    	d.Strict = false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 11 18:14:49 UTC 2020
    - 2.6K bytes
    - Viewed (0)
  2. src/cmd/go/internal/vcs/discovery_test.go

    			{"myitcv.io", "git", "https://github.com/myitcv/x"},
    		},
    	},
    }
    
    func TestParseMetaGoImports(t *testing.T) {
    	for i, tt := range parseMetaGoImportsTests {
    		out, err := parseMetaGoImports(strings.NewReader(tt.in), tt.mod)
    		if err != nil {
    			t.Errorf("test#%d: %v", i, err)
    			continue
    		}
    		if !reflect.DeepEqual(out, tt.out) {
    			t.Errorf("test#%d:\n\thave %q\n\twant %q", i, out, tt.out)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 11 18:14:49 UTC 2020
    - 3.4K bytes
    - Viewed (0)
  3. src/cmd/go/internal/vcs/vcs.go

    		msg := "https fetch: %v"
    		if security == web.Insecure {
    			msg = "http/" + msg
    		}
    		return nil, fmt.Errorf(msg, err)
    	}
    	body := resp.Body
    	defer body.Close()
    	imports, err := parseMetaGoImports(body, mod)
    	if len(imports) == 0 {
    		if respErr := resp.Err(); respErr != nil {
    			// If the server's status was not OK, prefer to report that instead of
    			// an XML parse error.
    			return nil, respErr
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:30:18 UTC 2024
    - 46.2K bytes
    - Viewed (0)
Back to top