code: func (o *NamespaceOptions) setNamespace(fromContext *api.Context, withContextName string) error {
  	if len(fromContext.Namespace) == 0 {
  		return fmt.Errorf("a non-empty namespace must be provided")
  	}
  
  	configAccess := clientcmd.NewDefaultPathOptions()
  
  	// determine if we have already saved this context to the user's KUBECONFIG before
  	// if so, simply switch the current context to the existing one.
  	if existingResultingCtx, exists := o.rawConfig.Contexts[withContextName]; !exists || !isContextEqual(fromContext, existingResultingCtx) {
  		o.rawConfig.Contexts[withContextName] = fromContext
  	}
  	o.rawConfig.CurrentContext = withContextName
  
  	fmt.Fprintf(o.Out, "namespace changed to %q\n", fromContext.Namespace)
  	return clientcmd.ModifyConfig(configAccess, o.rawConfig, true)
  }
docs: // setNamespace receives a "desired" context state and determines if a similar context
  // is already present in a user's KUBECONFIG. If one is not, then a new context is added
  // to the user's config under the provided destination name.
  // The current context field is updated to point to the new context.