grokify/mogo

View on GitHub
net/http/har/har_util.go

Summary

Maintainability
A
0 mins
Test Coverage
package har

import (
    "encoding/json"
    "os"
)

func ReadLogFile(filename string) (Log, error) {
    h := Log{}

    bytes, err := os.ReadFile(filename)
    if err != nil {
        return h, err
    }

    return h, json.Unmarshal(bytes, &h)
}