class GoModulesMetaAnalyzer extends AbstractMetaAnalyzer {

    private static final Logger LOGGER = Logger.getLogger(GoModulesMetaAnalyzer.class);
    private static final String DEFAULT_BASE_URL = "https://proxy.golang.org";
    private static final String API_URL = "/%s/%s/@latest";

    GoModulesMetaAnalyzer() {
        this.baseUrl = DEFAULT_BASE_URL;
    }

    @Override
    public RepositoryType supportedRepositoryType() {
        return RepositoryType.GO_MODULES;
    }

    @Override
    public boolean isApplicable(final Component component) {
        return component.getPurl() != null && PackageURL.StandardTypes.GOLANG.equals(component.getPurl().getType());
    }

    @Override
    public MetaModel analyze(final Component component) {<FILL_FUNCTION_BODY>}

    /**
     * "To avoid ambiguity when serving from case-insensitive file systems, the $module [...] elements are
     * case-encoded by replacing every uppercase letter with an exclamation mark followed by the corresponding
     * lower-case letter."
     *
     * @param modulePath The module path to encode
     * @return The encoded module path
     */
    String caseEncode(final String modulePath) {
        return modulePath.replaceAll("([A-Z])", "!$1").toLowerCase();
    }

}

        final var meta = new MetaModel(component);

        if (component.getPurl() == null || component.getPurl().getNamespace() == null) {
            return meta;
        }
        final String url = String.format(baseUrl + API_URL, caseEncode(component.getPurl().getNamespace()), caseEncode(component.getPurl().getName()));

        try (final CloseableHttpResponse response = processHttpRequest(url)) {
            if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                if (response.getEntity()!=null) {
                    String responseString = EntityUtils.toString(response.getEntity());
                    final var responseJson = new JSONObject(responseString);
                    meta.setLatestVersion(responseJson.getString("Version"));

                    // Module versions are prefixed with "v" in the Go ecosystem.
                    // Because some services (like OSS Index as of July 2021) do not support
                    // versions with this prefix, components in DT may not be prefixed either.
                    //
                    // In order to make the versions comparable still, we strip the "v" prefix as well,
                    // if it was done for the analyzed component.
                    if (component.getVersion() != null && !component.getVersion().startsWith("v")) {
                        meta.setLatestVersion(StringUtils.stripStart(meta.getLatestVersion(), "v"));
                    }

                    final String commitTimestamp = responseJson.getString("Time");
                    if (StringUtils.isNotBlank(commitTimestamp)) { // Time is optional
                        meta.setPublishedTimestamp(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(commitTimestamp));
                    }
                }
            } else {
                handleUnexpectedHttpResponse(LOGGER, url, response.getStatusLine().getStatusCode(), response.getStatusLine().getReasonPhrase(), component);
            }
        } catch (IOException | ParseException e) {
            handleRequestException(LOGGER, e);
        } catch (Exception ex) {
            throw new MetaAnalyzerException(ex);
        }

        return meta;
    
<methods>public non-sealed void <init>() ,public void setRepositoryBaseUrl(java.lang.String) ,public void setRepositoryUsernameAndPassword(java.lang.String, java.lang.String) <variables>protected java.lang.String baseUrl,protected java.lang.String password,protected java.lang.String username