duit_go

Форк
0
29 строк · 694.0 Байт
1
package duit_core
2

3
import (
4
	"os"
5
)
6

7
type DuitView struct{}
8

9
// Static reads the content of a file specified by the given file path.
10
//
11
// It takes a single parameter, filePath, which is a string representing the path to the file.
12
// The function returns a string containing the content of the file and an error if any occurred.
13
func (view *DuitView) Static(filePath string) (string, error) {
14
	jsonObj, err := os.ReadFile(filePath)
15

16
	if err != nil {
17
		return "", err
18
	}
19

20
	return string(jsonObj), nil
21
}
22

23
// Builder returns a new UiBuilder instance.
24
//
25
// No parameters.
26
// *UiBuilder - a pointer to the new UiBuilder instance.
27
func (view *DuitView) Builder() *UiBuilder {
28
	return &UiBuilder{}
29
}
30

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.