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: Ellipsoid.go
    path of file: ./repos/tegola/vendor/github.com/go-spatial/proj/core
    
    the code of the file until where you have to start completion: // Copyright (C) 2018, Michael P. Gerlek (Flaxen Consulting)
//
// Portions of this code were derived from the PROJ.4 software
// In keeping with the terms of the PROJ.4 project, this software
// is provided under the MIT-style license in `LICENSE.md` and may
// additionally be subject to the copyrights of the PROJ.4 authors.

package core

import (
	"encodi
    
func (e *Ellipsoid) doSize(ps *support.ProjString) error {

	P := e

	aWasSet := false

	/* A size parameter *must* be given, but may have been given as ellps prior */
	if P.A != 0.0 {
		aWasSet = true
	}

	/* Check which size key is specified */
	key := "R"
	value, ok := ps.GetAsFloat("R")
	if !ok {
		key = "a"
		value, ok = ps.GetAsFloat("a")
	}
	if !ok {
		if aWasSet {
			return nil
		}
		return merror.New(merror.MajorAxisNotGiven)
	}

	P.DefSize = key
	P.A = value
	if P.A <= 0.0 {
		return merror.New(merror.MajorAxisNotGiven)
	}
	if P.A == math.MaxFloat64 {
		return merror.New(merror.MajorAxisNotGiven)
	}

	if key == "R" {
		P.Es = 0
		P.F = 0
		P.E = 0
		P.Rf = 0
		P.B = P.A
	}

	return nil
}