Can now convert csv to proto + open proto file + filter
This commit is contained in:
@@ -6,6 +6,15 @@ import (
|
||||
// "git.cems.dev/cdricms/bdooc/parsing"
|
||||
)
|
||||
|
||||
func SaveToFile(data []uint8, filename string) error {
|
||||
EmployeeList := &EmployeeList{}
|
||||
err := proto.Unmarshal(data, EmployeeList)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return EmployeeList.SaveToFile(filename)
|
||||
}
|
||||
|
||||
func (el *EmployeeList) SaveToFile(filename string) error {
|
||||
data, err := proto.Marshal(el)
|
||||
if err != nil {
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"math"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func GetMax[T float64 | float32 | int | uint | int8 | uint8 | int16 | uint16 | int32 | uint32 | int64 | uint64](a, b T) T {
|
||||
@@ -62,6 +63,15 @@ const (
|
||||
FieldPassword = "Password"
|
||||
)
|
||||
|
||||
func SnakeCaseToPascalCase(s string) string {
|
||||
words := strings.Split(s, "_")
|
||||
for i, word := range words {
|
||||
words[i] = strings.ToUpper(word[0:1]) + strings.ToLower(word[1:])
|
||||
}
|
||||
return strings.Join(words, "")
|
||||
}
|
||||
|
||||
|
||||
func (e *Employee) Copy() Employee {
|
||||
return Employee{
|
||||
EmpId: e.GetEmpId(),
|
||||
|
||||
Reference in New Issue
Block a user