ran generate/build
MODIFY
hardcoded/hardcoded.go
hardcoded/hardcoded.go
@@ -12,7 +12,6 @@ import (
"crypto/sha256"
"fmt"
"io"
- "io/ioutil"
"os"
"path/filepath"
"strings"
@@ -234,11 +233,13 @@ const AssetDebug = false
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
+//
// data/
// foo.txt
// img/
// a.png
// b.png
+//
// then AssetDir("data") would return []string{"foo.txt", "img"},
// AssetDir("data/img") would return []string{"a.png", "b.png"},
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
@@ -294,7 +295,7 @@ func RestoreAsset(dir, name string) error {
if err != nil {
return err
}
- err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
+ err = os.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}

ADD
samples/gen-go-blog/client/mock_client.go
+// Code generated by MockGen. DO NOT EDIT.
+// Source: interface.go
+
+// Package client is a generated GoMock package.
+package client
+
+import (
+ context "context"
+ reflect "reflect"
+
+ models "github.com/Clever/wag/samples/v8/gen-go-blog/models"
+ gomock "github.com/golang/mock/gomock"
+)
+
+// MockClient is a mock of Client interface.
+type MockClient struct {
+ ctrl *gomock.Controller
+ recorder *MockClientMockRecorder
+}
+
+// MockClientMockRecorder is the mock recorder for MockClient.
+type MockClientMockRecorder struct {
+ mock *MockClient
+}
+
+// NewMockClient creates a new mock instance.
+func NewMockClient(ctrl *gomock.Controller) *MockClient {git s
+ mock := &MockClient{ctrl: ctrl}
+ mock.recorder = &MockClientMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockClient) EXPECT() *MockClientMockRecorder {
+ return m.recorder
+}
+
+// GetSectionsForStudent mocks base method.
+func (m *MockClient) GetSectionsForStudent(ctx context.Context, studentID string) ([]models.Section, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetSectionsForStudent", ctx, studentID)
+ ret0, _ := ret[0].([]models.Section)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetSectionsForStudent indicates an expected call of GetSectionsForStudent.
+func (mr *MockClientMockRecorder) GetSectionsForStudent(ctx, studentID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSectionsForStudent", reflect.TypeOf((*MockClient)(nil).GetSectionsForStudent), ctx, studentID)
+}
+
+// PostGradeFileForStudent mocks base method.
+func (m *MockClient) PostGradeFileForStudent(ctx context.Context, i *models.PostGradeFileForStudentInput) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PostGradeFileForStudent", ctx, i)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PostGradeFileForStudent indicates an expected call of PostGradeFileForStudent.
+func (mr *MockClientMockRecorder) PostGradeFileForStudent(ctx, i interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostGradeFileForStudent", reflect.TypeOf((*MockClient)(nil).PostGradeFileForStudent), ctx, i)
+}
+
+// PostSectionsForStudent mocks base method.
+func (m *MockClient) PostSectionsForStudent(ctx context.Context, i *models.PostSectionsForStudentInput) ([]models.Section, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PostSectionsForStudent", ctx, i)
+ ret0, _ := ret[0].([]models.Section)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PostSectionsForStudent indicates an expected call of PostSectionsForStudent.
+func (mr *MockClientMockRecorder) PostSectionsForStudent(ctx, i interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostSectionsForStudent", reflect.TypeOf((*MockClient)(nil).PostSectionsForStudent), ctx, i)
+}

ADD
samples/gen-go-blog/server/mock_controller.go
+// Code generated by MockGen. DO NOT EDIT.
+// Source: interface.go
+
+// Package server is a generated GoMock package.
+package server
+
+import (
+ context "context"
+ reflect "reflect"
+
+ models "github.com/Clever/wag/samples/v8/gen-go-blog/models"
+ gomock "github.com/golang/mock/gomock"
+)
+
+// MockController is a mock of Controller interface.
+type MockController struct {
+ ctrl *gomock.Controller
+ recorder *MockControllerMockRecorder
+}
+
+// MockControllerMockRecorder is the mock recorder for MockController.
+type MockControllerMockRecorder struct {
+ mock *MockController
+}
+
+// NewMockController creates a new mock instance.
+func NewMockController(ctrl *gomock.Controller) *MockController {
+ mock := &MockController{ctrl: ctrl}
+ mock.recorder = &MockControllerMockRecorder{mock}
+ return mock
+}
+
+// EXPECT returns an object that allows the caller to indicate expected use.
+func (m *MockController) EXPECT() *MockControllerMockRecorder {
+ return m.recorder
+}
+
+// GetSectionsForStudent mocks base method.
+func (m *MockController) GetSectionsForStudent(ctx context.Context, studentID string) ([]models.Section, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "GetSectionsForStudent", ctx, studentID)
+ ret0, _ := ret[0].([]models.Section)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// GetSectionsForStudent indicates an expected call of GetSectionsForStudent.
+func (mr *MockControllerMockRecorder) GetSectionsForStudent(ctx, studentID interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSectionsForStudent", reflect.TypeOf((*MockController)(nil).GetSectionsForStudent), ctx, studentID)
+}
+
+// PostGradeFileForStudent mocks base method.
+func (m *MockController) PostGradeFileForStudent(ctx context.Context, i *models.PostGradeFileForStudentInput) error {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PostGradeFileForStudent", ctx, i)
+ ret0, _ := ret[0].(error)
+ return ret0
+}
+
+// PostGradeFileForStudent indicates an expected call of PostGradeFileForStudent.
+func (mr *MockControllerMockRecorder) PostGradeFileForStudent(ctx, i interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostGradeFileForStudent", reflect.TypeOf((*MockController)(nil).PostGradeFileForStudent), ctx, i)
+}
+
+// PostSectionsForStudent mocks base method.
+func (m *MockController) PostSectionsForStudent(ctx context.Context, i *models.PostSectionsForStudentInput) ([]models.Section, error) {
+ m.ctrl.T.Helper()
+ ret := m.ctrl.Call(m, "PostSectionsForStudent", ctx, i)
+ ret0, _ := ret[0].([]models.Section)
+ ret1, _ := ret[1].(error)
+ return ret0, ret1
+}
+
+// PostSectionsForStudent indicates an expected call of PostSectionsForStudent.
+func (mr *MockControllerMockRecorder) PostSectionsForStudent(ctx, i interface{}) *gomock.Call {
+ mr.mock.ctrl.T.Helper()
+ return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PostSectionsForStudent", reflect.TypeOf((*MockController)(nil).PostSectionsForStudent), ctx, i)
+}

MODIFY
samples/go.sum
samples/go.sum
@@ -247,6 +247,7 @@ github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALr
github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4=
github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA=
github.com/kevinburke/go-bindata v3.23.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
+github.com/kevinburke/go-bindata v3.24.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=

MODIFY
server/gendb/bindata.go
server/gendb/bindata.go
@@ -15,7 +15,6 @@ import (
"crypto/sha256"
"fmt"
"io"
- "io/ioutil"
"os"
"path/filepath"
"strings"
@@ -300,11 +299,13 @@ const AssetDebug = false
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
+//
// data/
// foo.txt
// img/
// a.png
// b.png
+//
// then AssetDir("data") would return []string{"foo.txt", "img"},
// AssetDir("data/img") would return []string{"a.png", "b.png"},
// AssetDir("foo.txt") and AssetDir("notexist") would return an error, and
@@ -359,7 +360,7 @@ func RestoreAsset(dir, name string) error {
if err != nil {
return err
}
- err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
+ err = os.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}

ran generate/build