This repository was archived by the owner on Feb 8, 2024. It is now read-only.
  
  
  
  
  
Description
At the moment, optional fields in structures are not implemented in vlang, but as far as I understand this is a matter of time. We can try to implement our own through generics:
struct None {}
type OptError = string | None
struct Opt<T> {
    value T
    error OptError = None{}
}
struct MessageModify {
    text Opt<string>
}
editQuery := MessageModify{Opt<string>{value: 'Hello there!'})
// Then in rest method check every field error and serializeOptions will replace almost all fields in already written structures
or do nothing yet and wait for implementation in language