You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: vulnerability.go
    path of file: ./repos/grype/grype/db/v3/store/model
    
    the code of the file until where you have to start completion: package model

import (
	"encoding/json"
	"fmt"

	v3 "github.com/anchore/grype/grype/db/v3"
)

const (
	VulnerabilityTableName    = "vulnerability"
	GetVulnerabilityIndexName = "get_vulnerability_index"
)

// VulnerabilityModel is a struct used to 
    
func NewVulnerabilityModel(vulnerability v3.Vulnerability) VulnerabilityModel {
	cpes, err := json.Marshal(vulnerability.CPEs)
	if err != nil {
		// TODO: just no
		panic(err)
	}

	related, err := json.Marshal(vulnerability.RelatedVulnerabilities)
	if err != nil {
		// TODO: just no
		panic(err)
	}

	advisories, err := json.Marshal(vulnerability.Advisories)
	if err != nil {
		// TODO: just no
		panic(err)
	}

	fixedInVersions, err := json.Marshal(vulnerability.Fix.Versions)
	if err != nil {
		// TODO: just no
		panic(err)
	}

	return VulnerabilityModel{
		ID:                     vulnerability.ID,
		PackageName:            vulnerability.PackageName,
		Namespace:              vulnerability.Namespace,
		VersionConstraint:      vulnerability.VersionConstraint,
		VersionFormat:          vulnerability.VersionFormat,
		FixedInVersions:        string(fixedInVersions),
		FixState:               string(vulnerability.Fix.State),
		Advisories:             string(advisories),
		CPEs:                   string(cpes),
		RelatedVulnerabilities: string(related),
	}
}