fix: correct build errors and clean up code
This commit is contained in:
parent
c39a2f31e6
commit
0b2ec9ce15
4
Makefile
4
Makefile
|
@ -11,8 +11,8 @@ verbose: goimports vet
|
||||||
GO111MODULE=off go install -v -x \
|
GO111MODULE=off go install -v -x \
|
||||||
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
build: goimports vet
|
build: goimports
|
||||||
GO111MODULE=off go build -v -x \
|
GO111MODULE=off go build \
|
||||||
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
||||||
|
|
||||||
install: goimports vet
|
install: goimports vet
|
||||||
|
|
10
add.go
10
add.go
|
@ -28,10 +28,10 @@ func addFile(filename string) (*chatpb.Chats, error) {
|
||||||
logDir := filepath.Dir(filename)
|
logDir := filepath.Dir(filename)
|
||||||
|
|
||||||
// Iterate through the structure to inline all external content.
|
// Iterate through the structure to inline all external content.
|
||||||
for _, chat := range logData.GetChats() {
|
for _, chat := range logData.Chats {
|
||||||
for _, entry := range chat.GetEntries() {
|
for _, entry := range chat.Entries {
|
||||||
// Inline main content from ContentFile
|
// Inline main content from ContentFile
|
||||||
if contentFile := entry.GetContentFile(); contentFile != "" {
|
if contentFile := entry.ContentFile; contentFile != "" {
|
||||||
contentPath := filepath.Join(logDir, contentFile)
|
contentPath := filepath.Join(logDir, contentFile)
|
||||||
contentBytes, err := os.ReadFile(contentPath)
|
contentBytes, err := os.ReadFile(contentPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -42,9 +42,9 @@ func addFile(filename string) (*chatpb.Chats, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inline snippet content from snippet files
|
// Inline snippet content from snippet files
|
||||||
if snippets := entry.GetSnippets(); snippets != nil {
|
if snippets := entry.Snippets; snippets != nil {
|
||||||
for _, snippet := range snippets {
|
for _, snippet := range snippets {
|
||||||
if snippetFile := snippet.GetFilename(); snippetFile != "" {
|
if snippetFile := snippet.Filename; snippetFile != "" {
|
||||||
snippetPath := filepath.Join(logDir, snippetFile)
|
snippetPath := filepath.Join(logDir, snippetFile)
|
||||||
contentBytes, err := os.ReadFile(snippetPath)
|
contentBytes, err := os.ReadFile(snippetPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue