func (h *proxyHandler) GETMod(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	path, ver := parsePathVersion(r)

	mod, err := h.uc.LoadModule(ctx, path)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
	if !mod.HasVersion(ver) {
		respondError(w, statusCode(domain.ErrNotFound), fmt.Errorf("%w: \"%s\": unknown revision %s", domain.ErrNotFound, path, ver))
		return
	}

	f, err := h.uc.GetModFile(ctx, mod, ver)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}

	fmt.Fprintln(w, f)
}
// GETMod handles mod file queries.
GETMod handles mod file queries.
// GETMod handles mod file queries .
func (h *proxyHandler) GETMod(w http.ResponseWriter, r *http.Request) {
	ctx := r.Context()
	path, ver := parsePathVersion(r)
	mod, err := h.uc.LoadModule(ctx, path)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
	if !mod.HasVersion(ver) {
		respondError(w, statusCode(domain.ErrNotFound), fmt.Errorf("%w: \"%s\": unknown revision %s", domain.ErrNotFound, path, ver))
		return
	}
	f, err := h.uc.GetModFile(ctx, mod, ver)
	if err != nil {
		respondError(w, statusCode(err), err)
		return
	}
	fmt.Fprintln(w, f)
}
func ( h * proxyHandler ) GETMod ( w http . ResponseWriter , r * http . Request ) { ctx := r . Context ( ) path , ver := parsePathVersion ( r ) mod , err := h . uc . LoadModule ( ctx , path ) if err != nil { respondError ( w , statusCode ( err ) , err ) return } if ! mod . HasVersion ( ver ) { respondError ( w , statusCode ( domain . ErrNotFound ) , fmt . Errorf ( " \" \" " , domain . ErrNotFound , path , ver ) ) return } f , err := h . uc . GetModFile ( ctx , mod , ver ) if err != nil { respondError ( w , statusCode ( err ) , err ) return } fmt . Fprintln ( w , f ) }
GETMod handles mod file queries.
GETMod handles mod file queries .