Skip to content

fix parse type: field must be exported#44

Open
touchmarine wants to merge 1 commit intopacedotdev:mainfrom
touchmarine:fix/must-be-exported
Open

fix parse type: field must be exported#44
touchmarine wants to merge 1 commit intopacedotdev:mainfrom
touchmarine:fix/must-be-exported

Conversation

@touchmarine
Copy link

Parsing the below example fails with the error: parse output object type: parse type: /usr/local/go/src/math/big/int.go:34:2: neg must be exported.

type CalculatorService interface {
	Calculate(CalculateRequest) CalculateResponse
}

type CalculateRequest struct{}

type CalculateResponse struct {
	// big.Int has unexported fields
	Result big.Int
}

This pull request fixes this, but still errors if the request or response object has an unexported field:

type CalculatorService interface {
	Calculate(CalculateRequest) CalculateResponse
}

type CalculateRequest struct{}

type CalculateResponse struct {
	result int
}

Request/response struct fields must still be exported, but deeper fields
in them can now be unexported. This allows the use of types such as
big.Int which contains unexported fields.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants