func (m *MockService) WritePact() error {
	log.Println("[DEBUG] mock service write pact")

	if m.Consumer == "" || m.Provider == "" {
		return errors.New("Consumer and Provider name need to be provided")
	}
	if m.PactFileWriteMode == "" {
		m.PactFileWriteMode = "overwrite"
	}

	pact := map[string]interface{}{
		"consumer": map[string]string{
			"name": m.Consumer,
		},
		"provider": map[string]string{
			"name": m.Provider,
		},
		"pactFileWriteMode": m.PactFileWriteMode,
	}

	url := fmt.Sprintf("%s/pact", m.BaseURL)
	return m.call("POST", url, pact)
}
func (m *MockService) WritePact() error {
	log.Println("[DEBUG] mock service write pact")

	if m.Consumer == "" || m.Provider == "" {
		return errors.New("Consumer and Provider name need to be provided")
	}
	if m.PactFileWriteMode == "" {
		m.PactFileWriteMode = "overwrite"
	}

	pact := map[string]interface{}{
		"consumer": map[string]string{
			"name": m.Consumer,
		},
		"provider": map[string]string{
			"name": m.Provider,
		},
		"pactFileWriteMode": m.PactFileWriteMode,
	}

	url := fmt.Sprintf("%s/pact", m.BaseURL)
	return m.call("POST", url, pact)
}
func ( m * MockService ) WritePact ( ) error { log . Println ( " " ) if m . Consumer == " " || m . Provider == " " { return errors . New ( " " ) } if m . PactFileWriteMode == " " { m . PactFileWriteMode = " " } pact := map [ string ] interface { } { " " : map [ string ] string { " " : m . Consumer , } , " " : map [ string ] string { " " : m . Provider , } , " " : m . PactFileWriteMode , } url := fmt . Sprintf ( " " , m . BaseURL ) return m . call ( " " , url , pact ) }
// WritePact writes the pact file to disk.
WritePact writes the pact file to disk .